X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 67BAFD1B440 for ; Tue, 13 Jan 2004 17:29:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 93475-06 for ; Tue, 13 Jan 2004 13:28:49 -0400 (AST) Received: from mailhub-3.iastate.edu (mailhub-3.iastate.edu [129.186.140.13]) by svr1.postgresql.org (Postfix) with ESMTP id D941ED1B519 for ; Tue, 13 Jan 2004 13:28:47 -0400 (AST) Received: from mailout-1.iastate.edu (mailout-1.iastate.edu [129.186.140.1]) by mailhub-3.iastate.edu (8.12.10/8.12.10) with SMTP id i0DHSfPX012286 for ; Tue, 13 Jan 2004 11:28:41 -0600 Received: from indian.eng.iastate.edu(129.186.23.14) by mailout-1.iastate.edu via csmap id 339a036c_45ee_11d8_9b50_003048290bef_22357; Tue, 13 Jan 2004 11:30:37 -0600 (CST) Received: from 129.186.197.127 (SquirrelMail authenticated user bdu) by mail.eng.iastate.edu with HTTP; Tue, 13 Jan 2004 11:28:41 -0600 (CST) Message-ID: <2498.129.186.197.127.1074014921.squirrel@mail.eng.iastate.edu> Date: Tue, 13 Jan 2004 11:28:41 -0600 (CST) Subject: can insert 'null' into timestamp type field from command line but not from input file? From: "Bing Du" To: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.2-1 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/113 X-Sequence-Number: 16506 The table is like this: ======== maxware=# \d test; Table "public.test" Column | Type | Modifiers --------+-----------------------------+----------- a | timestamp without time zone | b | integer | ========= The following insert command works fine: maxware=# insert into test (a,b) values (null,'1'); But importing from an input data file does not seem to work as shown below: ========= maxware=# copy tbl_spcase from '/home/bdu/test/input.data' delimiter as '|'; ERROR: invalid input syntax for integer: "null" CONTEXT: COPY tbl_spcase, line 1, column col_id_spcase: "null" ========== The input.data file just has one line. But no matter what I did, neither of the following input format worked. 1. null|1 2. |1 3. ''|1 How should I represent blank value for the field that's of timestamp type? Thanks in advance for any help, Bing