Re: create definiton - Mailing list pgsql-general

From terry@greatgulfhomes.com
Subject Re: create definiton
Date
Msg-id 005701c2161e$58bce6c0$2766f30a@development.greatgulfhomes.com
Whole thread Raw
In response to Re: create definiton  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: create definiton  (Tom Jenkins <tjenkins@devis.com>)
List pgsql-general
Yeah, but the gotcha there is that any foreign keys are not saved as a
FOREIGN KEY statement, just as the INSERT/UPDATE trigger that enforces the
foreign key.  So if you dump the schema, drop the table (which deletes the
foreign keys in the foreign keyed tables), alter the dump and reload: the
triggers to enforce the foreign key validation that reside in the tables the
foreign key is keyed into do not get recreated, so your referential
integrity is only enforced WRT changes to your  table reloaded from the
dump, and NOT enforced from the tables the keys go into.

Please correct me if I am wrong, because if there is a better way I would
like to know, I deal with specs changing all the time and have to drop
tables to change them from NULL to NOT NULL etc.

Terry Fielder
Network Engineer
Great Gulf Homes / Ashton Woods Homes
terry@greatgulfhomes.com

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Tom Lane
> Sent: Monday, June 17, 2002 10:19 AM
> To: Marco
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] create definiton
>
>
> pintman@gmx.de (Marco) writes:
> > is it possible to find out, which create-statement i have used to
> > create a certain table? if so, how?
>
>     pg_dump -s -t tablename dbname
>
> will reconstruct the table schema for you.
>
>             regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo@postgresql.org
>


pgsql-general by date:

Previous
From: "Jeff Lu"
Date:
Subject: What cause MoveOfflinelogs?
Next
From: "Marc G. Fournier"
Date:
Subject: Re: jobs.postgresql.org - Who's interested?