Cast NULL into Timestamp? - Mailing list pgsql-sql

From Wei Weng
Subject Cast NULL into Timestamp?
Date
Msg-id 41B9F808.2040909@kencast.com
Whole thread Raw
Responses Re: Cast NULL into Timestamp?
Re: Cast NULL into Timestamp?
Re: Cast NULL into Timestamp?
List 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


pgsql-sql by date:

Previous
From: Christoph Haller
Date:
Subject: Unresolved external: tgetent
Next
From: "Muhyiddin A.M Hayat"
Date:
Subject: Create Calendar