Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA06589 for ; Wed, 8 Mar 2000 11:04:55 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id LAA25359; Wed, 8 Mar 2000 11:04:38 -0500 (EST) To: Colin Rothnie cc: pgsql-sql@postgreSQL.org Subject: Re: FW: [SQL] Errors loading null dates in 7.0beta1 In-reply-to: References: Comments: In-reply-to Colin Rothnie message dated "Wed, 08 Mar 2000 17:12:43 +0800" Date: Wed, 08 Mar 2000 11:04:37 -0500 Message-ID: <25356.952531477@sss.pgh.pa.us> From: Tom Lane Colin Rothnie writes: > I am copying data from a tab delimited text file using the psql command > test=> \copy collar from collar.txt; > where the table "collar" contains a date field (not set to "NOT NULL") and > the text file contains date fields for some records and nothing between two > tabs for records without date data. The approved way to represent nulls in copy data is "\N", not just an empty string. This is the same for all data types. > The same table structure and load file > were used successfully with 6.5.3 Really? I tried it and got play=> \copy collar from collar.txt ERROR: Bad date external representation '' PQendcopy: resetting connection Copy failed. which is what I'd expect. > Looking at it again now, I am also uncertain whether "date" is an allowable > field name (PostrgreSQL didn't object). We allow it, but the SQL92 spec lists DATE as a , so it's possible that some other DBMSes would complain. regards, tom lane