Re: user defined function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: user defined function
Дата
Msg-id 13139.1138224526@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: user defined function  (andrew <andrew.ylzhou@gmail.com>)
Ответы Re: user defined function  (andrew <andrew.ylzhou@gmail.com>)
Список pgsql-general
andrew <andrew.ylzhou@gmail.com> writes:
> Sorry, I modified the parser code and forgot abt it. Now there is no
> problem in creating the function. But there is another problem. I
> create a function to accept record type parameter. But when I call it
> on a specific composite type, error is reported. The followings are
> what I have done:

> backend> create function complete(record) returns int4 as
> '$libdir/qualityudf' language C
> QUERY: create function complete(record) returns int4 as
> '$libdir/qualityudf' language C

> backend> select *, complete(Person) from Person
> QUERY: select *, complete(Person) from Person

> ERROR:  Function complete(person) does not exist

Hmm.  Looking at parse_coerce.c, 8.1 is the first release that thinks
named composite types can be coerced to RECORD.  I think you may be
forced to upgrade if you want this to work.  Changing 7.3's coerce_type()
to allow this case would be simple enough, but I think you are still
going to be minus a lot of infrastructure that's required to make it
actually do anything useful :-(

            regards, tom lane

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

Предыдущее
От: Benjamin Smith
Дата:
Сообщение: Re: Postgresql Segfault in 8.1
Следующее
От: Aly Dharshi
Дата:
Сообщение: Re: Postgresql Segfault in 8.1