Re: 9.2 timestamp function syntax error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, Guy Rouillier *EXTERN* <guy(dot)rouillier(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: 9.2 timestamp function syntax error
Date: 2013-03-05 14:52:34
Message-ID: 7277.1362495154@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> writes:
> This does not work:

> test=> select timestamp(now()::timestampz);
> ERROR: syntax error at or near "now"

timestamp(something) is a type name. Per the comment in gram.y:

* The type names appearing here are not usable as function names
* because they can be followed by '(' in typename productions, which
* looks too much like a function call for an LR(1) parser.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message James Cloos 2013-03-05 16:36:29 Re: [HACKERS] Floating point error
Previous Message Shaun Thomas 2013-03-05 14:51:11 Why does slony use a cursor? Anyone know?