Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Functions vs. Columns?????

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Byron Nikolaidis <byron(dot)nikolaidis(at)home(dot)com>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Functions vs. Columns?????
Date: 2000-02-16 05:12:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Byron Nikolaidis <byron(dot)nikolaidis(at)home(dot)com> writes:
> Works                        Doesn't Work
> ------                       ------------
> select now();                select now;
> select current_date;         select current_date();

> It seems that there should be some consistency here in the use of
> parenthesis.

Consistency?  Who needs consistency ;-) ?

What you're seeing here is the conflict of two cultures.  The SQL92
standard mandates a keyword CURRENT_DATE, with *no* parentheses,
as the way to get the current date.  now() comes out of the Berkeley
Postquel code, which inherits from an academic tradition that doesn't
like inventing reserved words without need, and also thinks that
things that look like constants ought to *be* constants.  The way
to resolve that tension, in academese, is to invent parameterless
functions.  But the folks who wrote the SQL92 spec seem to have been
raised on COBOL, which never met a reserved word it didn't like.

Anyway, Postgres supports both the SQL92 notation and the notation
we inherited from Postquel.  I don't think that adding with-or-
without-parentheses-take-your-pick-for-both syntax freedom would be
a step forward... that path leads to way too many traps for the
unwary programmer.

			regards, tom lane

In response to

pgsql-interfaces by date

Next:From: Thomas LockhartDate: 2000-02-16 06:04:36
Subject: Re: [INTERFACES] Functions vs. Columns?????
Previous:From: Joseph ShraibmanDate: 2000-02-16 03:26:11
Subject: Re: [INTERFACES] DELETEs with jdbc

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group