Re: question on renaming a foreign key

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: question on renaming a foreign key
Дата
Msg-id 20061011211038.82944.qmail@web31810.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на question on renaming a foreign key  (Jonathan Vanasco <postgres@2xlp.com>)
Ответы Re: question on renaming a foreign key  (Ron Johnson <ron.l.johnson@cox.net>)
Список 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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Is it possible to return custom type as proper ROW?
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: strange error when inserting via a SRF into a table with a foreign key constraint