Adding // comments (ANSI??)...

Lists: pgsql-patches
From: Sean Chittenden <sean(at)chittenden(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: Adding // comments (ANSI??)...
Date: 2003-02-04 23:21:35
Message-ID: 20030204232135.GG15936@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

I just had a friend over at EDS ask me if PostgreSQL supported //
comments. It didn't, so I put together a patch for them so that they
could retain compatiblity across the databases they work on.

I didn't think much of it until I took a gander at the crash-me page
on mysql.com and I couldn't find a single vendor that supports //
comments, but it did list // as an ANSI supported comment. ::shrug::
I don't have a copy of the spec, so someone more knowledgable in that
area will have to speak to this or whether or not support for // is
even wantd, but, here's the patch and regression tests. -sc

--
Sean Chittenden

Attachment Content-Type Size
patch text/plain 5.5 KB

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Sean Chittenden" <sean(at)chittenden(dot)org>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Adding // comments (ANSI??)...
Date: 2003-02-05 02:03:07
Message-ID: GNELIHDDFBOCMGBFGEFOGEGDCFAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

As far as I'm aware, MySQL is the only database that supports '//' as a
comment, and they made it up out of whole cloth...

ANSI _C_ perhaps...

Chris

> -----Original Message-----
> From: pgsql-patches-owner(at)postgresql(dot)org
> [mailto:pgsql-patches-owner(at)postgresql(dot)org]On Behalf Of Sean Chittenden
> Sent: Wednesday, 5 February 2003 7:22 AM
> To: pgsql-patches(at)postgresql(dot)org
> Subject: [PATCHES] Adding // comments (ANSI??)...
>
>
> I just had a friend over at EDS ask me if PostgreSQL supported //
> comments. It didn't, so I put together a patch for them so that they
> could retain compatiblity across the databases they work on.
>
> I didn't think much of it until I took a gander at the crash-me page
> on mysql.com and I couldn't find a single vendor that supports //
> comments, but it did list // as an ANSI supported comment. ::shrug::
> I don't have a copy of the spec, so someone more knowledgable in that
> area will have to speak to this or whether or not support for // is
> even wantd, but, here's the patch and regression tests. -sc
>
> --
> Sean Chittenden
>


From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Adding // comments (ANSI??)...
Date: 2003-02-05 02:36:26
Message-ID: 20030205023626.GH15936@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

> > I just had a friend over at EDS ask me if PostgreSQL supported //
> > comments. It didn't, so I put together a patch for them so that they
> > could retain compatiblity across the databases they work on.
> >
> > I didn't think much of it until I took a gander at the crash-me page
> > on mysql.com and I couldn't find a single vendor that supports //
> > comments, but it did list // as an ANSI supported comment. ::shrug::
> > I don't have a copy of the spec, so someone more knowledgable in that
> > area will have to speak to this or whether or not support for // is
> > even wantd, but, here's the patch and regression tests. -sc
>
> As far as I'm aware, MySQL is the only database that supports '//'
> as a comment, and they made it up out of whole cloth...
>
> ANSI _C_ perhaps...

MySQL doesn't support //, unless you meant #.

http://www.mysql.com/information/crash-me.php
http://www.mysql.com/doc/en/Comments.html
http://www.mysql.com/doc/en/ANSI_diff_comments.html

Hrm, well, sybase, Microsoft, and a thing called "AceDB" do, but I
haven't seen high nor low of // being actually referenced as an ANSI
sanctioned comment style anywhere. I guess that's just for the
archives or the C++/Java impared. ::shrug::

http://manuals.sybase.com/onlinebooks/group-aw/awg0800e/dbrfen8/@Generic__BookTextView/7074
http://www.microsoft.com/mspress/books/sampchap/4076a.asp
http://www.acedb.org/Cornell/syntax.html

-sc

--
Sean Chittenden


From: Neil Conway <neilc(at)samurai(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Sean Chittenden <sean(at)chittenden(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Adding // comments (ANSI??)...
Date: 2003-02-05 02:37:37
Message-ID: 1044412657.6532.1193.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Tue, 2003-02-04 at 21:03, Christopher Kings-Lynne wrote:
> As far as I'm aware, MySQL is the only database that supports '//' as a
> comment, and they made it up out of whole cloth...

Just to confirm that, my copy of the SQL 2003 draft, section 5.2, says:

<comment> ::=
<simple comment>
| <bracketed comment>

<simple comment> ::=
<simple comment introducer> [ <comment characters>...] <newline>

<simple comment introducer> ::=
<minus sign><minus sign>[<minus sign>...]

(and <bracketed comment> is a C-style /* ... */ pair, which I've omitted
for brevity).

I'm not sure where the evidence for the "ANSI standard" claim comes
from, but AFAICS "// comments" are not part of the SQL standard, at any
rate.

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sean Chittenden <sean(at)chittenden(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Adding // comments (ANSI??)...
Date: 2003-02-05 02:46:05
Message-ID: 21577.1044413165@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Sean Chittenden <sean(at)chittenden(dot)org> writes:
> I didn't think much of it until I took a gander at the crash-me page
> on mysql.com and I couldn't find a single vendor that supports //
> comments, but it did list // as an ANSI supported comment. ::shrug::

MySQL seem to have only a very weak grasp on the notion of "spec
compliance" ;-). // is most definitely not a comment in the SQL spec.

Furthermore, it's a legal operator name in Postgres.

regards, tom lane


From: Sean Chittenden <sean(at)chittenden(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Adding // comments (ANSI??)...
Date: 2003-02-05 02:57:07
Message-ID: 20030205025707.GI15936@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

> > I didn't think much of it until I took a gander at the crash-me
> > page on mysql.com and I couldn't find a single vendor that
> > supports // comments, but it did list // as an ANSI supported
> > comment. ::shrug::
>
> MySQL seem to have only a very weak grasp on the notion of "spec
> compliance" ;-). // is most definitely not a comment in the SQL
> spec.

At best a weak notion of spec compliance. You should read about the
use of '--' as a comment and why '--' has to have a space after it in
order for it to be a valid comment: I found it highly amusing. :)

Anyway, Neil, thanks for looking that up: I don't have a copy of the
standard and thought it was a tad strange to see it listed as an ANSI
comment (assuming they meant ANSI SQL and not ANSI C99), especially
since I couldn't find _any_ references suggesting // as a valid SQL
token. :)

-sc

--
Sean Chittenden