Skip site navigation (1) Skip section navigation (2)

Re: COPY FROM is not 8bit clean

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: darcy(at)ok-connect(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY FROM is not 8bit clean
Date: 2002-02-26 12:16:54
Message-ID: 20020226211654J.t-ishii@sra.co.jp (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
> 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 command. Please try
following patches (this is against 7.2).

*** src/backend/commands/copy.c.orig	Tue Feb 26 21:11:05 2002
--- src/backend/commands/copy.c	Tue Feb 26 21:11:35 2002
***************
*** 1024,1030 ****
  CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline, char *null_print)
  {
  	int			c;
! 	int			delimc = delim[0];
  
  #ifdef MULTIBYTE
  	int			mblen;
--- 1024,1030 ----
  CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline, char *null_print)
  {
  	int			c;
! 	int			delimc = (unsigned char)delim[0];
  
  #ifdef MULTIBYTE
  	int			mblen;

In response to

pgsql-hackers by date

Next:From: Janardhana ReddyDate: 2002-02-26 12:33:43
Subject: Re: [PATCHES] WAL Performance Improvements
Previous:From: Helge BahmannDate: 2002-02-26 10:58:55
Subject: Re: WAL Performance Improvements

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2002-02-26 13:43:38
Subject: Bug #603: time() problems with PostgreSQL 7.2
Previous:From: toxicDate: 2002-02-26 10:40:49
Subject: problems with configure connected with readline&history

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group