Skip site navigation (1) Skip section navigation (2)

Re: non-standard escapes in string literals

From: F Harvell <fharvell(at)fts(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Andrew Pimlott <pimlott(at)idiomtech(dot)com>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: non-standard escapes in string literals
Date: 2002-04-25 17:30:34
Message-ID: 200204251730.g3PHUYI31345@odin.fts.net (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, 25 Apr 2002 10:41:56 EDT, Bruce Momjian wrote:
> Andrew Pimlott wrote:
> > I posted this some time ago to pgsql-bugs[1], to no response.  So
> > I'll venture to try here.
> > 
> > Postgres breaks the standard for string literals by supporting
> > C-like escape sequences.  This causes pain for people trying to
> > write portable applications.  Is there any hope for an option to
> > follow the standard strictly?
> 
> This is actually the first time this has come up (that I remember).  We
> do support C escaping, but you are the first to mention that it can
> cause problems for portable applications.
> 
> Anyone else want to comment?  I don't know how to address this.

IMHO, I agree that I would like to see the ANSI standard implemented.

While I really like PostgreSQL, it currently does not scale as large
as other DBMS systems.  Due to this, we try to code as database
agnostic as possible so that a port requires a minimum of effort.
Currently there are only a few areas remaining that are at issue.
(Intervals and implicit type conversion have/are being addressed).

I believe that the reason that it hasn't come up as an issue, per se,
is that it would only affect strings with a backslash in them.
Backslash is not a commonly used character.  In addition, MySQL, also
broken, uses backslashes in the same/similar way.  Lots of people
using PostgreSQL are stepping up from MySQL.

This also poses the biggest problem in terms of legacy compatibility.
Perhaps the answer is to add a runtime config option (and default it
to ANSI) and possibly deprecate the C escaping.

Thanks,
F Harvell

-- 
Mr. F Harvell                          Phone: +1.407.673.2529
FTS International Data Systems, Inc.    Cell: +1.407.467.1919
7457 Aloma Ave, Suite 302                Fax: +1.407.673.4472
Winter Park, FL 32792                 mailto:fharvell(at)fts(dot)net



Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2002-04-25 17:32:27
Subject: Re: md5 passwords and pg_shadow
Previous:From: Mike MascariDate: 2002-04-25 17:16:51
Subject: Re: Vote totals for SET in aborted transaction

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group