Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] dollar quoting

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>,"Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] dollar quoting
Date: 2004-02-16 15:48:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> >> No, it won't.  The problem is that it should, because the backend will
> >> see that as '42' followed by a $foo$ quote start.
> > Ok, I see what you are saying. This mismatch would only happen on 
> > invalid input, though. I believe that what I did will work on all legal 
> > input.
> I'm unconvinced.  Even if there are not any current syntaxes in which a
> numeric literal can be adjacent to a string literal (I'm not totally
> sure about that), what of the future?  We should solve the problem
> rather than assuming it won't bite us.
> > I think that this might be cured by having psql recognise a legal 
> > identifier or keyword and eating it as a word, rather than treating it 
> > as just another set of bytes in the stream.
> Hm, might work ... will think about it ...

I am a little concerned about adding the overhead of lex to psql.  Right
now, some folks have reported that lex/yacc take a considerable amount
of processing time in the backend as part of a query, and adding that to
psql just to do $$ seems questionable.  Of course, we can alway test and
see what the overhead shows.

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to


pgsql-hackers by date

Next:From: Robert TreatDate: 2004-02-16 15:53:11
Subject: Re: No Timeout in SELECT..FOR UPDATE
Previous:From: Bruce MomjianDate: 2004-02-16 15:44:16
Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint

pgsql-patches by date

Next:From: Tom LaneDate: 2004-02-16 16:07:46
Subject: Re: [HACKERS] dollar quoting
Previous:From: Mark GibsonDate: 2004-02-16 10:50:38
Subject: Re: dblink - custom datatypes NOW work :)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group