Re: [HACKERS] getting new serial value of serial insert
От | Aaron J. Seigo |
---|---|
Тема | Re: [HACKERS] getting new serial value of serial insert |
Дата | |
Msg-id | 99110313340704.00702@stilborne обсуждение исходный текст |
Ответ на | [HACKERS] getting new serial value of serial insert (Ed Loehr <ELOEHR@austin.rr.com>) |
Список | pgsql-hackers |
hi... > create table mytable (id serial, name varchar); > > -- this returns # of rows inserted, as usual... > insert into mytable (name) values ('John'); > > -- this returns serial 'id' of inserted record... > insert into mytable (id,name) values (0,'Mary'); hm.. this is very elegant syntactically.. however, it would be nice to be able to have returned any number of fields of any types... (for example, i have a trigger that changes a field in a record whenever it gets updated/inserted.. it would be nice to get this returned as well...) also, if possible, it would be nice to extend this to UPDATE... can you think of a way to use this syntax aproach that would meet the needs above? > select id from mytable where oid = $sth->{pg_oid_status} > > Seems a waste to have to do this, but I'm not aware of another way. *nods* seems quite a few people are running into this. -- Aaron J. Seigo Sys Admin
В списке pgsql-hackers по дате отправления: