Returning Composite Types from C functions

Поиск
Список
Период
Сортировка
От John Hansen
Тема Returning Composite Types from C functions
Дата
Msg-id 5066E5A966339E42AA04BA10BA706AE50A9351@rodrick.geeknet.com.au
обсуждение исходный текст
Ответы Re: Returning Composite Types from C functions  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-hackers
Hi all,

CREATE TYPE my_type AS (a int,b int,c int,d int,e int
);

CREATE FUNCTION text_to_my_type(text)
RETURNS my_type
AS 'my_lib.so'
LANGUAGE 'C' IMMUTABLE STRICT;


CREATE CAST (text AS my_type) WITH FUNCTION text_to_my_type (text);

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?



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

Предыдущее
От: Andreas Pflug
Дата:
Сообщение: Re: Utility database (Was: RE: Autovacuum in the backend)
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Returning Composite Types from C functions