Re: [HACKERS] PQunescapeBytea code

2003-10-31 Thread Tom Lane
"Jeroen T. Vermeulen" <[EMAIL PROTECTED]> writes: > This code completely ignores any other usage of the backslash in the > escaped string, generating no output for unknown escape sequences. Is > that the desired behaviour? As Adam pointed out, the code does do the right thing for other backslash

Re: [HACKERS] PQunescapeBytea code

2003-10-30 Thread Bruce Momjian
Adam Kavan wrote: > Actually I was looking at that code today and it does not ignore something > if it is escaped by a backslash on not on the list. It eats the backslash > and then continues the loop so next time that character will be parsed > normally. However PQunescapeBytea is _very_ slow

Re: [HACKERS] PQunescapeBytea code

2003-10-30 Thread Adam Kavan
Actually I was looking at that code today and it does not ignore something if it is escaped by a backslash on not on the list. It eats the backslash and then continues the loop so next time that character will be parsed normally. However PQunescapeBytea is _very_ slow. I am storing fairly la

Re: [HACKERS] PQunescapeBytea code

2003-10-30 Thread Jeroen T. Vermeulen
On Thu, Oct 30, 2003 at 08:24:13PM +0100, Jeroen T. Vermeulen wrote: > > Then the whole loop could become something like this: Okay, that code wasn't entirely correct but it gets the idea across. In C++ terms, what I arrived at was: string result; for (int i=0; i

[HACKERS] PQunescapeBytea code

2003-10-30 Thread Jeroen T. Vermeulen
Someething to consider for after the 7.4 release, perhaps... As per today's CVS version, PQunescapeBytea() does the following when it encounters an escaped character (i.e., a backslash) in the escaped string strtext at offset i: ["if (strtext[i] == '\\')"] i++; if (strtext[i] == '\\') bu