pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Bax <fbax@sympatico.ca>
To: pgsql-sql@postgresql.org
Cc: Wei Weng <wweng@kencast.com>
Subject: Re: Cast NULL into Timestamp?
Date: Sat, 11 Dec 2004 12:10:02 -0500
Message-ID: <5.2.1.1.0.20041211115940.02eca9a0@pop6.sympatico.ca> (raw)
In-Reply-To: <200412102111.28104.josh@agliodbs.com>
References: <41B9F808.2040909@kencast.com>
	<41B9F808.2040909@kencast.com>

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. 




view thread (5+ messages)

Message-ID: <5.2.1.1.0.20041211115940.02eca9a0@pop6.sympatico.ca>
Permalink:  ../5.2.1.1.0.20041211115940.02eca9a0@pop6.sympatico.ca/
Also on:    postgresql.org/message-id/5.2.1.1.0.20041211115940.02eca9a0@pop6.sympatico.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fbax@sympatico.ca, wweng@kencast.com
  Subject: Re: Cast NULL into Timestamp?
  In-Reply-To: <5.2.1.1.0.20041211115940.02eca9a0@pop6.sympatico.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox