PostgreSQL

Thumbnail of post image 152

Row Level Securityに使用する列にインデックスを張ってみる

この記事は【PostgreSQL】Row Level Securityを有効化したテーブルでSQLの実行計画を検証する
の続きです。今回は前回使用したテ ...

PostgreSQL

Thumbnail of post image 101

本記事の目的

Row Level Securityを有効化したテーブルに対して、Bypass RLS属性を持つロールと持たないロールでSQLの実行計画がどのように変わるかを確認する。

検証用のテーブルとロールの準備

検証にはP ...

PostgreSQL

Thumbnail of post image 195

generate_series関数による連続値の生成

テスト用のデータをgenerate_series関数を使って連続した整数値、タイムスタンプを生成できる。generete_siries関数はgenerete_siries(start ...

PostgreSQL

Thumbnail of post image 169

Row Level Securityの概要

PostgreSQLのテーブル中の各行に対してSELECT文やUPDATE文による操作実行する際に、特定の条件(セキュリティポリシー)を満たしている場合のみ操作を許可するように設定することがで ...

PostgreSQL

Thumbnail of post image 056

実行環境macOS Mojave 10.14.6
Docker for Mac 2.1.0.4
PostgreSQLのコンテナを作成

ターミナルで以下のようにコマンドを実行する。以下の例ではPostgreSQL10のDock ...

AWS,Java,PostgreSQL

Thumbnail of post image 099

CodeBuildでのテスト時にも本番環境と同様にRDSを使用する

テスト環境と本番環境はできるだけ近い方が良いというのは皆さん納得されると思います。AWS ではCodeBuildをVPC内に作成することで、CodeBuildでのテスト ...

PostgreSQL

Thumbnail of post image 062

データベース一覧を表示するメタコマンド

psqlでデータベースへ接続後に¥lでデータベース一覧を表示することができます。

postgres=#\l

List of databasesName | Owner | Enc ...

PostgreSQL

Thumbnail of post image 082

postgres=#create database データベース名;

PostgreSQL

Thumbnail of post image 002

postgres=#select rolname from pg_roles;

rolname----------postgres(1 row)

より詳細な情報を表示する場合、
postgres=#\du

Li ...