From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Mitchell <simon@jseb.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: PreparedStatement error for date parameter with overlaps
Date: Tue, 31 May 2011 10:10:22 -0400
Message-ID: <26246.1306851022@sss.pgh.pa.us> (raw)
In-Reply-To: <BANLkTinJBQFH5exg7r-8VxHc+u4L_m+H9w@mail.gmail.com>
References: <BANLkTikCY4ax50aOqNy2BdoYEoLSdc1Sew@mail.gmail.com>
<14646.1306806733@sss.pgh.pa.us>
<BANLkTim756hJon=1wyLeCuyH4bth3fcNiQ@mail.gmail.com>
<4DE47C54.3070706@postnewspapers.com.au>
<BANLkTinJBQFH5exg7r-8VxHc+u4L_m+H9w@mail.gmail.com>
Simon Mitchell <simon@jseb.com> writes:
> So from what I understand using the date function in jdbc stuff requires
> brackets like most functions do,
> but the psql is happy for me to use the date function with or without
> brackets.
Craig Ringer already posted a much more long-winded response, but the
short answer is that this syntax is *not* a function. The SQL spec
defines
type_name 'literal string'
as a way of writing a literal constant of a specific type. (The spec
actually only seems to allow this for certain type names, but Postgres
extends that to allow any known type name to be used.) This is not a
function and it doesn't work for any case except where the second part
is a quoted literal string. Personally I think it's a wart best
avoided, but we're stuck with supporting it because of the standard.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, simon@jseb.com
Subject: Re: PreparedStatement error for date parameter with overlaps
In-Reply-To: <26246.1306851022@sss.pgh.pa.us>
References: <BANLkTikCY4ax50aOqNy2BdoYEoLSdc1Sew@mail.gmail.com> <14646.1306806733@sss.pgh.pa.us> <BANLkTim756hJon=1wyLeCuyH4bth3fcNiQ@mail.gmail.com> <4DE47C54.3070706@postnewspapers.com.au> <BANLkTinJBQFH5exg7r-8VxHc+u4L_m+H9w@mail.gmail.com> <26246.1306851022@sss.pgh.pa.us>
* 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