Greg Stark <[EMAIL PROTECTED]> writes: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: >> On Wed, May 16, 2007 at 09:43:36AM -0400, Gregory Stark wrote: >>> I seem to recall there was a way to construct scenarios that returned >>> multiple >>> result sets via rules but I don't know how to arrange that. Anyone remember? >> >> An ALSO SELECT rule?
> It gives you an error. Not if you do it correctly. regression=# create table foo(f1 int); CREATE TABLE regression=# create rule r1 as on insert to foo do also regression-# ( select 1; select 2; select 3 ); CREATE RULE regression=# insert into foo values(42); ?column? ---------- 3 (1 row) INSERT 0 1 regression=# This shows BTW that PQexec throws away all but the last select-result; but they are all delivered to the client. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match