Re: [Fwd: Re: dblink patches for comment] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [Fwd: Re: dblink patches for comment]
Date
Msg-id 12893.1244313293@sss.pgh.pa.us
Whole thread Raw
In response to Re: [Fwd: Re: dblink patches for comment]  (Joe Conway <mail@joeconway.com>)
Responses Re: [Fwd: Re: dblink patches for comment]  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
Joe Conway <mail@joeconway.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


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: [Fwd: Re: dblink patches for comment]
Next
From: Josh Berkus
Date:
Subject: Re: pg_migrator issue with contrib