Re: Expression of check constraint

Поиск
Список
Период
Сортировка
От Dirk Mika
Тема Re: Expression of check constraint
Дата
Msg-id 36BCEBBD-0EDD-4D37-897D-E2D3B3733050@mikatiming.de
обсуждение исходный текст
Ответ на Re: Expression of check constraint  (rob stone <floriparob@gmail.com>)
Список pgsql-general
Hi


--
Dirk Mika
Software Developer

mika:timing GmbH
Strundepark - Kürtener Str. 11b
51465 Bergisch Gladbach
Germany

fon +49 2202 2401-1197
dirk.mika@mikatiming.de
www.mikatiming.de

AG Köln HRB 47509 * WEEE-Reg.-Nr. DE 90029884
Geschäftsführer: Harald Mika, Jörg Mika



## How2Use
## the ChampionChip by mika:timing
## https://youtu.be/qfOFXrpSKLQ
Am 04.07.19, 10:50 schrieb "rob stone" <floriparob@gmail.com>:

    Why don't you define "ratified" as CHAR(1)?

This will change the constraint to

Check constraints:
    "ck_tp_ratified" CHECK (ratified IS NULL OR (ratified = ANY (ARRAY['Y'::bpchar, 'N'::bpchar])))

Less casting. (
Does the casting from one "String" type to another "String" type have any performance impact, btw?

    AFAIK, constraint evaluation is based upon the column's underlying data
    type.

But isn't char and varchar all stored in the same data structure?

Dirk






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

Предыдущее
От: rob stone
Дата:
Сообщение: Re: Expression of check constraint
Следующее
От:
Дата:
Сообщение: Help with a selection