Re: Backslashes in string literals

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Backslashes in string literals
Date: 2006-02-10 04:31:47
Message-ID: 200602100431.k1A4VlY21635@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kevin Grittner wrote:
> >>> On Wed, Feb 1, 2006 at 10:50 am, in message
> <200602011650(dot)k11GoiU23147(at)candle(dot)pha(dot)pa(dot)us>, Bruce Momjian
> <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> >>
> >> (1) I couldn't figure out the best way to obtain a value for
> >> standard_conforming_strings in the psql version of the scanner.
> >
> > The proper way to do (1) is to call libpq's pqSaveParameterStatus()
> from
> > psql. Take a look for psql's session_username(). It is called
> > everytime the prompt is printed if the username is required. One
> great
> > feature of using pqSaveParameterStatus() is that it reads server
> packets
> > and keeps the tracked value updated for you without query overhead.
>
> My attempt to do as you suggest isn't working. It behaves as though
> the standard_strings() function I added to common.c is always returning
> false. (If I comment out the reference the function, and the else
> clause, I can get psql to work with the "on" state; otherwise, no joy.
> The back end is working fine in all my tests.) I tried to mimic the
> technique in the existing functions. Can you give me a clue where I'm
> going wrong?

OK, I got it working. The fix is to add GUC_REPORT to guc.c for
standard_conforming_strings. See the same flag on
session_authorization. That will cause libpq to see any changes made to
that variable. Sorry I didn't know that detail before.

--
Bruce Momjian | http://candle.pha.pa.us
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2006-02-10 06:06:04 Re: streamlined standby procedure
Previous Message Christopher Kings-Lynne 2006-02-10 02:42:02 Re: Feature request - Add microsecond as a time unit for