Re: Generic Join on Arrays

From: KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)at>
To:
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Generic Join on Arrays
Date: 2005-05-30 14:14:11
Message-ID: ED4E30DD9C43D5118DFB00508BBBA76EB16723@neptun.sonorys.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks.
Since I was just interested in this special case (while the general wasn't
interesting, either) this helped me. Also psql -E is a nice new feature to
me.

|-----Original Message-----
|From: Michael Fuhr [mailto:mike(at)fuhr(dot)org]
|Sent: Montag, 30. Mai 2005 16:09
|To: KÖPFERL Robert
|Cc: pgsql-sql(at)postgresql(dot)org
|Subject: Re: [SQL] Generic Join on Arrays
|
|
|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/
|

Browse pgsql-sql by date

  From Date Subject
Next Message Markus Bertheau ☭ 2005-05-30 15:15:55 Impossible with pl/pgsql?
Previous Message Michael Fuhr 2005-05-30 14:08:57 Re: Generic Join on Arrays