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 8402A3A6378 for ; Fri, 10 Dec 2004 23:29:54 +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 25416-06 for ; Fri, 10 Dec 2004 23:29:16 +0000 (GMT) Received: from www.postgresql.com (unknown [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id 6B48C3A67BB for ; Fri, 10 Dec 2004 22:29:07 +0000 (GMT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by www.postgresql.com (Postfix) with ESMTP id C04B47385DB for ; Fri, 10 Dec 2004 19:22:08 +0000 (GMT) Received: from pimout6-ext.prodigy.net (pimout6-ext.prodigy.net [207.115.63.78]) by svr4.postgresql.org (Postfix) with ESMTP id B22505AF023 for ; Fri, 10 Dec 2004 19:22:20 +0000 (GMT) Received: from [192.168.1.207] (214.adsl.snet.net [69.177.163.214] (may be forged)) by pimout6-ext.prodigy.net (8.12.10 milter /8.12.10) with ESMTP id iBAJLDlp204874 for ; Fri, 10 Dec 2004 14:21:14 -0500 Message-ID: <41B9F808.2040909@kencast.com> Date: Fri, 10 Dec 2004 14:24:56 -0500 From: Wei Weng User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "'pgsql-sql@postgresql.org'" Subject: Cast NULL into Timestamp? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/48 X-Sequence-Number: 19668 I have a table create table temp ( tempdate timestamp, tempname varchar(10) ); And I tried to insert the following: insert into table temp (tempname, tempdate) select distinct 'tempname', null from some_other_relevant_table; And I got an error that says "column "tempdate" is of type timestamp ... but expression is of type text... will need to rewrite or cast the expression". I really need the distinct. Is there anyway to cast this NULL into a timestamp or any other workarounds? Thanks Wei