pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Garrett Murphy <gmurphy@lawlogix.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Backslash characters in PLPGSQL
Date: Tue, 03 Aug 2010 11:54:28 -0400
Message-ID: <21044.1280850868@sss.pgh.pa.us> (raw)
In-Reply-To: <076DC33A3D38CE4BBC64D35DDD9DE70C0AD972F3@mse4be2.mse4.exchange.ms>
References: <076DC33A3D38CE4BBC64D35DDD9DE70C0AD972F3@mse4be2.mse4.exchange.ms>

"Garrett Murphy" <gmurphy@lawlogix.com> writes:
> We recently upgraded from 8.3 to 8.4 and are noticing a change in
> behavior that we can't seem to associate with a particular server
> setting.

I think you're seeing the effects of this 8.4 patch:
http://archives.postgresql.org/pgsql-committers/2009-04/msg00216.php
in particular:

* In standard_conforming_strings mode, backslash as the last character of a
  non-E string literal is now correctly taken as an ordinary character;
  formerly it was misinterpreted as escaping the ending quote.  (Since the
  string also had to pass through the core scanner, this invariably led
  to syntax errors.)

However, as I wrote there, I was under the impression that this fix
didn't break any cases that actually worked usefully before 8.4.
I tried your example and as far as I can tell, 8.3.x fails on
test_function2(), giving "unterminated string" with or without
standard_conforming_strings set.  But 8.4 accepts it, if you have
standard_conforming_strings set.  I wonder whether your actual
function has yet another improperly terminated string on another
line, thereby allowing the 8.3 plpgsql scanner to get back into
sync.  But it's not obvious why that wouldn't lead to visible
misbehavior, or why 8.4 would not like it.

			regards, tom lane



view thread (2+ messages)

Message-ID: <21044.1280850868@sss.pgh.pa.us>
Permalink:  ../21044.1280850868@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21044.1280850868@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gmurphy@lawlogix.com
  Subject: Re: Backslash characters in PLPGSQL
  In-Reply-To: <21044.1280850868@sss.pgh.pa.us>

* 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