Patch for Re: [HACKERS] Bug of PL/pgSQL parser

Started by eutmover 23 years ago5 messagesbugs
Jump to latest
#1eutm
eutm@yandex.ru

I send a simple patch for PL/pgSQL parser which allow now to use whitespaces in identifers of any kind(table names,attribute names,variables ...) in Pl/pgSQL procedural language.Explicit definition of bug can be found in
Re: [HACKERS] Bug of PL/pgSQL parser

Attachments:

plpgsql.dquote.patchapplication/octet-stream; name=plpgsql.dquote.patchDownload+34-3
#2Bruce Momjian
bruce@momjian.us
In reply to: eutm (#1)
Re: Patch for Re: [HACKERS] Bug of PL/pgSQL parser

I assume this completes the TODO item:

o Fix PL/PgSQL to handle quoted mixed-case identifiers

It is quite a bit of lex code, but I assume it was required. No one
else was able to fix this item.

Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

eutm wrote:

I send a simple patch for PL/pgSQL parser which allow now to use whitespaces in identifers of any kind(table names,attribute names,variables ...) in Pl/pgSQL procedural language.Explicit definition of bug can be found in
Re: [HACKERS] Bug of PL/pgSQL parser

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: Patch for Re: [HACKERS] Bug of PL/pgSQL parser

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I assume this completes the TODO item:
o Fix PL/PgSQL to handle quoted mixed-case identifiers

It would if it worked, but it doesn't --- for one thing, it seems
to allow empty identifiers (surely {DQUOTE}* should be {DQUOTE}+).
I'm not convinced it parses identifiers the same as the main scanner
does anyway. Why not just lift the flex code for identifiers
out of parser/scan.l?

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: Patch for Re: [HACKERS] Bug of PL/pgSQL parser

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I assume this completes the TODO item:
o Fix PL/PgSQL to handle quoted mixed-case identifiers

It would if it worked, but it doesn't --- for one thing, it seems
to allow empty identifiers (surely {DQUOTE}* should be {DQUOTE}+).
I'm not convinced it parses identifiers the same as the main scanner
does anyway. Why not just lift the flex code for identifiers
out of parser/scan.l?

I would love to know why doing this TODO item is so hard. Every time I
ask Jan, he says it is very hard and it never gets done.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#4)
Re: Patch for Re: [HACKERS] Bug of PL/pgSQL parser

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I would love to know why doing this TODO item is so hard. Every time I
ask Jan, he says it is very hard and it never gets done.

It doesn't look that hard to me, but I haven't tried yet ...

regards, tom lane