docs correction (8.0 beta)

Started by John DeSoiover 21 years ago5 messagesdocs
Jump to latest
#1John DeSoi
desoi@icx.net

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 */.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: John DeSoi (#1)
Re: docs correction (8.0 beta)

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

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: docs correction (8.0 beta)

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
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: docs correction (8.0 beta)

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

#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#4)
Re: docs correction (8.0 beta)

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