By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Deleting a record

P: 24
I have a table 'a' and 'b'.
If I try to delete the record from 'a', not able to do it. Because, 'b' table is referencing the 'a' table.

create table a(id serial primary key,name varchar(10));

create table b(id serial,pid integer references a,comment varchar(100));

What is the way to delete a particular record from 'a' table?
Apr 17 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 700
First delete related records from b, or drop foreign key in b table.
Apr 17 '10 #2

P: 24
No records in B table, but I cannot delete records from A table, But Deleting foreign key in B table is working fine. Thanks for ur reply....
May 10 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.