pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Timothy Covell <dirac@applink.net>
To: pgsql-sql@postgresql.org
To: josh@agliodbs.com
Subject: Re: [GENERAL] Foreign Keys Help Delete!
Date: Wed, 20 Sep 2000 21:30:34 -0500
Message-ID: <000371c21bccd077_mailit@smtp.applink.net> (raw)
References: <000371abbd90c460_mailit@smtp.applink.net>
	<39C7FFFB.6A9A0A2B@agliodbs.com>
	<000371ad62280d0d_mailit@smtp.applink.net>
	<39C8D9E7.9896E205@agliodbs.com>

>Timothy, Tom:
>
>> >1. a. Create new record with new key value in hosts table with the
>> >desired value
>> >   b. Update the routes record to reference the new value
>> >   c. Delete the old record in the hosts table
>> >
>> 
>> Yes, that's what I tried.
>> 
>> 1. foo.old.com exists in "hosts" table and "routes" table
>> 2. create foo.new.com in "hosts" table
>> 3. delete foo.old.com in "routes" table
>> 4. add foo.new.com into "routes" table
>> 5. try to delete foo.old.com and it complains!
>
>Tom - not to interrupt your coding :-) this sounds like a bug.  Any
>thoughts?  

No, Tom's not needed.  I double checked things again today, and 
was able to delete the problem records today.... I'll blame it on 
gremlins. ;-)   I suppose that I got lost in the data and the
gremlins must have cleaned it up while I slept last night....;-)

    Sorry to get any feathers ruffled....

    Still, I would like an easy way to drop and recreate foreign
keys and from what I see, it will appear that there is not a 
"safe" way to do this yet.

>
>> >2. a. Drop the Foriegn Key constraint
>> >   b. Update both the routes and hosts tables
>> >   c. Re-establish the foriegn key constraint
>> 
>> This is the part that I'm fuzzy on.  I've tried this before
>> with complete DB corruption resulting. I had to dump each table
>> one by one, edit my schema with vi, create new DB, import tables
>> one by one....very painful!
>
>This also sounds like a problem.  One should be able to drop a
>constraint, the re-create the restraint and check existing records
>against it.  You can do this in MSSQL and Oracle.
>
>> PPS. As I replied to Stephan, I'm contracting at a company and I
>> don't have access to e-mail.  Taking a schema home is NOT OK.
>> I already asked the manager if I could GPL my DNS-DB implementation.
>> As you might expect, the non-technical manager, didn't know what
>> GPL was, and he was NOT going to allow my work to be released to
>> public....    And of course, higher ups in company may decide that
>> my solution breaks the "don't build if you can buy" policy,  in which
>> case all of my work is for naught!  ARGH!!!!!!
>
>Well, if they don't use it, you can easily re-create your work at home
>and GPL it.  It also depends on the contract you signed ...

Yes, well, gremlin infested work is not good to distribute onto the
net...;-)  Time will tell....

>
>					-Josh
>-- 
>______AGLIO DATABASE SOLUTIONS___________________________
>                                        Josh Berkus
>   Complete information technology      josh@agliodbs.com
>    and data management solutions       (415) 436-9166
>   for law firms, small businesses       fax  436-0137
>    and non-profit organizations.       pager 338-4078
>                        		San Francisco




view thread (7+ messages)

Message-ID: <000371c21bccd077_mailit@smtp.applink.net>
Permalink:  ../000371c21bccd077_mailit@smtp.applink.net/
Also on:    postgresql.org/message-id/000371c21bccd077_mailit@smtp.applink.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: dirac@applink.net, josh@agliodbs.com
  Subject: Re: [GENERAL] Foreign Keys Help Delete!
  In-Reply-To: <000371c21bccd077_mailit@smtp.applink.net>
  References: <000371abbd90c460_mailit@smtp.applink.net> <39C7FFFB.6A9A0A2B@agliodbs.com> <000371ad62280d0d_mailit@smtp.applink.net> <39C8D9E7.9896E205@agliodbs.com> <000371c21bccd077_mailit@smtp.applink.net>

* 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