Re: functions returning sets

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: functions returning sets
Дата
Msg-id 3FDF52A1.9040803@joeconway.com
обсуждение исходный текст
Ответ на Re: functions returning sets  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> Jeff Rogers <jrogers@findlaw.com> writes:
>>I expect this latter to return all the ids, but it seems to only return every
>>other one.
>
> Hmm, this looks like a bug having to do with not resetting state
> correctly for the next invocation of the SRF.  Hard to tell whether
> the bug is in your code or the system's support for SRFs though.
>
> Joe, did you see
> http://archives.postgresql.org/pgsql-general/2003-12/msg00709.php
> ?  I don't have time to look at this right now ...

I've not gotten to the bottom of this, but I can confirm the issue.

The way I would expect this query to be written does work:

regression=# select id from foo where 'a' in (select * from
pgxml_xpath(doc,'/top/node'));
  id
----
  1
  2
  3
(3 rows)

So the problem seems to be related specifically to "SRF returning setof
scalar in targetlist of subselect". Maybe some difference between
ExecMakeFunctionResult and ExecMakeTableFunctionResult? SRFs returning
complex types are not allowed in targetlists, but in this case there is
no restriction because the return type is scalar.

I'll keep digging as time allows.

Joe





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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: DB with bytea types reload problem
Следующее
От: Jonathan Bartlett
Дата:
Сообщение: Re: Reload bytea [was Re: Picture with Postgres and Delphi]