Re: Advice on merging two primary keys...

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Advice on merging two primary keys...
Дата
Msg-id 42C246F9.9070702@archonet.com
обсуждение исходный текст
Ответ на Advice on merging two primary keys...  ("Eric D. Nielsen" <nielsene@MIT.EDU>)
Ответы Re: Advice on merging two primary keys...  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
Eric D. Nielsen wrote:
> I've come into a situation where I will often need to merge two  primary
> keys, with numerous foreign keys hanging off of them.  For  instance:

> While any update of the either primary key will cascade to all  relevant
> tables, such an update is disallowed for uniqueness reasons.
>
> Is there a good SQL-base method to accomplish this type of merging or
> does this need application logic?

It's irritating, because (afaict) the main use for cascading updates to
a primary key is for merging. But, without deferred uniqueness checks
you'll encounter the problem you mention. PG doesn't allow deferred
uniqueness checks at the moment, so I'm afraid you'll have to explicitly
update all the dependant tables.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Mark Dilger
Дата:
Сообщение: Re: [HACKERS] Avoiding io penalty when updating large objects
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Connection local variables?