pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: How to quote date value?
Date: Fri, 21 Nov 2003 11:04:18 -0800 (PST)
Message-ID: <20031121110022.U75942@megazone.bigpanda.com> (raw)
In-Reply-To: <3FBE52FC.3060503@bigfoot.com>
References: <bpkmg7$2aj3$1@news.hub.org>
	<bpkqrd$2p0n$1@news.hub.org>
	<3FBE52FC.3060503@bigfoot.com>


On Fri, 21 Nov 2003, Gaetano Mendola wrote:

> nobody wrote:
> > I have found it in documentation, it is single quote. But it does not
> > explain why
> >
> > SELECT '1/11/2003' AS "InvoiceDate";
> >
> > returns "unknown" data type instead of "date".

(I haven't seen the original message yet, so I'm replying to a reply)
Date literals are generally written as:
DATE '1/11/2003'

PostgreSQL will try to guess what type you meant with quoted strings in
expressions, but in the above there isn't enough context to do guess that
you meant a date really (it should probably actually be thought of as a
string in such cases).




view thread (6+ messages)  latest in thread

Message-ID: <20031121110022.U75942@megazone.bigpanda.com>
Permalink:  ../20031121110022.U75942@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20031121110022.U75942@megazone.bigpanda.com

 · 

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: sszabo@megazone.bigpanda.com
  Subject: Re: How to quote date value?
  In-Reply-To: <20031121110022.U75942@megazone.bigpanda.com>

* 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