Re: BUG #15500: Cannot set NULL to a field with ENUM type

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: ivan(dot)shib(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15500: Cannot set NULL to a field with ENUM type
Date: 2018-11-13 14:56:37
Message-ID: 20181113145637.nyxrtmb5pwcct5pa@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2018-Nov-13, PG Bug reporting form wrote:

> 3. Insert a new record:
> > INSERT INTO "public"."schedule" ("id", "week_day", "minute", "hour")
> VALUES (DEFAULT, 'NULL', DEFAULT, DEFAULT);

This is not a NULL value -- it's a string that says NULL. Try with

INSERT INTO public.schedule (id, week_day, minute, hour)
VALUES (DEFAULT, NULL, DEFAULT, DEFAULT);

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Vondra 2018-11-13 17:11:42 Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation
Previous Message PG Bug reporting form 2018-11-13 14:48:43 BUG #15500: Cannot set NULL to a field with ENUM type