Received: from mail.libertysurf.net (mail.libertysurf.net [213.36.80.91]) by postgresql.org (Postfix) with ESMTP id 6BFEB474E71 for ; Thu, 25 Apr 2002 08:27:04 -0400 (EDT) Received: from tiscali.fr (127.0.0.1) by mail.libertysurf.net (5.1.053) id 3CC435860000ACD5; Thu, 25 Apr 2002 14:27:00 +0200 Date: Thu, 25 Apr 2002 13:27:00 +0100 Message-Id: Subject: Re: How to discover foreign keys (without pulling hair out) MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable From: "bob lapique" To: imorgan@webcon.net Cc: pgsql-sql@postgresql.org X-XaM3-API-Version: 1.1.9.1.37 X-SenderIP: 132.166.73.60 X-Archive-Number: 200204/300 X-Sequence-Number: 7564 Hi, I use pgAdminII on Windows. It connects to a PostgreSQL on a Linux PC. When you click on an existing table's icon, it shows you a script that could have created it (it detects the structure of the table by itself), including the foreign keys. That's an easy way. But maybe not very elegant... -- Table: slip CREATE TABLE "slip" ( "id_slip" int4 DEFAULT nextval ('"slip_id_slip_seq"'::text) NOT NULL, "proprio" int4, CONSTRAINT "slip_pkey" PRIMARY KEY ("id_slip"), CONSTRAINT "slip_de" FOREIGN KEY ("proprio") REFERENCES "maitre" ("maitre_id") ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE ); COMMENT ON TABLE "slip" IS 'les slobards en folie !'; ------------------- Vous aussi devenez le "Coup de coeur de Julie" et gagnez une Webcam sur http://www.chez.com ! Chez.com vous invite =E0 d=E9couvrir l'univers passionnant des sites persos.