X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BB6F452818 for ; Mon, 30 May 2005 11:14:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 46347-03 for ; Mon, 30 May 2005 14:14:16 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id 36A0852816 for ; Mon, 30 May 2005 11:14:15 -0300 (ADT) Received: (qmail-ldap/ctrl 44234 invoked from network); 30 May 2005 14:14:17 -0000 Received: from unknown (HELO io.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 30 May 2005 14:14:17 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by io.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j4UEEIG09934 for ; Mon, 30 May 2005 16:14:18 +0200 (MEST) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id <2JD5WY32>; Mon, 30 May 2005 16:14:18 +0200 Message-ID: From: =?ISO-8859-1?Q?K=D6PFERL_Robert?= To: Cc: pgsql-sql@postgresql.org Subject: Re: Generic Join on Arrays Date: Mon, 30 May 2005 16:14:11 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200505/235 X-Sequence-Number: 21548 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@fuhr.org] |Sent: Montag, 30. Mai 2005 16:09 |To: K=D6PFERL Robert |Cc: pgsql-sql@postgresql.org |Subject: Re: [SQL] Generic Join on Arrays | | |On Mon, May 30, 2005 at 03:42:49PM +0200, K=D6PFERL Robert wrote: |>=20 |> As I found out, pg_proc relation provides me with data about=20 |defined stored |> procedures. Togehter with other relations as pg_type I can=20 |retrieve readable |> information, like: |> select proname, pd.description FROM pg_proc pp left outer join |> pg_description pd on pp.oid=3Dpd.objoid |>=20 |> BUT, how about arrays of type "oidvector" (int4-array)=20 |containing foreign |> keys (to be joined) as pg_proc's column "proargtypes"=20 | |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 =3D 'substr'; | proname | oidvectortypes =20 |---------+------------------------- | 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=20 |regprocedure: | |SELECT oid::regprocedure |FROM pg_proc |WHERE proname =3D 'substr'; | oid =20 |------------------------------- | 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. | |--=20 |Michael Fuhr |http://www.fuhr.org/~mfuhr/ |