Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this - Mailing list pgsql-general

From Jim Wilson
Subject Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this
Date
Msg-id twig.1074969216.8270@kelcomaine.com
Whole thread Raw
In response to Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this  ("Lee Harr" <missive@hotmail.com>)
List pgsql-general
Lee Harr <missive@hotmail.com> said:

> >Unless your function parameter is an integer you must quote it... eq:
> >
> >select use_two_tables('tablename');
> >
>
> Hrm... That does not work either:
>
> # select use_two_tables('tablename');
> ERROR:  function use_two_tables("unknown") does not exist
> HINT:  No function matches the given name and argument types. You may need
> to add explicit type casts.
> # select use_two_tables('tablename'::text);
> ERROR:  function use_two_tables(text) does not exist
> HINT:  No function matches the given name and argument types. You may need
> to add explicit type casts.

Why not just use a text type in your definition?

CREATE or REPLACE FUNCTION use_two_tables(text) RETURNS text AS ...

You can always do a cast inside the procedure if you need to.

Best regards,

Jim Wilson


pgsql-general by date:

Previous
From: "Lee Harr"
Date:
Subject: Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this
Next
From: "Lee Harr"
Date:
Subject: Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this