[SQL] Delete cascade for multi tables?

2002-11-07 Thread Zhidian Du

Hello,

I have several tables and one table is a reference table, all other tables 
are master tablls of this reference table.  One record in these master 
tables have several records in the reference table.

I want to delete cascade when delete one record one reocrd in mater tables 
and delete the releated records in the referecne table.  How can I create 
reference table?

Thanks.

Zhidian Du



_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly


[SQL] No promany key in parent table, how to use delete cascade?

2002-11-07 Thread Zhidian Du
Dear All,

I want to dreate a delete cascade in children tables.  The primary key of 
parent table is oid, so when I create parent table, there is no apparetly 
key word "primary key".  The problem jumps out.

When I create child table using columnn constraint on delete, the SQL says:

"PRIMARY KEY for referenced table "parent" not found"

I do not need to specify the primary key since I am using oid.  How can I 
get around this problem?

Thanks.

Zhidian Du



_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[SQL] table protein does not have an attribute oid? why?

2002-11-09 Thread Zhidian Du



Dear All:



I want to create a delete cascade in children tables.  The primary key of 
parent table is oid.




CREATE TABLE Link (
   Protein_ID oid,
   Link varchar(128)
   CONSTRAINT one
   REFERENCES Protein (oid)
   ON DELETE CASCADE
);

Create child table is ok.

When I insert a record into this child table, it says
"ERROR: constraint one: table protein does not have an attribute oid"

Why?


Thanks.



_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[SQL] Parent table has not oid?

2002-11-09 Thread Zhidian Du




Dear All:

Please disregerd my last email.

I want to create a delete cascade in children tables.  The primary key of 
parent table is oid.


CREATE TABLE Link (
  Protein_ID oid
  CONSTRAINT one
  REFERENCES Protein (oid)
  ON DELETE CASCADE,
  Link varchar(128)
);

Create child table is ok.

When I insert a record into this child table, it says
"ERROR: constraint one: table protein does not have an attribute oid"

Why?


Thanks.


_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html