Re: Cast NULL into Timestamp? - Mailing list pgsql-sql

From Frank Bax
Subject Re: Cast NULL into Timestamp?
Date
Msg-id 5.2.1.1.0.20041211115940.02eca9a0@pop6.sympatico.ca
Whole thread Raw
In response to Re: Cast NULL into Timestamp?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
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. 



pgsql-sql by date:

Previous
From: Ian Barwick
Date:
Subject: Re: replacing mysql enum
Next
From: Greg Stark
Date:
Subject: Re: replacing mysql enum