On 3 May 2012, at 24:00, Tom Lane wrote:
> Andy Chambers writes:
>> So ideally, I'd like to be able to do
>
>> insert into foo (a,b,foo_date)
>> select a,b,now() from foo old where
>> returning oid, old.oid
>
>> ...but this doesn't work. It seems you only have access to the table
>> bei
Andy Chambers writes:
> So ideally, I'd like to be able to do
> insert into foo (a,b,foo_date)
> select a,b,now() from foo old where
> returning oid, old.oid
> ...but this doesn't work. It seems you only have access to the table
> being modified in a returning clause.
Hm ... it is kin
On Wed, May 2, 2012 at 10:52 PM, Andy Chambers wrote:
> So ideally, I'd like to be able to do
>
> insert into foo (a,b,foo_date)
> select a,b,now() from foo old where
> returning oid, old.oid
>
> ...but this doesn't work. It seems you only have access to the table
> being modified in a ret
Hi,
I frequently have a need to insert new rows into a table that are
based on existing rows but with small changes.
This is easy using something like
insert into foo (a,b,foo_date)
select a,b,now() from foo old where
returning oid
However in the application layer, I need to know which