Re: BUG #1486: Apostrophes are not ignored in pgplsql comments

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: BUG #1486: Apostrophes are not ignored in pgplsql comments
Дата
Msg-id 4219E860.6030806@archonet.com
обсуждение исходный текст
Ответ на BUG #1486: Apostrophes are not ignored in pgplsql comments  ("Andrew Gold" <agold@cbamedia.com>)
Список pgsql-bugs
Andrew Gold wrote:
> The following bug has been logged online:
>
> Bug reference:      1486
> Logged by:          Andrew Gold
> Email address:      agold@cbamedia.com
> PostgreSQL version: 7.4.7
> Operating system:   Debian Linux
> Description:        Apostrophes are not ignored in pgplsql comments
> Details:
>
> In pgplsql functions, apostrophes in comments are not ignored by the pgplsql
> interpreter. Parsing errors result from correct spelling in comments. For
> example, a comment such as:
>
> -- This can't be a good way to solve this.
>
> will generate errors. This seems to be a general bug and was easily
> duplicated.

I don't think it's a plpgsql problem though - rather an artefact of the
SQL parser. You're actually doing

CREATE FUNCTION foo() RETURNS ... AS <some text value> LANGUAGE ...;

I think the problem is while the SQL parser is processing the text-value
- you need to escape the single-quote to get past that stage of parsing.

There are similar issues with regexp strings.

If you're using dollar-quoting in 8.0 the problem is gone.

--
   Richard Huxton
   Archonet Ltd

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: problem installing postgresql-8.0.1 on Windows 2K
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: BUG #1485: upper case user names / creatuser