insert into: NULL in date column - Mailing list pgsql-general

From Rich Shepard
Subject insert into: NULL in date column
Date
Msg-id alpine.LNX.2.20.1901111449480.8922@salmo.appl-ecosys.com
Whole thread Raw
Responses Re: insert into: NULL in date column  (Rob Sargent <robjsargent@gmail.com>)
Re: insert into: NULL in date column  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
A table has this column definition:

next_contact date DEFAULT '2020-11-06'
                CONSTRAINT valid_next_date
                CHECK (next_contact >= CURRENT_DATE),

(and I don't know that it needs a default).

In an input statement that column is left empty ('') when there's no defined
date. When I try to input that table I get a format error:

psql:activities.sql:2: ERROR:  invalid input syntax for type date: ""
LINE 2: ...reaction they''ve experienced environmental issues.','','');
                                                                 ^
and my web research has not shown me my error. Removing the check constraint
does not eliminate that error.

Please show me what I've done incorrectly.

TIA,

Rich


pgsql-general by date:

Previous
From: Michel Pelletier
Date:
Subject: Re: Benchmark of using JSON to transport query results in node.js
Next
From: Rob Sargent
Date:
Subject: Re: insert into: NULL in date column