Re: [HACKERS] Get OID of just inserted record
От | Aaron J. Seigo |
---|---|
Тема | Re: [HACKERS] Get OID of just inserted record |
Дата | |
Msg-id | 99110211160101.28375@stilborne обсуждение исходный текст |
Ответ на | Re: [HACKERS] Get OID of just inserted record ("Andrij Korud" <akorud@polynet.lviv.ua>) |
Ответы |
Re: [HACKERS] Get OID of just inserted record
Re: [HACKERS] Get OID of just inserted record |
Список | pgsql-hackers |
hi... > My question is: > "CREATE TABLE t1 (word text)" > "INSERT INTO t1 VALUES('xxx')" (using SPI_execp) > > So, is there any way to obtain OID of word 'xxx' just after insertion > without doing "SELECT oid FROM t1 WHERE word='xxx'"? i've been watching this thread and it has caused this thought rumble forth: would it be possible to add a RETURN clause to INSERT? e.g. INSERT into t1 VALUES('xxx') RETURN oid; i could see where this would be useful in many different circumstances.. i know this isn't standards compliant, but would be very cool =) i know that with triggers, you have access to the current/old/new information, could this be harnessed to supply a RETURN facility? just a thought.. probably ignorable. -- Aaron J. Seigo Sys Admin
В списке pgsql-hackers по дате отправления: