Re: about creating DB - Mailing list pgsql-general

From will trillich
Subject Re: about creating DB
Date
Msg-id 20010326023557.A18494@mail.serensoft.com
Whole thread Raw
In response to about creating DB  ("hiroko" <h_ogawa@rnk.co.jp>)
List pgsql-general
On Fri, Mar 23, 2001 at 07:41:51PM +0900, hiroko wrote:
> hi all
>
> we're switching our system from Unix-version to Linux-version,
> and from SQLplus to PostgreSQL
>
> the questions are about CREATING DB
>
> I found that FOREIGN KEY clause, which we need for our DB,  is not
> implemented on PostgreSQL.
> that means you can't use DELETE CASCADE clause neither.

i'm using 7.0.3 (on debian potato)--

create table lookup (
    major serial,
    minor int4,
    other ...
);

create table kahunamydata (
    id serial,
    ...
    MAJOR int4,
    MINOR int4,
    yada ...,
FOREIGN KEY(major,minor) REFERENCES lookup(major,minor) ON DELETE CASCADE,
...
primary key(id)
);

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
        -- Isaac Asimov, 'The Genetic Code'

will@serensoft.com
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

pgsql-general by date:

Previous
From: Alexander Lohse
Date:
Subject: Hi
Next
From: will trillich
Date:
Subject: Re: Free Text Search