Re: Implementing automatic updating of primary keys...

Поиск
Список
Период
Сортировка
От Bhuvan A
Тема Re: Implementing automatic updating of primary keys...
Дата
Msg-id Pine.LNX.4.44.0301201515100.11065-100000@Bhuvan.bksys.co.in
обсуждение исходный текст
Ответ на Implementing automatic updating of primary keys...  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
Список pgsql-sql
> 
> there can be many  such tables that have foreign key id which is referencing
> the master table test_master column "id". what we want is when some ids become                   ^^^^^^^^^^^
It should be profile_master, right?

> redundant we have to merge two ids , we want that thru out the system the 
> occurance of the old primary key shud be removed and replaced with the new id.
> 

Definitely it can be done in the database level. Trigger a function before
delete on the primary table (profile_master) and update the foreign tables
with appropriate id and so the redundant id can be deleted from the
primary table. 

regards,
bhuvaneswaran




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

Предыдущее
От: Bhuvan A
Дата:
Сообщение: Re: pg_dump problem
Следующее
От: "Moritz Lennert"
Дата:
Сообщение: performance question