Re: [Fwd: Re: dblink patches for comment]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Fwd: Re: dblink patches for comment]
Date: 2009-06-06 18:34:53
Message-ID: 12893.1244313293@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> OK, got it. I think the attached is what you're looking for, although I
> have not yet tested beyond "it compiles" and "it passes make installcheck".

You're making it vastly overcomplicated. Just do something like

for (cp = str; *cp; cp++)
{
if (*cp == '\\' || *cp == '\'')
AppendStringInfoChar(buf, '\\');
AppendStringInfoChar(buf, *cp);
}

Since you're working in a server-safe encoding, there is no need to
worry about multibyte characters --- the tests will never match
any byte of a multibyte char.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2009-06-06 18:45:24 Re: pg_migrator issue with contrib
Previous Message Joe Conway 2009-06-06 18:27:12 Re: [Fwd: Re: dblink patches for comment]