Cast NULL into Timestamp?

From: Wei Weng <wweng(at)kencast(dot)com>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Cast NULL into Timestamp?
Date: 2004-12-10 19:24:56
Message-ID: 41B9F808.2040909@kencast.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Muhyiddin A.M Hayat 2004-12-10 19:26:33 Create Calendar
Previous Message Tomas =?iso-8859-1?q?Sk=E4re?= 2004-12-10 11:40:50 Query is not using index when it should