Determine actual type of a pseudo-type argument

Started by Gerald Brittonover 6 years ago3 messagesgeneral
Jump to latest
#1Gerald Britton
gerald.britton@gmail.com

If I use a pseudo-type in the argument list of a function definition (SQL
or plpgsql), how can I determine the actual type used a runtime?

--
Gerald Britton, MCSE-DP, MVP
LinkedIn Profile: http://ca.linkedin.com/in/geraldbritton

#2Steve Baldwin
steve.baldwin@gmail.com
In reply to: Gerald Britton (#1)
Re: Determine actual type of a pseudo-type argument

I'm not sure what you mean by pseudo-type, but does the pg_typeof()
function help?

Steve

On Mon, Jan 6, 2020 at 9:34 AM Gerald Britton <gerald.britton@gmail.com>
wrote:

Show quoted text

If I use a pseudo-type in the argument list of a function definition (SQL
or plpgsql), how can I determine the actual type used a runtime?

--
Gerald Britton, MCSE-DP, MVP
LinkedIn Profile: http://ca.linkedin.com/in/geraldbritton

#3Gerald Britton
gerald.britton@gmail.com
In reply to: Steve Baldwin (#2)
Re: Determine actual type of a pseudo-type argument

E.g. anyelement, anyenum, anyarray are in a table of pseudo types in the
official docs.

I'll try pg_typeof...looks like a possibility.

On Sun, Jan 5, 2020, 5:37 PM Steve Baldwin <steve.baldwin@gmail.com> wrote:

Show quoted text

I'm not sure what you mean by pseudo-type, but does the pg_typeof()
function help?

Steve

On Mon, Jan 6, 2020 at 9:34 AM Gerald Britton <gerald.britton@gmail.com>
wrote:

If I use a pseudo-type in the argument list of a function definition (SQL
or plpgsql), how can I determine the actual type used a runtime?

--
Gerald Britton, MCSE-DP, MVP
LinkedIn Profile: http://ca.linkedin.com/in/geraldbritton