Thread: docs correction (8.0 beta)

docs correction (8.0 beta)

From
John DeSoi
Date:
 From the example below and looking at scan.c, it seems that nested
block comments are supported.

test=# select /* /* nested */ */ 1;
  ?column?
----------
         1
(1 row)



 From section 35.3:

There are two types of comments in PL/pgSQL. A double  dash (--) starts
a comment that extends to the end of  the line. A /* starts a block
comment that extends to  the next occurrence of */. Block comments
cannot be  nested, but double dash comments can be enclosed into a
block comment and  a double dash can hide the block comment delimiters
/*  and */.


Re: docs correction (8.0 beta)

From
Tom Lane
Date:
John DeSoi <desoi@icx.net> writes:
>  From the example below and looking at scan.c, it seems that nested
> block comments are supported.

You are confusing SQL and PL/pgSQL.

            regards, tom lane

Re: docs correction (8.0 beta)

From
Bruce Momjian
Date:
Tom Lane wrote:
> John DeSoi <desoi@icx.net> writes:
> >  From the example below and looking at scan.c, it seems that nested
> > block comments are supported.
>
> You are confusing SQL and PL/pgSQL.

Any idea why they don't match between SQL and PL/pgSQL.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: docs correction (8.0 beta)

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> You are confusing SQL and PL/pgSQL.

> Any idea why they don't match between SQL and PL/pgSQL.

Different lexers.

We could talk about extending plpgsql's lexer to handle comments the
same way as the main SQL lexer, but it doesn't do so ATM.  (Also, there
is compatibility with Oracle PL/SQL to think about before assuming such
a change must be a Good Thing...)

            regards, tom lane

Re: docs correction (8.0 beta)

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >> You are confusing SQL and PL/pgSQL.
>
> > Any idea why they don't match between SQL and PL/pgSQL.
>
> Different lexers.
>
> We could talk about extending plpgsql's lexer to handle comments the
> same way as the main SQL lexer, but it doesn't do so ATM.  (Also, there
> is compatibility with Oracle PL/SQL to think about before assuming such
> a change must be a Good Thing...)

Yea, I was wondering about PL/SQL compatibility.  Someone want to
research that?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073