RE: [HACKERS] SELECT FOR UPDATE in (PL/pgSQL) function
От | Hiroshi Inoue |
---|---|
Тема | RE: [HACKERS] SELECT FOR UPDATE in (PL/pgSQL) function |
Дата | |
Msg-id | 000101bed8a5$196b04c0$2801007e@cadzone.tpf.co.jp обсуждение исходный текст |
Ответ на | SELECT FOR UPDATE in function (Oleg Bartunov <oleg@sai.msu.su>) |
Ответы |
Re: [HACKERS] SELECT FOR UPDATE in (PL/pgSQL) function
|
Список | pgsql-hackers |
> > Is't possible to use SELECT FOR UPDATE in functions ? > I have function for 'insert or update' which works ok, but as I have some > problem with duplicated records I tried as suggested by Tom Lane to use > SELECT FOR UPDATE instead of just select. Unfortunately it doesn't works: > > ERROR: query didn't return correct # of attributes for *internal* > AFAIC,"SELECT FOR UPDATE" always causes above errors in PL/pgSQL functions. Could we use PL/pgSQL for update procedures in MVCC ? ORDER/GROUP BY items that are not in the targetlist also cause same errors in PL/pgSQL functions. In both cases,target entries are added which are not wanted in the final projected tuple(SELECT FOR UPDATE adds "ctid" entry). In such cases,the # of target entries is different from the # of final attributes estimated in pl_gram.y and above elog() in pl_exec.c is called. Should current check be loosen ? Or another check is necessary ? Regards. Hiroshi Inoue Inoue@tpf.co.jp
В списке pgsql-hackers по дате отправления: