dbTalk Databases Forums  

[BUGS] BUG #1486: Apostrophes are not ignored in pgplsql comments

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1486: Apostrophes are not ignored in pgplsql comments in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrew Gold
 
Posts: n/a

Default [BUGS] BUG #1486: Apostrophes are not ignored in pgplsql comments - 02-20-2005 , 11:54 PM







The following bug has been logged online:

Bug reference: 1486
Logged by: Andrew Gold
Email address: agold (AT) cbamedia (DOT) 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.

Thanks,

Andrew Gold

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote
  #2  
Old   
Richard Huxton
 
Posts: n/a

Default Re: [BUGS] BUG #1486: Apostrophes are not ignored in pgplsql comments - 02-21-2005 , 07:57 AM






Andrew Gold wrote:
Quote:
The following bug has been logged online:

Bug reference: 1486
Logged by: Andrew Gold
Email address: agold (AT) cbamedia (DOT) 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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.