Re: PostgreSQL roadmap for 8.2 and beyond. - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: PostgreSQL roadmap for 8.2 and beyond.
Date
Msg-id 20051016125638.GC5779@svana.org
Whole thread Raw
In response to Re: PostgreSQL roadmap for 8.2 and beyond.  ("Kevin McArthur" <postgresql-list@stormtide.ca>)
List pgsql-hackers
On Sun, Oct 16, 2005 at 01:20:45AM -0700, Kevin McArthur wrote:
> Don't forget insert/update returning. With the deprecation of OID's this
> functionality is becoming more and more important when using custom types
> and column defaults.

I use currval/nextval and have never actually needed such a feature,
though I can imagine it might be useful.

ISTM though this wouldn't be too hard to do. The executor already
takes a pointer to the function to send the output rows to. So, fiddle
the toplevel plannode to add the returning columns to the output and
when it receives the tuple split it into the part to be inserted and
the part to be returned.

> Some method for plpgsql to handle the result sets returned and save to a
> variable would be important for this feature too. Select into works but it
> would be silly to see something like select a into somevariable from (insert
> into tablename (a) default values returning a) instead of an extension to
> the insert statement itself.

How do other databases deal with this?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: A costing analysis tool
Next
From: Martijn van Oosterhout
Date:
Subject: Question about Ctrl-C and less