Search Postgresql Archives

Re: user defined function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



andrew <andrew.ylzhou@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux