Re: constraint question

From: mwaples(at)optusnet(dot)com(dot)au
To: Pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: constraint question
Date: 2001-01-03 11:25:32
Message-ID: 3A530C2C.EEE32AF1@optusnet.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

ok im dumb - but this is the novice list -

references category(category_id)

worked after Id done everything correct
mwaples(at)optusnet(dot)com(dot)au wrote:
>
> I have a table category with columns -
> category_id , main_id
>
> I would like to check that the main_id value exists in category_id in
> any row of the table category.
>
> Is it possible to have a foreign key referring to the current table ?
> Or should I be using a trigger to do it ?
>
> I'm thinking I have to use a trigger to do it - but want to make sure.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Poul L. Christiansen 2001-01-03 12:00:50 Re: ColdFusion sez this is valid SQL
Previous Message mwaples 2001-01-03 10:37:27 constraint question