Re: Implementing automatic updating of primary keys... - Mailing list pgsql-sql

From Bhuvan A
Subject Re: Implementing automatic updating of primary keys...
Date
Msg-id Pine.LNX.4.44.0301201515100.11065-100000@Bhuvan.bksys.co.in
Whole thread Raw
In response to Implementing automatic updating of primary keys...  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
List 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 by date:

Previous
From: Bhuvan A
Date:
Subject: Re: pg_dump problem
Next
From: "Moritz Lennert"
Date:
Subject: performance question