How to cast to regprocedure with OUT parameters

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: How to cast to regprocedure with OUT parameters
Date: 2014-08-14 15:13:03
Message-ID: lsijme$vm8$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

pg_get_functiondef() can be used quite easily by using a cast to regprocedure, like this:

select pg_get_functiondef('public.foo(text, text, text)'::regprocedure);

However if the function is defined with an out parameter like this:

create or replace function foo(p1 text, p2 out text, p3 text)
....

the above cast does not work. Postgres returns an error: "function public.foo(text,text,text) does not exist.

'public.foo(text, OUT text, text)'::regprocedure does not work either.

So, what should be the right format to write the string literal that can be cast to the correct regprocedure?

Thanks
Thomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-08-14 15:33:58 Re: How to cast to regprocedure with OUT parameters
Previous Message Alban Hertroys 2014-08-14 14:16:11 Re: Trigger function cannot reference field name with capital letter