Re: Expression of check constraint

2019-07-04 Thread Tom Lane
Dirk Mika writes: > 3.The column ratified is of type character varying(1). Why is it casted > to text? Type varchar in Postgres is a poor stepchild without any operators of its own. Text is the "native" string type and any comparison etc will require casting varchar to text first. It happ

Re: Expression of check constraint

2019-07-04 Thread Laurenz Albe
Dirk Mika wrote: > if I add the following check constraint to a table: > > ALTER TABLE public.times_places >ADD CONSTRAINT ck_tp_ratified CHECK > (ratified IS NULL OR (ratified IN ('Y', 'N'))); > > It becomes the following when describing the table in psql: > > Check constraints

Re: Expression of check constraint

2019-07-04 Thread Dirk Mika
Hi -- Dirk Mika Software Developer mika:timing GmbH Strundepark - Kürtener Str. 11b 51465 Bergisch Gladbach Germany fon +49 2202 2401-1197 dirk.m...@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 Champi

Re: Expression of check constraint

2019-07-04 Thread rob stone
Hello, On Thu, 2019-07-04 at 05:58 +, Dirk Mika wrote: > Hi, > > if I add the following check constraint to a table: > > ALTER TABLE public.times_places >ADD CONSTRAINT ck_tp_ratified CHECK > (ratified IS NULL OR (ratified IN ('Y', 'N'))); > > It becomes the following when