Re: [GENERAL] Constraint + where

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: [GENERAL] Constraint + where
Дата
Msg-id CANu8Fiw2YzM1aAkMjV2iyZ3HurXVsvjJ5nVm1APHME2ZUYesCQ@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Constraint + where  (Patrick B <patrickbakerbr@gmail.com>)
Ответы Re: [GENERAL] Constraint + where
Re: [GENERAL] Constraint + where
Список pgsql-general


On Sun, Mar 19, 2017 at 8:16 PM, Patrick B <patrickbakerbr@gmail.com> wrote:
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!


Why just "maybe"? Since there can only be three valid answers, why not FK for all three?

--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

В списке pgsql-general по дате отправления:

Предыдущее
От: Patrick B
Дата:
Сообщение: [GENERAL] Constraint + where
Следующее
От: Patrick B
Дата:
Сообщение: Re: [GENERAL] Constraint + where