Re: NEXT VALUE FOR
От | Thomas Munro |
---|---|
Тема | Re: NEXT VALUE FOR |
Дата | |
Msg-id | CADLWmXXPuwhrLNVw0J-CRdPJtSz7sd-0j8tsD1PLod9bp21=Aw@mail.gmail.com обсуждение исходный текст |
Ответ на |
Re: NEXT VALUE FOR |
Ответы |
Re: NEXT VALUE FOR |
Список | pgsql-hackers |
On 3 October 2014 00:18, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Thomas Munro <munro@ip9.org> writes: >> I suppose one approach would be to use command >> IDs as the scope. > > The spec clearly says one value per row, not one per statement; so > command ID is very definitely not the right thing. I think (command ID, estate->es_processed) would work. Tracking those two values in SeqTableData would allow you to detect the level change meaning the next tuple has been returned by a SELECT, updated by an UPDATE or inserted by an INSERT. This could be activated by a new 2-argument nextval with a boolean argument to request the standard behaviour. Then NEXT VALUE FOR could be translated to nextval(..., true). But I just can't figure out how to get my hands on the current EState or QueryDesc from inside a fmgr function, so I can't reach estate->es_processed from nextval... Best regards, Thomas Munro
В списке pgsql-hackers по дате отправления: