X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 157F03A1D4C for ; Sat, 11 Dec 2004 17:11:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83685-06 for ; Sat, 11 Dec 2004 17:11:10 +0000 (GMT) Received: from tomts13-srv.bellnexxia.net (tomts13.bellnexxia.net [209.226.175.34]) by svr1.postgresql.org (Postfix) with ESMTP id 43C5E3A635C for ; Sat, 11 Dec 2004 17:11:09 +0000 (GMT) Received: from acer.sympatico.ca ([65.95.168.141]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041211171107.HQMM1899.tomts13-srv.bellnexxia.net@acer.sympatico.ca>; Sat, 11 Dec 2004 12:11:07 -0500 Message-Id: <5.2.1.1.0.20041211115940.02eca9a0@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Sat, 11 Dec 2004 12:10:02 -0500 To: pgsql-sql@postgresql.org From: Frank Bax Subject: Re: Cast NULL into Timestamp? Cc: Wei Weng In-Reply-To: <200412102111.28104.josh@agliodbs.com> References: <41B9F808.2040909@kencast.com> <41B9F808.2040909@kencast.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/64 X-Sequence-Number: 19684 At 12:11 AM 12/11/04, Josh Berkus wrote: >Wei, > > > insert into table temp (tempname, tempdate) > > select distinct 'tempname', null from some_other_relevant_table; > >I don't think you're reporting the error exactly as it happened. Try cutting >and pasting your actual PSQL session into your e-mail. > >Perhaps you are mixing up the column order? A copy/paste certainly would have been helpful in this case. There are several problems with the above query. 1) the keyword 'table' is not part of insert command. 2) If 'tempname' is a fieldname, it should not have single quotes. 3) NULL doesn't seem to work as expression in select. If (3) is the real problem here, then either solution proposed by Steve/Stephan will work.