[SQL] Deleting entries from multiple tables

2010-11-30 Thread manidegr8

i am trying to run a query but its not working may be due to constraint
conflicts

i have table A, B and C
B and C have a foreign key linked with A's primary key

so i want to delete an entry from A
for that i hav to delete child records first

can u design a query which wont conflict the constraints..?

Thanks...
Regards.
-- 
View this message in context: 
http://postgresql.1045698.n5.nabble.com/Deleting-entries-from-multiple-tables-tp3285654p3285654.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Deleting entries from multiple tables

2010-11-30 Thread manidegr8

yes i know about on delete cascade
it automatically delete the child when master is deleted

but the database i m working on is not built in this fashion
tables r built on default rules
so constraints r there

i m jus asking to build a procedure or function
that taking from the user and deletes the child and master records against
that input...
i hav tried it on pgadmin 111
but its not working...

please guide me
-- 
View this message in context: 
http://postgresql.1045698.n5.nabble.com/Deleting-entries-from-multiple-tables-tp3285654p3285832.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql