Re: [BUGS] COPY FROM is not 8bit clean

2002-02-26 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Can someone explain why this fixes the problem. > > Think about a machine where char is signed by default. Extracting \254 > into an int will produce -2, which will not equal \254 returned by getc. Oh, I thought that the int return

Re: [BUGS] COPY FROM is not 8bit clean

2002-02-26 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Can someone explain why this fixes the problem. Think about a machine where char is signed by default. Extracting \254 into an int will produce -2, which will not equal \254 returned by getc. regards, tom lane

Re: [BUGS] COPY FROM is not 8bit clean

2002-02-26 Thread Bruce Momjian
Can someone explain why this fixes the problem. I thought it was safe to assign a char to an int and do a compare. The compare I see is: if (c == delimc) break; --- Darcy Buskermo

Re: [BUGS] COPY FROM is not 8bit clean

2002-02-26 Thread Tom Lane
Darcy Buskermolen <[EMAIL PROTECTED]> writes: > Postgres was not compiled with Multibyte, if I replace the if (delimc == c) > with if (strstr(delim,c)) it works as expected. This changes was > implemented for performance reasons according to the CVS log. Yeah, my error :-(. See Tatsuo's reply fo

Re: [BUGS] COPY FROM is not 8bit clean

2002-02-26 Thread Darcy Buskermolen
This patch solves the problem. At 09:16 PM 2/26/02 +0900, Tatsuo Ishii wrote: >> When useing COPY FROM 'file' DELIMITER '\254' copyfrom reads past the >> delimiter and ends up with parse errors when trying to do the insert >> >> >> What the ?? why dind' tthat go through with the body of the tex

Re: [BUGS] COPY FROM is not 8bit clean

2002-02-26 Thread Darcy Buskermolen
Postgres was not compiled with Multibyte, if I replace the if (delimc == c) with if (strstr(delim,c)) it works as expected. This changes was implemented for performance reasons according to the CVS log. At 11:57 PM 2/25/02 -0500, Tom Lane wrote: >Darcy Buskermolen <[EMAIL PROTECTED]> writes: >>

Re: [BUGS] COPY FROM is not 8bit clean

2002-02-26 Thread Tatsuo Ishii
> When useing COPY FROM 'file' DELIMITER '\254' copyfrom reads past the > delimiter and ends up with parse errors when trying to do the insert > > > What the ?? why dind' tthat go through with the body of the text.. *sigh* > I'll resend in the AM.. Good catch. It's definitely a bug in copy com

Re: [BUGS] COPY FROM is not 8bit clean

2002-02-25 Thread Tom Lane
Darcy Buskermolen <[EMAIL PROTECTED]> writes: > When useing COPY FROM 'file' DELIMITER '\254' copyfrom reads past the > delimiter and ends up with parse errors when trying to do the insert Are you perhaps operating in a multibyte encoding in which \254 is just the first byte of a multibyte charac

[BUGS] COPY FROM is not 8bit clean

2002-02-25 Thread Darcy Buskermolen
ACK! must rember which MTA I'm useing... When useing COPY FROM 'file' DELIMITER '\254' copyfrom reads past the delimiter and ends up with parse errors when trying to do the insert What the ?? why dind' tthat go through with the body of the text.. *sigh* I'll resend in the AM.. ---

[BUGS] COPY FROM is not 8bit clean

2002-02-25 Thread Darcy Buskermolen
ACK! must rember which MTA I'm useing... When useing COPY FROM 'file' DELIMITER '\254' copyfrom reads past the delimiter and ends up with parse errors when trying to do the insert ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[BUGS] COPY FROM is not 8bit clean

2002-02-25 Thread Darcy Buskermolen
When useing COPY FROM 'file' ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster