pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <JanWieck@Yahoo.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Rudi Starcevic <rudi@oasis.net.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Break referential integrity.
Date: Wed, 09 Jul 2003 15:06:34 -0400
Message-ID: <3F0C67BA.2050209@Yahoo.com> (raw)
References: <20030701211322.L66304-100000@megazone23.bigpanda.com>

Stephan Szabo wrote:
> On Wed, 2 Jul 2003, Rudi Starcevic wrote:
> 
>> Hi,
>>
>> I know that if you have a trigger and function then drop/replace the
>> function the trigger needs
>> to be drop/replaced too so that it can see the new function.
>>
>> Is it the same for Ref. Integ. on table's too ?
>>
>> If table B's foreign key references table A and you drop/replace table A
>> then the reference from table B to table A is broken and needs to be
>> recreated ?
> 
> In recent versions, you should not be drop table A without specifying
> cascade which will drop the constraint for you (and thus you'll need to
> recreate it).  In older versions, I'm not 100% sure what'd happen, but you
> probably should drop and recreate it for good measure.

Older versions spit out a NOTICE and dropped the constraint, so they 
kinda defaulted to CASCADE.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #




view thread (3+ messages)

Message-ID: <3F0C67BA.2050209@Yahoo.com>
Permalink:  ../3F0C67BA.2050209@Yahoo.com/
Also on:    postgresql.org/message-id/3F0C67BA.2050209@Yahoo.com

 · 

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: JanWieck@Yahoo.com, sszabo@megazone23.bigpanda.com, rudi@oasis.net.au
  Subject: Re: Break referential integrity.
  In-Reply-To: <3F0C67BA.2050209@Yahoo.com>

* 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