Re: [HACKERS] Re: SQL compliance - why -- comments only at psql level ?

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, pgsql-hackers(at)postgreSQL(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: [HACKERS] Re: SQL compliance - why -- comments only at psql level ?
Date: 2000-02-19 01:36:41
Message-ID: 38ADF3A9.B0F30A78@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> Hannu Krosing <hannu(at)tm(dot)ee> writes:
> > Thomas Lockhart wrote:
> >> ... although InterBase was lauded for SQL92 compliance, the author
> >> did encourage them to consider supporting the SQL92 comment delimiter
> >> ("--") in their next release :))
>
> > Why does PostgreSQL _not_ support the -- comment delimiter ?
>
> Better read it again, Hannu ... wasn't us that was being spoken of ...

I got the impression from the paragraph that followed that we don't

and the first query I tried bounced from commandline

[hannu(at)hu hannu]$ psql -c "select count(*) from t1 -- what"
ERROR: parser: parse error at or near "-"

but worked interactively:

[hannu(at)hu TeleHansaPlus]$ psql
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.2 on i586-pc-linux-gnu, compiled by gcc egcs-2.91.66]

type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: hannu

hannu=> select count(*) from t1 -- what
hannu-> ;
count
-----
3
(1 row)

and failed also when used from python

[hannu(at)hu TeleHansaPlus]$ python
Python 1.5.2 (#1, Apr 18 1999, 16:03:16) [GCC pgcc-2.91.60 19981201
(egcs-1.1.1 on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import pg
>>> con=pg.connect('hannu')
>>> con.query("select count(*) from t1 -- what")
Traceback (innermost last):
File "<stdin>", line 1, in ?
pg.error: ERROR: parser: parse error at or near "-"

So assumed it was handled in psql when in interactive mode.

------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-02-19 01:38:06 Re: [HACKERS] Re: SQL compliance - why -- comments only at psql level ?
Previous Message Marc Tardif 2000-02-19 01:26:11 handling multiple file descriptors