Re: Returning Composite Types from C functions

Поиск
Список
Период
Сортировка
От John Hansen
Тема Re: Returning Composite Types from C functions
Дата
Msg-id 5066E5A966339E42AA04BA10BA706AE50A9352@rodrick.geeknet.com.au
обсуждение исходный текст
Ответ на Returning Composite Types from C functions  ("John Hansen" <john@geeknet.com.au>)
Ответы Re: Returning Composite Types from C functions
Re: Returning Composite Types from C functions
Список pgsql-hackers
Michael Fuhr [mailto:mike@fuhr.org] Wrote:
> Sent: Saturday, June 18, 2005 9:56 PM
> To: John Hansen
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] Returning Composite Types from C functions
>
> On Sat, Jun 18, 2005 at 09:18:34PM +1000, John Hansen wrote:
> >
> > SELECT ('1:2:3:4:5'::text::my_type).*;
> >
> > This results in the text_to_my_type(text) function being called no
> > less than 5 times. Once for each element.
> >
> > Is this the desired behaviour, or a bug?
>
> It's a known behavior with functions that return composite types.
> Apparently it's not easy to fix:
>
> http://archives.postgresql.org/pgsql-hackers/2005-04/msg00971.php

There is a workaround tho, so should be fixable:

SELECT (a.b).* FROM (SELECT ('1:2:3:4:5'::text::my_type) AS b) AS a;

Or am I missing something?

>
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
>
>

... John



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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Returning Composite Types from C functions
Следующее
От: Jon Jensen
Дата:
Сообщение: Re: Utility database