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