Constraint + where

From: Patrick B <patrickbakerbr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Constraint + where
Date: 2017-03-20 00:16:08
Message-ID: CAJNY3iu8nWxcKG=Xfjeo9ap8n=TfcnESadmBHO8jY4QMiCDVKw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi guys,

I've got a column 'type_note' on a new table that it's being designed:

type_note varchar(32) NOT NULL;

On that column, there will be three different data:

1. yes
2. no
3. maybe

I wanna create a FK but just when the data on that column is = maybe.

How can I do that? Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2017-03-20 00:27:11 Re: Constraint + where
Previous Message Sylvain Marechal 2017-03-19 19:04:07 Re: Best way to alter a foreign constraint