Re: about creating DB

Поиск
Список
Период
Сортировка
От will trillich
Тема Re: about creating DB
Дата
Msg-id 20010326023557.A18494@mail.serensoft.com
обсуждение исходный текст
Ответ на about creating DB  ("hiroko" <h_ogawa@rnk.co.jp>)
Список 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 по дате отправления:

Предыдущее
От: Alexander Lohse
Дата:
Сообщение: Hi
Следующее
От: will trillich
Дата:
Сообщение: Re: Free Text Search