Re: question on renaming a foreign key

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Jonathan Vanasco <postgres(at)2xlp(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: question on renaming a foreign key
Date: 2006-10-11 21:10:38
Message-ID: 20061011211038.82944.qmail@web31810.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> 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
>
> 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.

http://www.postgresql.org/docs/8.1/interactive/sql-createtable.html

Regards,

Richard Broersma Jr.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2006-10-11 21:18:13 strange error when inserting via a SRF into a table with a foreign key constraint
Previous Message Jeff Davis 2006-10-11 21:08:03 Re: Is it possible to return custom type as proper ROW?