Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f16E0Wx82475 for ; Tue, 6 Feb 2001 09:00:32 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f16DXM818215 for pgsql-sql@postgresql.org; Tue, 6 Feb 2001 08:33:22 -0500 (EST) (envelope-from news) From: "Alain Lavigne" X-Newsgroups: comp.databases.postgresql.sql Subject: SQL question Date: Tue, 6 Feb 2001 08:37:41 -0500 Organization: ZAQ.iTv Lines: 43 Message-ID: <95ouf1$hp3$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: pgsql-sql@postgresql.org X-Archive-Number: 200102/81 X-Sequence-Number: 1259 I'm trying to extract references (relationships) between tables for the purpose of reverse/forward engineer from a modeling tool called PowerDesigner. Here is the sql: select u.usename, p.relname, v.usename, c.relname, t.tgconstrname, dumpref(t.tgargs, 4), ** (I know this function does not exist in postgresql) dumpref(t.tgargs, 5) from pg_trigger t, pg_proc f, pg_class p, pg_class c, pg_user u, pg_user v where 1=1 and f.proname='RI_FKey_check_ins' and t.tgfoid=f.oid and c.oid=t.tgrelid and p.oid=t.tgconstrrelid and u.usesysid=p.relowner and v.usesysid=c.relowner; I always get the following message: ** << Error while executing the query; ERROR: Function 'dumpref(bytea, int4)' does not exist Unable to identify a function that satisfies the given argument types You may need to add explicit typecasts >> Since integrity constraints are done using triggers, i makes sense that I can reverse engineer those FK constraint from the pg_trigger table. Unfortunately I don't know how to extract the information from the "tgargs" field. CAN ANYONE HELP ??