Re: pg_proc and pg_type - Mailing list pgsql-general

From Bruce Momjian
Subject Re: pg_proc and pg_type
Date
Msg-id 200209170156.g8H1ubK10647@candle.pha.pa.us
Whole thread Raw
In response to pg_proc and pg_type  (snpe <snpe@snpe.co.yu>)
Responses Re: pg_proc and pg_type
List pgsql-general
snpe wrote:
> Hello,
>   I have column proargtypes (oidvector) in pg_proc and oid in pg_type
> Can I join tables pg_proc and pg_type and get row for every argument of
> functions

oidvector is a fixed-width array.  However, you can access individual
elements, at least in the 7.3 beta I use:

    select proargtypes[0] from pg_proc;
     proargtypes
    -------------
              23
              23

In <7.3 the length is fixed at 16, while in >=7.3 the length is 32.

You can then join that to pg_type:

    test=> select typname from pg_proc, pg_type
    test-> where proargtypes[0] = pg_type.oid;
       typname
    -------------
     int4
     int4
     int4
     int4

Hope that helps.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: "Ligia Pimentel"
Date:
Subject: Re: Table with 90 columns
Next
From: Martijn van Oosterhout
Date:
Subject: Re: find overlapping address ranges