From 6eb9c5a5657d1fe77b55cc261450f3538d35a94d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:19:15 +0200 Subject: Adding upstream version 13.4. Signed-off-by: Daniel Baumann --- doc/src/sgml/html/rules-status.html | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/src/sgml/html/rules-status.html (limited to 'doc/src/sgml/html/rules-status.html') diff --git a/doc/src/sgml/html/rules-status.html b/doc/src/sgml/html/rules-status.html new file mode 100644 index 0000000..570500f --- /dev/null +++ b/doc/src/sgml/html/rules-status.html @@ -0,0 +1,35 @@ + +40.6. Rules and Command Status

40.6. Rules and Command Status

+ The PostgreSQL server returns a command + status string, such as INSERT 149592 1, 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? +

+ Rules affect the command status as follows: + +

  • + If there is no unconditional INSTEAD rule for the query, then + the originally given query will be executed, and its command + status will be returned as usual. (But note that if there were + any conditional INSTEAD rules, the negation of their qualifications + will have been added to the original query. This might reduce the + number of rows it processes, and if so the reported status will + be affected.) +

  • + If there is any unconditional INSTEAD rule for the query, then + the original query will not be executed at all. In this case, + the server will return the command status for the last query + that was inserted by an INSTEAD rule (conditional or + unconditional) and is of the same command type + (INSERT, UPDATE, or + DELETE) as the original query. If no query + meeting those requirements is added by any rule, then the + returned command status shows the original query type and + zeroes for the row-count and OID fields. +

+

+ The programmer can ensure that any desired INSTEAD 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. +

\ No newline at end of file -- cgit v1.2.3