Re: allow COPY routines to read arbitrary numbers of fields

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: allow COPY routines to read arbitrary numbers of fields
Date: 2010-12-06 18:07:44
Message-ID: 4CFD2670.2050307@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/06/2010 12:11 PM, Tom Lane wrote:
> Andrew Dunstan<andrew(at)dunslane(dot)net> 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.

Good point. will fix.

> 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?

AFAICT it's not used in binary mode at all. But I will double check.

> Also please be a little more careful with the formatting.

Ok, Will fix also. Thanks for he comments.

cheers

andre

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2010-12-06 18:10:12 Re: Per-column collation
Previous Message Robert Haas 2010-12-06 18:06:59 Re: pg_execute_from_file review