Re: Cast NULL into Timestamp?

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Cc: Wei Weng <wweng(at)kencast(dot)com>
Subject: Re: Cast NULL into Timestamp?
Date: 2004-12-11 17:10:02
Message-ID: 5.2.1.1.0.20041211115940.02eca9a0@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Stark 2004-12-11 17:25:50 Re: replacing mysql enum
Previous Message Ian Barwick 2004-12-11 17:06:08 Re: replacing mysql enum