Re: COPY enhancements

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: COPY enhancements
Дата
Msg-id 25829.1255019831@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: COPY enhancements  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: COPY enhancements  (Robert Haas <robertmhaas@gmail.com>)
Re: COPY enhancements  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
"Joshua D. Drake" <jd@commandprompt.com> writes:
> Couldn't you just commit each range of subtransactions based on some
> threshold?

> COPY foo from '/tmp/bar/' COMMIT_THRESHOLD 1000000;

> It counts to 1mil, commits starts a new transaction. Yes there would be
> 1million sub transactions but once it hits those clean, it commits.

Hmm, if we were willing to break COPY into multiple *top level*
transactions, that would avoid my concern about XID wraparound.
The issue here is that if the COPY does eventually fail (and there
will always be failure conditions, eg out of disk space), then some
of the previously entered rows would still be there; but possibly
not all of them, depending on whether we batch rows.  The latter
property actually bothers me more than the former, because it would
expose an implementation detail to the user.  Thoughts?

Also, this does not work if you want the copy to be part of a bigger
transaction, vizBEGIN;do something;COPY ...;do something else;COMMIT;
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Writeable CTEs and side effects
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Issues for named/mixed function notation patch