Re: Backslashes in string literals - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Backslashes in string literals
Date
Msg-id 43E21524.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to Re: Backslashes in string literals  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Backslashes in string literals  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
>>> On Wed, Feb 1, 2006 at 10:50 am, in message
<200602011650.k11GoiU23147@candle.pha.pa.us>, Bruce Momjian
<pgman@candle.pha.pa.us> wrote: 
> Kevin Grittner wrote:
>> We found a bug in the code from my first patch.  Since it was a low
>> frequency, non- destructive type of problem for us, I was able to
take my
>> time and look over the task a little more closely.  Attached is a
patch
>> which should come close to implementing the TODO.  In particular, it
is
>> now implemented as a configurable option, which can be set in the
>> postgresql.conf file or at run time.  There are some remaining
issues:
>> 
>> (1)  I couldn't figure out the best way to obtain a value for
>> standard_conforming_strings in the psql version of the scanner.  For
our
>> needs, could just assume it is always on, so I left it that way. 
>> Someone with a better handle on this issue can hopefully finish
that
>> part.  Alternatively, if you give me some direction, I might have
time
>> to generalize it.  As far as I can tell from some testing today,
>> everything works fine issuing statements through a connection, but
psql
>> isn't settled down.
> 
> Sounds like you made great progress!

Thanks.  It was actually pretty easy once I took the time to learn
flex.  I'd kinda winged it in my emergency compile-time version.  I'm
pretty sure that what I've done works; my biggest concern is over what
I've missed.  For example, I was using pg_dump and pg_restore today and
realized that these, and other applications, likely need some kind of
work to support the feature.

> 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.

I'll take a look at it.  If I feel confident that I "get it", I'll do
the work and post another patch.  Would you prefer that I resend the
whole works, or just the delta?

Also, since we're doing this out of need to fix the issue on our
production system, I'm compelled to work on the stable branch.  Is it OK
to post patches from the tip of that branch, or should I really check
out the trunk (HEAD), too, and replicate it there for my patch posts?

-Kevin



pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Multiple logical databases
Next
From: Josh Berkus
Date:
Subject: Re: Multiple logical databases