Re: pg_proc and pg_type

From: snpe <snpe(at)snpe(dot)co(dot)yu>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_proc and pg_type
Date: 2002-09-17 11:58:24
Message-ID: 200209171358.24845.snpe@snpe.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have join pg_type and pg_proc and get view arguments and return value
(btw for getProcedureColumns in JDBC)
This is not enough.I have join all rows from pg_type, which have any from
pg_proc.oidvector (I must know length from oidvector array)
That is fine operator which is true if oid in any oid from oidvector, else
false and that be simple pg_proc.oidvector=pg_proc.oid
I don't know how any function or operator add in core postgresql (procedure
for this), but I need this operator and function for size,scale and precision
for any type (special for varchar,char,numeric etc. - this is like
format_type function, but special function for size, scale and precision).
regards
Haris Peco
On Tuesday 17 September 2002 03:56 am, Bruce Momjian wrote:
> 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message H. Meyer 2002-09-17 12:01:22 Postgres 7.3b1 + JDBC3 (2002-09-05) truncates SQL commands?
Previous Message Jerome Chochon 2002-09-17 10:47:39 Re: [HACKERS] PostgreSQL 7.3: help on new CREATE TYPE