Re: make == as = ?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: make == as = ?
Date: 2004-04-12 16:32:15
Message-ID: 200404120932.15556.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabien,

> I agree that listening is something difficult, for me as for every body.
> Also, listening and talking in another language is not easy.

I can understand that. I'm going to reply at length, here, because there is
a principle behind so many of us rejecting your suggestion, and I'd like you
to understand it because you seem interested in being an active participant
in the community.

> Also, I thought - wrongly - that it might be useful to others, and
> would not hurt anyone.
>
> Definitly not a shared point of view from the answers I get!

Correct. What a lot of people disagree on is the "would not hurt anybody".

> Moreover, I noticed so many "convenient non standard" features in
> postgresql that suggesting one more did not seem so stupid to me at first
> glance.

Well, what several people have been trying to explain is that this is
different. We have non-standard syntax for 3 reasons:

1) It's a legacy from when we didn't know any better (example: !=)
2) The syntax supports features that are simply not available under the SQL
spec (example, LIMIT or SELECT DISTINCT ON).
3) The syntax supports the Object-Relational extensions of PostgreSQL, and
were developed before the publication of O-R syntax in the SQL99 spec, so our
syntax differs.

The addition of an == operator as a synonym for = does not fall into any of
those three groups.

Adding == would cause harm in the following three ways:

1) It would impair portability between PostgreSQL and other databases that
support the SQL standard.
2) It would be one more operator to maintain between distributions
3) It would, in my opinion, confuse Java and C coders instead of helping them.

The last point is very important for your purposes. Let me explain by
allegory:
I speak a little Spanish and a little Italian, but neither fluently. When I
was learning Italian, one of the biggest things to get in my way was my
knowledge of Spanish ... the grammar is almost the same, some words are the
same, and some of the phonetics are the same ... but not all. I can't tell
you how many times I embarassed myself in Italian class by swapping in a
Spaish word in an Italian sentence, or worse, speaking Italian with a Mexican
accent! But I had no problem whatsoever keeping my Italian and my Nepali
seperate, because the two languages are not at all similar.

Adding an == operator to the SQL syntax would be the same. Your Java students
would be lulled into a false sense of understanding out of the belief that ==
in PostgreSQL would work exactly like == in Java ... when it wouldn't work
the same in corner cases. SQL and Java are radically different languages
based on entirely different priniciples (which is why SQLJ is a stupid idea
as well, IMHO).

Finally, when your students leave your classroom and need to write a program
that interfaces with Oracle or SQL Server, then what? They'll look at their
notebooks from class and try the examples, and get a "syntax error."

> - "formation" means learning a specific skill.
> for this purpose, I could have "java-programming", and java details
> are really important in this course. "int and long differ, although in
> C int and long may or may not differ".
>
> That will serve them differently.

Remind me to avoid "formation" courses in France, then. From my perspective,
it is better to teach a student nothing at all than to teach them something
which is wrong.

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message pgsql 2004-04-12 16:38:19 Re: PostgreSQL configuration
Previous Message Tom Lane 2004-04-12 16:02:19 Re: PostgreSQL configuration