From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <maillist@candle.pha.pa.us>
Cc: Frederic boucher <dziablo@hotmail.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] parser :parse error
Date: Sat, 13 Nov 1999 02:50:19 -0500
Message-ID: <29186.942479419@sss.pgh.pa.us> (raw)
In-Reply-To: <199911082039.PAA19322@candle.pha.pa.us>
[ sorry for not responding sooner, but I was on vacation... ]
>> create table tablename (
>> thefield varchar(50) default 'Fred''s car'
>> );
>>
>> Error : parser: parse error at or near "s"
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Works on current tree. Try 6.5.3.
It does work now, but is broken in 6.5.* and (AFAIK) all prior releases.
The problem is that the parser retranslates DEFAULT expressions into
source form after parsing them --- and the retranslation code is not
bright enough to provide quoting for embedded quotes and backslashes
in string constants. So the system ends up trying to process
DEFAULT 'Fred's car'
which obviously won't work.
Current sources fix this by eliminating the retranslation step. That's
a pretty major change, so I don't think it's practical/safe to backpatch
it into 6.5.*. If someone wants to fix this problem as a patch for
6.5.*, probably the best way to proceed would be to fix
backend/parser/gram.y's makeConstantList() to apply appropriate
backslash-quoting within string constants. I don't have the time or
interest to do it myself though.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, maillist@candle.pha.pa.us, dziablo@hotmail.com
Subject: Re: [SQL] parser :parse error
In-Reply-To: <29186.942479419@sss.pgh.pa.us>
References: <199911082039.PAA19322@candle.pha.pa.us> <29186.942479419@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox