Postgres 9.1 and string escapes

Jay Shaughnessy jshaughn at redhat.com
Tue Sep 27 21:13:41 UTC 2011


Heiko,

This is actually configurable on our side.  We've already handled the 
disparity between Oracle (using the standard) and Postgres (not using 
the standard, at least not until now).  See 
PostgresqlDatabaseType#getEscapeCharacter() .  This override was put in 
place to handle the fact that postgres was not using the standard and so 
by default any postgres version will get this setting. If 9.1 is the 
first version to go to the standard, then  it can again be overriden in 
Postgresql91DatabaseType, setting it back to a single slash for that, 
and future versions.

Jay


On 9/27/2011 2:16 PM, Heiko W.Rupp wrote:
> With Postgres 9.1 (out of the box) I can not log in and get this  error in the console log:
>
> Caused by: org.postgresql.util.PSQLException: ERROR: invalid escape string
>    Hinweis: Escape string must be empty or one character.
>
>
> This comes from the fact that postgres 9.1 by default uses
> "standard conforming strings" - those got introduced in 8.x already,
> but were turned off and only warned about.
> See http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.1#Backward_compatibility_issues
>
> We can put the following in postgresql.conf and signal Postgres to reload the
> config in order to get it working again:
>
> standard_conforming_strings = off
>
>
> I have the impression that to fix this out of the box, we would need
> a newer version of hibernate('s postgres dialect). Upgrading to the 9.1
> driver does not fix it.
>
>    Heiko
>


More information about the rhq-devel mailing list