Re: Functions and Parentheses

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "Igal (at) Lucee(dot)org" <igal(at)lucee(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Functions and Parentheses
Date: 2017-10-06 21:33:07
Message-ID: CAKFQuwZvUJSRir_Ap_GLSgOJGWUimOnkrv2GbiAqi6=c0JCNzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 6, 2017 at 2:18 PM, Igal @ Lucee.org <igal(at)lucee(dot)org> wrote:

> Hi,
>
> Is current_date a function? It's a bit puzzling to me since there are no
> parentheses after it, i.e.
>
> SELECT current_date;
>
> And not
>
> SELECT current_date(); -- syntax error
>

It, and the others like it, behave as functions. They don't require
parentheses because the SQL standard​

​ defines them without parentheses.

> How come `current_date` has no parenthesis but `clock_timestamp()` does?
>
clock_timestamp isn't standard defined and unless the standard forces us to
do otherwise function invocation requires parentheses.

See 9.9.4 (
https://www.postgresql.org/docs/9.6/static/functions-datetime.html )

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-10-06 21:33:55 Re: Functions and Parentheses
Previous Message Igal @ Lucee.org 2017-10-06 21:18:36 Functions and Parentheses