RETURNING and DO INSTEAD ... Intentional or not?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: RETURNING and DO INSTEAD ... Intentional or not?
Date: 2007-09-12 16:44:26
Message-ID: 200709120944.26875.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

--
Josh Berkus
PostgreSQL @ Sun
San Francisco

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2007-09-12 16:49:05 Re: A small mistake in the initial latestCompletedXid idea
Previous Message Tom Lane 2007-09-12 15:54:14 Re: A small mistake in the initial latestCompletedXid idea