Re: escape string type for upcoming 8.1

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: escape string type for upcoming 8.1
Дата
Msg-id 42FAE582.4080508@empires.org
обсуждение исходный текст
Ответ на Re: escape string type for upcoming 8.1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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;

В списке pgsql-general по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: EnterpriseDB mentioned in eweek, and...
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Change to PostgreSQL