From: Tom Lane <tgl@sss.pgh.pa.us>
To: Byron Nikolaidis <byron.nikolaidis@home.com>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] Functions vs. Columns?????
Date: Wed, 16 Feb 2000 00:12:45 -0500
Message-ID: <1304.950677965@sss.pgh.pa.us> (raw)
In-Reply-To: <38AA04D4.4FDA646C@home.com>
References: <38AA04D4.4FDA646C@home.com>
Byron Nikolaidis <byron.nikolaidis@home.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
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 using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, byron.nikolaidis@home.com
Subject: Re: [INTERFACES] Functions vs. Columns?????
In-Reply-To: <1304.950677965@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