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

41.6. ルールおよびコマンドの状態 #

<title>Rules and Command Status</title>

The <productname>PostgreSQL</productname> server returns a command status string, such as <literal>INSERT 149592 1</literal>, for each command it receives. This is simple enough when there are no rules involved, but what happens when the query is rewritten by rules? PostgreSQLサーバでは、受け取った問い合わせのそれぞれに対して、INSERT 149592 1のようなコマンド状態文字列を返します。 これは簡単ですが、ルールが使用されていない場合には十分なものです。 しかし、問い合わせがルールにより書き換えられた場合、どのようになるでしょうか。

Rules affect the command status as follows: ルールはコマンド状態に以下のように影響を与えます。

The programmer can ensure that any desired <literal>INSTEAD</literal> rule is the one that sets the command status in the second case, by giving it the alphabetically last rule name among the active rules, so that it gets applied last. 後者の場合、プログラマは、有効ルールの中でアルファベット順の最後のルール名を与えることによって、必要なINSTEADルールを最後に実行することができます。そして、そのことによって、コマンド状態が確実にそのルールで設定されるようにできます。