バージョンごとのドキュメント一覧

39.2. データ変更の可視性 #

<title>Visibility of Data Changes</title>

If you execute SQL commands in your trigger function, and these commands access the table that the trigger is for, then you need to be aware of the data visibility rules, because they determine whether these SQL commands will see the data change that the trigger is fired for. Briefly: トリガ関数内でSQLコマンドを実行し、このコマンドがトリガの元となったテーブルにアクセスする場合、データの可視性規則に注意する必要があります。 この規則が、SQLコマンドがトリガの発行原因となったデータ変更を見ることができるかどうかを決定するからです。 簡単に以下に示します。

If your trigger function is written in any of the standard procedural languages, then the above statements apply only if the function is declared <literal>VOLATILE</literal>. Functions that are declared <literal>STABLE</literal> or <literal>IMMUTABLE</literal> will not see changes made by the calling command in any case. もし、あなたのトリガが標準的な手続き型言語のいずれかで記述されている時、上記の可視性は関数がVOLATILEで定義されている場合のみ適用されます。 STABLE、もしくはIMMUTABLEで定義されている関数は、どのようなケースにおいても、呼び出しコマンドによる変更は見ないでしょう。

Further information about data visibility rules can be found in <xref linkend="spi-visibility"/>. The example in <xref linkend="trigger-example"/> contains a demonstration of these rules. データ可視性規則に関する詳細は47.5にあります。 39.4の例にこの規則を示します。