Re: escape string type for upcoming 8.1

From: Jeff Davis <jdavis-pgsql(at)empires(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: escape string type for upcoming 8.1
Date: 2005-08-11 05:43:30
Message-ID: 42FAE582.4080508@empires.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Having said that, though, I'm agin back-porting this. We don't
> back-patch feature additions, and this can hardly be described as
> a bug fix.
>

I'm not for or against back porting this feature. I basically want to
know if my plan (appended to this email) was a sane way to write
forward-compatible code.

I can't rely on PQescapeString, because the client library may be a
different version than the server. Right?

The only other logical option is to make a wrapper function around two
string-escaping functions that checks the server version and creates a
string accordingly.

Regards,
Jeff Davis

PS: my plan for making an E'' like string in 8.0:

CREATE FUNCTION ein(CSTRING) RETURNS E AS 'textin' LANGUAGE internal;

CREATE FUNCTION eout(E) RETURNS CSTRING AS 'textout' LANGUAGE internal;

CREATE TYPE E (input=ein,output=eout);

CREATE CAST (E AS TEXT) WITHOUT FUNCTION AS IMPLICIT;

CREATE CAST (TEXT AS E) WITHOUT FUNCTION AS IMPLICIT;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2005-08-11 05:57:54 Re: Change to PostgreSQL
Previous Message Jim Mlodgenski 2005-08-11 05:33:13 Re: What's up with EnterpriseDB?