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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [BUGS] COPY FROM is not 8bit clean
Дата
Msg-id 200202270309.g1R39Wp03556@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] COPY FROM is not 8bit clean  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Justin Clift
Дата:
Сообщение: Experimental Feature development in PostgreSQL
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Refactoring of command.c