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 1gtKJR-0008JG-KI for pgsql-general@arkaria.postgresql.org; Mon, 11 Feb 2019 22:44:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gtKJO-0005yY-1s for pgsql-general@arkaria.postgresql.org; Mon, 11 Feb 2019 22:44:26 +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 1gtKJN-0005yR-Pz for pgsql-general@lists.postgresql.org; Mon, 11 Feb 2019 22:44:25 +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 1gtKJG-0000W6-Qh for pgsql-general@postgresql.org; Mon, 11 Feb 2019 22:44:25 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 9E57999356 for ; Mon, 11 Feb 2019 14:44:14 -0800 (PST) Date: Mon, 11 Feb 2019 14:44:14 -0800 (PST) From: Rich Shepard Reply-To: Rich Shepard To: pgsql-general@postgresql.org Subject: Blank, nullable date column rejected by psql Message-ID: 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 Running postgresql-10.5 on Slackware-14.2. A table has a column defined as Column | Type | Collation | Nullable | Default next_contact | date | | | In a .sql file to insert rows in this table psql has a problem when there's no value for the next_contact column: $ psql -f activities.sql -d bustrac psql:activities.sql:6: ERROR: invalid input syntax for type date: "" LINE 2: ...ise. Asked him to call.',''), Explicitly replacing the blank field ('') with null is accepted. Why is this? Now I know to replace no dates with null I'll do so but I'm curious why this is needed. Thanks in advance, Rich