pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: bob lapique <lapique@chez.com>
To: imorgan@webcon.net
Cc: pgsql-sql@postgresql.org
Subject: Re: How to discover foreign keys (without pulling hair out)
Date: Thu, 25 Apr 2002 13:27:00 +0100
Message-ID: <GV4IL0$C9D156E91C6CCD1198F670F63041C3D5@tiscali.fr> (raw)

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 à découvrir l'univers passionnant des sites persos.





view thread (3+ messages)  latest in thread

Message-ID: <GV4IL0$C9D156E91C6CCD1198F670F63041C3D5@tiscali.fr>
Permalink:  ../GV4IL0$C9D156E91C6CCD1198F670F63041C3D5@tiscali.fr/
Also on:    postgresql.org/message-id/GV4IL0$C9D156E91C6CCD1198F670F63041C3D5@tiscali.fr

 · 

reply

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: lapique@chez.com, imorgan@webcon.net
  Subject: Re: How to discover foreign keys (without pulling hair out)
  In-Reply-To: <GV4IL0$C9D156E91C6CCD1198F670F63041C3D5@tiscali.fr>

* 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