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.