From: Michael Fuhr <mike@fuhr.org>
To: KÖPFERL Robert <robert.koepferl@sonorys.at>
Cc: pgsql-sql@postgresql.org
Subject: Re: Generic Join on Arrays
Date: Mon, 30 May 2005 08:08:57 -0600
Message-ID: <20050530140857.GA78280@winnie.fuhr.org> (raw)
In-Reply-To: <ED4E30DD9C43D5118DFB00508BBBA76EB16721@neptun.sonorys.at>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB16721@neptun.sonorys.at>
On Mon, May 30, 2005 at 03:42:49PM +0200, KÖPFERL Robert wrote:
>
> As I found out, pg_proc relation provides me with data about defined stored
> procedures. Togehter with other relations as pg_type I can retrieve readable
> information, like:
> select proname, pd.description FROM pg_proc pp left outer join
> pg_description pd on pp.oid=pd.objoid
>
> BUT, how about arrays of type "oidvector" (int4-array) containing foreign
> keys (to be joined) as pg_proc's column "proargtypes"
Have you used ECHO_HIDDEN (or psql -E) to look at the queries that \df
generates? Would oidvectortypes() be useful?
SELECT proname, oidvectortypes(proargtypes)
FROM pg_proc
WHERE proname = 'substr';
proname | oidvectortypes
---------+-------------------------
substr | bytea, integer
substr | text, integer
substr | bytea, integer, integer
substr | text, integer, integer
(4 rows)
Another possibility might be to cast the function's oid to regprocedure:
SELECT oid::regprocedure
FROM pg_proc
WHERE proname = 'substr';
oid
-------------------------------
substr(bytea,integer)
substr(text,integer)
substr(bytea,integer,integer)
substr(text,integer,integer)
(4 rows)
Is either of those what you're looking for? They don't address the
problem in the general case, but they might serve in this particular
case.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mike@fuhr.org, robert.koepferl@sonorys.at
Subject: Re: Generic Join on Arrays
In-Reply-To: <20050530140857.GA78280@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox