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 777DDD1DAF9 for ; Tue, 13 Jan 2004 17:45:50 +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 92593-10 for ; Tue, 13 Jan 2004 13:45:20 -0400 (AST) Received: from mailhub-3.iastate.edu (mailhub-3.iastate.edu [129.186.140.13]) by svr1.postgresql.org (Postfix) with ESMTP id 1086BD1B469 for ; Tue, 13 Jan 2004 13:45:19 -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 i0DHjHPX014936 for ; Tue, 13 Jan 2004 11:45:17 -0600 Received: from indian.eng.iastate.edu(129.186.23.14) by mailout-1.iastate.edu via csmap id 85a8a01c_45f0_11d8_9ea3_003048290bef_23803; Tue, 13 Jan 2004 11:47:14 -0600 (CST) Received: from 129.186.197.127 (SquirrelMail authenticated user bdu) by mail.eng.iastate.edu with HTTP; Tue, 13 Jan 2004 11:45:18 -0600 (CST) Message-ID: <2561.129.186.197.127.1074015918.squirrel@mail.eng.iastate.edu> In-Reply-To: <2498.129.186.197.127.1074014921.squirrel@mail.eng.iastate.edu> References: <2498.129.186.197.127.1074014921.squirrel@mail.eng.iastate.edu> Date: Tue, 13 Jan 2004 11:45:18 -0600 (CST) Subject: Re: can insert 'null' into timestamp type field from command 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/114 X-Sequence-Number: 16507 I've figured it out, that is using 'null as ' with the COPY command. Bing > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >