DO ... RETURNING

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема DO ... RETURNING
Дата
Msg-id 51B624C6.306@2ndQuadrant.com
обсуждение исходный текст
Ответы Re: DO ... RETURNING  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Hallo Everybody

As far as I can see, currently you can not return
anything out of a DO (anonymous code) block.

Something like

DO LANGUAGE plpythonu RETURNS TABLE (name text, uid int, gid int) $$
with open('/etc/passwd') as f:   fields = f.readline().split(':')   while fields:       name, uid, gid = fields[0],
int(fields[2]),int(fields[3])      yield name, uid, gid       fields = f.readline().split(':')
 
$$;

As I did not pay attention when DO was introduced,
I thought it is faster to ask here than read all possibly
relevant mails in archives

So: has there been a discussion on extending the DO
construct with ability to rturn data out of it, similar
to what named functions do.

If there was then what were the arguments against doing this ?

Or was this just that it was not thought important at that time ?

-- 
Hannu Krosing
PostgreSQL Consultant
Performance, Scalability and High Availability
2ndQuadrant Nordic OÜ




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Configurable location for extension .control files
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: DO ... RETURNING