pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <jurka@ejurka.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: JDBC Support for standard_conforming_strings
Date: Mon, 27 Nov 2006 06:46:50 -0700
Message-ID: <456AEC4A.4000401@ejurka.com> (raw)
In-Reply-To: <456AE94B.7040409@gmx.at>
References: <454E4DA7.8030603@gmx.at>
	<Pine.BSO.4.63.0611060130450.23864@leary2.csoft.net>
	<454FB057.1080000@gmx.at>
	<45580A6E.2010905@ejurka.com>
	<45615B73.8050200@gmx.at>
	<456AE94B.7040409@gmx.at>

Another message that did not reach the list because of large patches. 
I've put the patches here:

http://www.ejurka.com/pgsql/patches/standard-strings/

Kris Jurka

Michael Paesold wrote:
> Here is a new version of my patch (set) implementing support for 
> standard_conforming_strings.
> 
> There are three patches now, split for easier review:
> 01-standard-strings.patch:
>   the main patch (to be applied first)
> 02-metadata-escapes.patch:
>   updates literal \\ escapes in AbstractJdbc2DatabaseMetaData
> 03-testsuite-escapes.patch:
>   updates literal \\ escapes in the test-suite and expands the
>   test for string literals for server versions >= 8.2.
> 
> With all three patches applied, the driver passes the test suite against 
> an 8.2 server with both standard_conforming_strings turned on or off, as 
> well as connecting using the V2 or V3 protocol.
> 
> Some notes:
> - The AbstractJdbc2DatabaseMetaData class made a lot of use of "x LIKE 
> 'pg\\\\_%'" constructs. With standard_conforming_strings turned off, 
> this must be written as 'pg\\_%'. Since many of the instances are in 
> static initialization context, there is no access to that setting, 
> though. So I changed all of those to "x ~ '^pg_'" (or similar) instead, 
> which works without escaping. Tom Lane recommended this usage pattern 
> for the information_schema on hackers, once. So I guess it should be OK 
> for the JDBC driver, too.
> Nevertheless, the changes should be reviewed thoroughly, because some 
> code paths are only executed for older version of Postgres.
> 
> - The query splitting code now also supports parsing the escaped string 
> syntax (E''). The parsing code in parseSql and modifyJdbcCall does not 
> yet. I thought this was of less importance.
> Perhaps it could be done more easily by reusing or combining the main 
> parsing code (the code already has comments suggesting that). Since the 
> release of 8.2 is imminent, I would prefer to leave it as-is for now and 
> rather get testing on the more important parts.
> 
> - The V2 query path now uses the E'' escape string syntax for string 
> constants as soon as a server version >= 8.2 is discovered. This 
> protects the driver from changes to standard_conforming_strings, which 
> it cannot detect using the V2 protocol. The escape string syntax is also 
> used to send bytea data to the server.
> 
> I am currently not aware of any other issues. Comments are welcome, 
> testing is appreciated.
> 
> Best Regards
> Michael Paesold
> 



view thread (11+ messages)  latest in thread

Message-ID: <456AEC4A.4000401@ejurka.com>
Permalink:  ../456AEC4A.4000401@ejurka.com/
Also on:    postgresql.org/message-id/456AEC4A.4000401@ejurka.com

 · 

reply

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-jdbc@postgresql.org
  Cc: jurka@ejurka.com
  Subject: Re: JDBC Support for standard_conforming_strings
  In-Reply-To: <456AEC4A.4000401@ejurka.com>
  References: <454E4DA7.8030603@gmx.at> <Pine.BSO.4.63.0611060130450.23864@leary2.csoft.net> <454FB057.1080000@gmx.at> <45580A6E.2010905@ejurka.com> <45615B73.8050200@gmx.at> <456AE94B.7040409@gmx.at> <456AEC4A.4000401@ejurka.com>

* 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