Re: BUG #4465: GROUP BY is not to SQL standard - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #4465: GROUP BY is not to SQL standard
Date
Msg-id 48F539BF.6020403@gmx.net
Whole thread Raw
In response to Re: BUG #4465: GROUP BY is not to SQL standard  ("Tony Marston" <tony@marston-home.demon.co.uk>)
List pgsql-bugs
Tony Marston wrote:
> I think your definition of "Feature T301 Functional Dependencies" is
> extremely questionable. A functional dependency in relational theory
> automatically exists where a non-key column on a table is functionally
> dependent on the key of that table. It is not something that can be turned
> on or off with code, it is built into the design of the table, so it is
> erroneous to say that "Postgresql does not support functional dependencies".
> If you support both key and non-key columns on a table then you support
> functional dependencies whether you like it or not.

I think you misunderstand what "Features" in the SQL standard mean.
Surely a relational database system supports some kind of functional
dependency system, and there is a common definition for that in the
computer science literature (and there is yet another one in the SQL
standard, part 2, clause 4.18).  But in the SQL standard, features
contain conformance claims.  Your product can either conform to SQL:2003
with T301, in which case it should behave as in 7.12 GR 15, or it can
conform to SQL:2003 without T301, in which case it should behave as in
7.12 CR 3.  Both of these can claim to conform to SQL, if they declare
the details correctly.  The fact that T301 is labeled "Functional
dependencies" is an informative label for what the feature generally
tries to achieve, but it is not a normative description of the feature
itself, since that is given elsewhere in the standard.

Since PostgreSQL is documented not to support feature T301, we apply
7.12 CR 3, and no one has so far disputed that we do so incorrectly.

Now you might say, then PostgreSQL is not a real relational database
system.  But I believe it is widely understood that no SQL
implementation implements relational theory correctly.  That's a whole
different can of worms.

> As for your statement that PostgreSQL has never claimed that it is fully
> SQL-compliant, every time I have posted a message to a PG newsgroup and
> compared it with MySQL the immediate response which I receive has always
> been along the lines of "don't compare PG with MySQL as that is a toy
> database that does not follow the standards". As soon as I point out an SQL
> standard that you DON'T follow I get a barrage of weasel words and pathetic
> excuses.

The level of SQL conformance as evaluated by the PostgreSQL developers
can be found in the documentation.  If MySQL has a similar document, you
can draw your own comparisons.  I know of no such document, but I would
guess that MySQL is less conforming than PostgreSQL.

You should, however, not mistake the chatter of the PostgrSQL newsgroup
mob as facts, authorative statements, or representative of the opinions
of the project leadership.  We cannot choose the people our newsgroups
attract.

I am sorry that you interpret my attempts to explain my reading of the
SQL standards to you as weasel words and pathetic excuses.  If you
cannot restrict your comments to rational arguments and have to resort
to name-calling, then I should probably not waste any more time
discussing with you.

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #4465: GROUP BY is not to SQL standard
Next
From: Gregory Stark
Date:
Subject: Re: BUG #4465: GROUP BY is not to SQL standard