help with add constraint syntax needed

From: Mike Haberman <mikeh(at)ncsa(dot)uiuc(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: help with add constraint syntax needed
Date: 2001-06-20 20:32:26
Message-ID: 20010620153226.A46759@ncsa.uiuc.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hello all,

I am using an xml -> sql generator where foreign key are specified
after the columns are. The sql is written as the xml file is being
parsed so, the foreign key stuff must be written after the fact.

The problem I need to solve is adding the on Delete/on Update constraints.

here's what I would like to do (e.g.):

ALTER TABLE league
ADD CONSTRAINT leagueOwnerId FOREIGN KEY (leagueOwnerId)
REFERENCES TeamOwner (id) ON DELETE CASCASE;

table teamOwner (id)
table league (id, leagueOwnerId)
where leagueOwnerId is a FKey to owner(id)

thanks

mike

--
-------------------------------------------------
I am Vinz, Vinz Clortho. Keymaster of Gozer,
Volguus Zildrohar, Lord of the Sebouillia.
Are you the Gatekeeper?
-------------------------------------------------

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-06-20 20:37:02 Re: Embedding postgresql
Previous Message Sergio Bruder 2001-06-20 20:30:58 Re: PHP HOWTO v24.0 released: ADODB connects oracle, pgsql, mysql, sybase..