Re: user defined function

From: andrew <andrew(dot)ylzhou(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: user defined function
Date: 2006-01-25 17:52:52
Message-ID: 29d3b0b90601250952m21bb9af1o79ec186ffdceadb1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

sorry, mistakenly leave out another try:

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

ERROR: Relation reference "person" cannot be used in an expression

On 1/25/06, andrew <andrew(dot)ylzhou(at)gmail(dot)com> wrote:
> 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
> Unable to identify a function that satisfies the given argument types
> You may need to add explicit typecasts
>
> On 1/25/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > andrew <andrew(dot)ylzhou(at)gmail(dot)com> writes:
> > > ERROR: parser: parse error at or near "record" at character 21
> > > in Warn_restart code
> >
> > > What is the problem here? Did you test it on 7.3?
> >
> > Yeah, 7.3.13 to be exact. (There have been a couple of changes in the
> > parser in the 7.3 branch, according to the CVS logs, but none look to
> > be related to this.) Where did that "in Warn_restart code" bit come
> > from? There's no such string anywhere in the 7.3 sources. Perhaps you
> > are playing with a copy that someone has modified/broken?
> >
> > regards, tom lane
> >
>
>
> --
> andrew
>

--
andrew

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2006-01-25 17:54:22 Re: [GENERAL] Different exponent in error messages
Previous Message andrew 2006-01-25 17:49:29 filtering after join