-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Josh Berkus wrote: > All, > > A Hibernate developer pointed out the following odd behavior to me in 8.2.1: > > create table test ( test1 text ); > create table test2 ( test_col text ); > create rule test_insert as on insert to test do instead insert into test2 > values ( NEW.test1 ) RETURNING test2.test_col; > > postgres=# insert into test values ( 'joe' ); > INSERT 0 1 > > ... no RETURNING. In fact, there doesn't seem to be any way to capture the > RETURNING output if you have a DO INSTEAD rule on an insert. Is this > intentional, or a bug?
I think this is a side effect of rules. I seem to remember that creating update view with rules is broken in a similar fashion. Sincerely, Joshua D. Drake - -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240 PostgreSQL solutions since 1997 http://www.commandprompt.com/ UNIQUE NOT NULL Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG6BlhATb/zqfZUUQRAntqAJ9rmCeX7t/23i5NIW1PpWIi8HGm/ACgkaMg k+VQip5jZolm+Xs7BsiZwkw= =hdNt -----END PGP SIGNATURE----- ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster