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 1gtKPM-00008Y-GR for pgsql-general@arkaria.postgresql.org; Mon, 11 Feb 2019 22:50:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gtKPL-0003Ud-8Y for pgsql-general@arkaria.postgresql.org; Mon, 11 Feb 2019 22:50:35 +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 1gtKPK-0003RZ-Ub for pgsql-general@lists.postgresql.org; Mon, 11 Feb 2019 22:50:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtKPI-0000jT-EJ for pgsql-general@postgresql.org; Mon, 11 Feb 2019 22:50:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x1BMoO7b031298; Mon, 11 Feb 2019 17:50:24 -0500 From: Tom Lane To: Rich Shepard cc: pgsql-general@postgresql.org Subject: Re: Blank, nullable date column rejected by psql In-reply-to: References: Comments: In-reply-to Rich Shepard message dated "Mon, 11 Feb 2019 14:44:14 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31296.1549925424.1@sss.pgh.pa.us> Date: Mon, 11 Feb 2019 17:50:24 -0500 Message-ID: <31297.1549925424@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Rich Shepard writes: > 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? An empty string is not a null. (Oracle has done untold damage to the field by failing to make this distinction ... but in theory, and in the SQL standard, and in Postgres, they're not at all the same thing.) regards, tom lane