データ変更の可視性

Postgres data changes visibility rule: during a query execution, data changes made by the query itself (via SQL-function, SPI-function, triggers) are invisible to the query scan. For example, in query INSERT INTO a SELECT * FROM a tuples inserted are invisible for SELECT' scan. In effect, this duplicates the database table within itself (subject to unique index rules, of course) without recursing.

Postgres でのデータ変更時の可視性規則は以 下の通りです。問い合わせの実行中、その問い合わせ自身によって(SQL 関 数、SPI 関数、トリガー経由で)なされたデータの変更はその問い合わせの スキャンからは不可視となります。例えば、 INSERT INTO a SELECT * FROM a という問い合わせでは、挿入されたタプルは SELECT スキャンからは不可視と なります。このため、この問い合わせはデータベースのテーブルを再帰処理す ることなく(もちろん、一意性インデックス規則にしたがって)二重化します。

Changes made by query Q are visible by queries which are started after query Q, no matter whether they are started inside Q (during the execution of Q) or after Q is done.

問い合わせ Q によりなされる変更は、問い合わせ Q の後に開始した問 い合わせに対しては可視です。この問い合わせが Q の内側で( Q の実 行中に)開始されたのか、Q の実行が終ってから開始されたのかについ ては問いません。