From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Final(?) consensus on PQcmdStatus and rules |
Date: | 2002-10-14 18:35:14 |
Message-ID: | 18299.1034620514@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I'm about to go off and implement this, so just to make sure we are all
on the same page, here's what I think we agreed to:
In the presence of rewrite rules, the command status returned by a
rewritable query will behave thusly:
1. If the original query is executed (ie, there is no unconditional
INSTEAD rule), then the original query's command status is returned
in all cases. Queries added by rules are ignored.
2. If the original query is suppressed by an unconditional INSTEAD
rule, then return the command status of the last-executed query that
is both (a) from an INSTEAD rule and (b) of the same type (SELECT,
INSERT, UPDATE, DELETE) as the original query. If there is no such
query, return the original query's command type and zeroes for the
count and OID fields of the status.
This gives us several properties that were agreed to be desirable:
* Returned command type always matches original query.
* Non-INSTEAD rules never affect the command status.
* The user can control which query sets the command status in the
INSTEAD case, by ordering the rules properly.
* Reasonably compatible with the pre-7.2 behavior, taking into
account that the old behavior was not predictable if you had more
than one rule anyway.
Note that this will force an initdb for 7.3beta3, since we need to add
a field to Query nodes to keep track of whether they came from INSTEAD
rules. So I will also apply the pg_cast additions that we noticed were
missing a couple days ago. Were there any other items that we would
have fixed for 7.3 but were holding off to 7.4 just because of wanting
to avoid initdb?
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-10-14 18:42:47 | Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c |
Previous Message | Bruce Momjian | 2002-10-14 18:10:41 | Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c |