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

Re: COPY FROM is not 8bit clean

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Darcy Buskermolen <darcy(at)ok-connect(dot)com>,Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-bugs(at)postgresql(dot)org,pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY FROM is not 8bit clean
Date: 2002-02-27 03:09:32
Message-ID: 200202270309.g1R39Wp03556@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> 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 returned by getc already had that sign
extension, but now I remember it doesn't.  In fact, it specifically
returns an int so -1 can be identified.  Got it.  Seems I am forgetting
some of my C.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2002-02-27 03:15:25
Subject: Re: Refactoring of command.c
Previous:From: Justin CliftDate: 2002-02-27 02:20:41
Subject: Experimental Feature development in PostgreSQL

pgsql-bugs by date

Next:From: Jean-Paul ARGUDODate: 2002-02-27 08:07:32
Subject: function tree_level(varchar) (from OpenACS) no longer work under 7.2
Previous:From: Tom LaneDate: 2002-02-26 23:33:27
Subject: Re: COPY FROM is not 8bit clean

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