Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtLZe-0003of-Uq for pgsql-general@arkaria.postgresql.org; Tue, 12 Feb 2019 00:05:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gtLZd-0006Yt-Ph for pgsql-general@arkaria.postgresql.org; Tue, 12 Feb 2019 00:05:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtLZd-0006Yj-Hl for pgsql-general@lists.postgresql.org; Tue, 12 Feb 2019 00:05:17 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtLZb-0002Nd-1T for pgsql-general@lists.postgresql.org; Tue, 12 Feb 2019 00:05:17 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id E1F7F99356 for ; Mon, 11 Feb 2019 16:05:11 -0800 (PST) Date: Mon, 11 Feb 2019 16:05:11 -0800 (PST) From: Rich Shepard To: "pgsql-generallists.postgresql.org" Subject: Re: Blank, nullable date column rejected by psql In-Reply-To: Message-ID: References: <9a60f04a-797b-420b-39db-ac139ce8fa23@gmail.com> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 11 Feb 2019, Ken Tanzer wrote: > Just in case you miss this little nuance, you don't necessarily _have_ to > specify a NULL for that column, depending how you're doing your inserts. > You haven't show us your table or what INSERT you're using, but all of > these examples will work, and don't specify an explicit NULL: Ken, Well, you've succeeded in confusing me. :-) This is the table's schema: # \d activities Table "public.activities" Column | Type | Collation | Nullable | Default --------------+-----------------------+-----------+----------+------------- ------------ person_id | integer | | not null | act_date | date | | not null | CURRENT_DATE act_type | character varying(12) | | not null | '??'::charac ter varying notes | text | | not null | '??'::text next_contact | date | | | Indexes: "activities_pkey" PRIMARY KEY, btree (person_id, act_date, act_type) Foreign-key constraints: "activities_act_type_fkey" FOREIGN KEY (act_type) REFERENCES activityty pes(act_name) ON UPDATE CASCADE ON DELETE RESTRICT "activities_person_id_fkey" FOREIGN KEY (person_id) REFERENCES people(p erson_id) ON UPDATE CASCADE ON DELETE RESTRICT And this is the framwork for adding rows: insert into Activities (person_id,act_date,act_type,notes,next_contact) values ( I add values for each column, but if there's no scheduled next_contact date I left that off. To me, this looks like your second example (with two columns of values and no date) and I don't see the differences. Regards, Rich