Re: allow COPY routines to read arbitrary numbers of fields

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: allow COPY routines to read arbitrary numbers of fields
Дата
Msg-id
27888.1291655469@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
allow COPY routines to read arbitrary numbers of fields Andrew Dunstan <andrew@dunslane.net>
Re: allow COPY routines to read arbitrary numbers of fields Tom Lane <tgl@sss.pgh.pa.us>
Re: allow COPY routines to read arbitrary numbers of fields Andrew Dunstan <andrew@dunslane.net>
Re: allow COPY routines to read arbitrary numbers of fields Tom Lane <tgl@sss.pgh.pa.us>
Re: allow COPY routines to read arbitrary numbers of fields Andrew Dunstan <andrew@dunslane.net>
Andrew Dunstan  writes:
> Attached is a patch that allows CopyReadAttibutesText() and 
> CopyReadAttributesCSV() to read arbitrary numbers of attributes. 
> Underflowing attributes are recorded as null, and space is made for 
> overflowing attributes on a line.

Why are you still passing nfields as a separate parameter instead of
relying on the value you added to the struct?  That can't do anything
except cause confusion, especially once the two values diverge due to a
previous array-expansion.  Also, why did you change the setup code to
not compute nfields in binary mode?  That seems at best an unnecessary
change, and at worst a breakage of the binary path --- did you test it?

Also please be a little more careful with the formatting.  This for
instance is pretty sloppy:

!  * strings.  cstate->raw_fields[k] is set to point to the k'th attribute 
!  * string, * or NULL when the input matches the null marker string.  

and there seem to be some gratuitous whitespace changes as well.
		regards, tom lane

В списке pgsql-hackers по дате отправления
От: Dmitriy Igrishin
Дата:
От: Kevin Grittner
Дата:
FAQ