Re: SQL/MED - file_fdw

Поиск
Список
Период
Сортировка
От Itagaki Takahiro
Тема Re: SQL/MED - file_fdw
Дата
Msg-id AANLkTinv=qAg32vAPvFNygm+mYOBKQoj3Od_XD9fiSYX@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SQL/MED - file_fdw  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: SQL/MED - file_fdw  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Sun, Dec 19, 2010 at 12:18, Robert Haas <robertmhaas@gmail.com> wrote:
> I'm sort of suspicious of the fact that BeginCopyTo() is a shell
> around BeginCopy() while BeginCopyFrom() does a whole bunch of other
> stuff.  I haven't grokked what the code is doing here well enough to
> have a concrete proposal though...

I added Begin/EndCopyTo() just because the internal code looks
symmetric. The proposal doesn't change behaviors of COPY commands
at all. It just exports a part of COPY FROM codes as "File Reader"
so that the file_fdw external module can reuse the code. I believe
we have the conclusion that we should avoid code duplication
to read files in the prior discussion.

We could arrange COPY TO codes as like as the COPY FROM APIs, but
I've not and I won't do that at this time because it is not required
by SQL/MED at all. If we do, it would be "File Writer" APIs, like:

cstate = BeginCopyTO(...);
while (tuple = ReadTupleFromSomewhere()) { /* write the tuple into a TSV/CSV file */ NextCopyTo(cstate, tuple);
}
EndCopyTo(cstate);

--
Itagaki Takahiro


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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Extensions, patch v20 (bitrot fixes) (was: Extensions, patch v19 (encoding brainfart fix))
Следующее
От: Robert Haas
Дата:
Сообщение: Re: SQL/MED - file_fdw