Re: bug in (plpgsql) parser?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Reinoud van Leeuwen <reinoud(at)xs4all(dot)nl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: bug in (plpgsql) parser?
Date: 2001-06-04 13:42:16
Message-ID: 200106041342.f54DgGe07896@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> Hello world,
>
> I am using "PostgreSQL 7.1.2 on i386-unknown-freebsd4.2, compiled by GCC
> 2.95.2" (according to version()). I suspect that there is a parser bug in
> the handling of '--' comments:
>
> radius=# create function test() returns integer as '
> radius'# begin
> radius'# -- comment without quotes
> radius'# return 0;
> radius'# end;
> radius'# ' language 'plpgsql';
> CREATE
>
> This works OK
>
> radius=#
> radius=# create function test2() returns integer as '
> radius'# begin
> radius'# -- comment 'with' quotes
> radius'# return 0;
> radius'# end;
> radius'# ' language 'plpgsql';
> ERROR: parser: parse error at or near "with"
>
> It seems that the parser does not ignore the rest of the line after the '--
> ', as I would suspect...
>
> Reinoud van Leeuwen
> (switched from Sybase to Postgresql two weeks ago and has no regrets! :-)

My question is whether you think "--" _inside_ quotes should be a
comment. I don't think it should be.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-06-04 14:05:59 Re: System Logs filling up with gunk
Previous Message Bruce Momjian 2001-06-04 13:39:32 Re: Bug in postgresql7.1 jdbc2 DatabaseMetaData class