Re: insert into: NULL in date column

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: insert into: NULL in date column
Date: 2019-01-11 23:05:51
Message-ID: 410b055a-24a7-5e15-f4e6-462e64794530@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 1/11/19 3:56 PM, Rich Shepard wrote:
> 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
>

Miss-matched single quotes in activities.sql?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2019-01-11 23:21:05 Re: insert into: NULL in date column
Previous Message Rich Shepard 2019-01-11 22:56:23 insert into: NULL in date column