From: | terry(at)greatgulfhomes(dot)com |
---|---|
To: | "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'Marco'" <pintman(at)gmx(dot)de> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: create definiton |
Date: | 2002-06-17 16:43:49 |
Message-ID: | 005701c2161e$58bce6c0$2766f30a@development.greatgulfhomes.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)greatgulfhomes(dot)com
> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Tom Lane
> Sent: Monday, June 17, 2002 10:19 AM
> To: Marco
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] create definiton
>
>
> pintman(at)gmx(dot)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(at)postgresql(dot)org
>
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Lu | 2002-06-17 16:54:05 | What cause MoveOfflinelogs? |
Previous Message | David A Dickson | 2002-06-17 16:04:55 | Re: Postgres DB recompilation |