Re: [GENERAL] question on renaming a foreign key

2006-10-13 Thread Brent Wood
Jonathan Vanasco wrote: I made a HUGE mistake, and used 'UK' as the abbreviation for the united kingdom ( the ISO abbv is 'GB' ) I've got a database where 8 tables have an FKEY on a table 'location_country' , using the text 'uk' as the value -- so i've got 9 tables that I need to swap d

Re: [GENERAL] question on renaming a foreign key

2006-10-11 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/11/06 19:15, Richard Broersma Jr wrote: I doesn't appear that ALTER TABLE can change constraint characteristics. You'd have to drop/recreate, no? >>> Now that you mention it, I've never tried it or seen it done. >>> Here I what I came

Re: [GENERAL] question on renaming a foreign key

2006-10-11 Thread Richard Broersma Jr
> >> I doesn't appear that ALTER TABLE can change constraint > >> characteristics. You'd have to drop/recreate, no? > > > > Now that you mention it, I've never tried it or seen it done. > > Here I what I came up with: > > > [snip] > > > > > > It is nice to see things work so well. :-) > > It w

Re: [GENERAL] question on renaming a foreign key

2006-10-11 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/11/06 18:53, Richard Broersma Jr wrote: can anyone suggest a non-nightmarish way for me to do this ? >>> If your tables are setup to "ON UPDATE CASCASE" then you are >>> fine. Just updated the main table and PostgreSQL will take >>> car

Re: [GENERAL] question on renaming a foreign key

2006-10-11 Thread Richard Broersma Jr
> >> can anyone suggest a non-nightmarish way for me to do this ? > > If your tables are setup to "ON UPDATE CASCASE" then you are fine. > > Just updated the main table and PostgreSQL will take care of the rest. > I doesn't appear that ALTER TABLE can change constraint characteristics. > You'd hav

Re: [GENERAL] question on renaming a foreign key

2006-10-11 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/11/06 16:10, Richard Broersma Jr wrote: >> I made a HUGE mistake, and used 'UK' as the abbreviation for the >> united kingdom ( the ISO abbv is 'GB' ) >> >> I've got a database where 8 tables have an FKEY on a table >> 'location_country' , u

Re: [GENERAL] question on renaming a foreign key

2006-10-11 Thread Richard Broersma Jr
> I made a HUGE mistake, and used 'UK' as the abbreviation for the > united kingdom ( the ISO abbv is 'GB' ) > > I've got a database where 8 tables have an FKEY on a table > 'location_country' , using the text 'uk' as the value -- so i've got > 9 tables that I need to swap data out on > >