Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group