Re: exposing COPY API

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: exposing COPY API
Date: 2011-02-04 07:53:55
Message-ID: 4D4BB093.2030009@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/03/2011 10:43 PM, Itagaki Takahiro wrote:
>
>> Also, a FDW allows the COPY to be used as a FROM target, giving it great
>> flexibility. AFAICT this does not.
> BTW, which do you want to improve, FDW or COPY FROM? If FDW, the better
> API would be "raw" version of NextCopyFrom(). For example:
> bool NextRawFields(CopyState cstate, char **fields, int *nfields)
> The caller FDW has responsibility to form tuples from the raw fields.
> If you need to customize how to form the tuples from various fields,
> the FDW also need to have such extensibility.
>
> If COPY FROM, we should implement all the features in copy.c
> rather than exported APIs.

The problem with COPY FROM is that nobody's come up with a good syntax
for allowing it as a FROM target. Doing what I want via FDW neatly gets
us around that problem. But I'm quite OK with doing the hard work inside
the COPY code - that's what my working prototype does in fact.

One thing I'd like is to to have file_fdw do something we can't do
another way. currently it doesn't, so it's nice but uninteresting.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-02-04 07:59:06 Re: [HACKERS] Slow count(*) again...
Previous Message Віталій Тимчишин 2011-02-04 07:39:38 Re: [HACKERS] Slow count(*) again...