Re: [HACKERS] COPY TO returning empty result with parallel ALTER TABLE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] COPY TO returning empty result with parallel ALTER TABLE
Дата
Msg-id 12887.1415127083@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] COPY TO returning empty result with parallel ALTER TABLE  (Bernd Helmle <mailings@oopsware.de>)
Ответы Re: [HACKERS] COPY TO returning empty result with parallel ALTER TABLE  (Andrew Dunstan <andrew@dunslane.net>)
Re: [HACKERS] COPY TO returning empty result with parallel ALTER TABLE  (Sven Wegener <sven.wegener@stealer.net>)
Re: [BUGS] [HACKERS] COPY TO returning empty result with parallel ALTER TABLE  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-general
Bernd Helmle <mailings@oopsware.de> writes:
> --On 3. November 2014 18:15:04 +0100 Sven Wegener
> <sven.wegener@stealer.net> wrote:
>> I've check git master and 9.x and all show the same behaviour. I came up
>> with the patch below, which is against curent git master. The patch
>> modifies the COPY TO code to create a new snapshot, after acquiring the
>> necessary locks on the source tables, so that it sees any modification
>> commited by other backends.

> Well, i have the feeling that there's nothing wrong with it. The ALTER
> TABLE command has rewritten all tuples with its own XID, thus the current
> snapshot does not "see" these tuples anymore. I suppose that in
> SERIALIZABLE or REPEATABLE READ transaction isolation your proposal still
> doesn't return the tuples you'd like to see.

Not sure.  The OP's point is that in a SELECT, you do get unsurprising
results, because a SELECT will acquire its execution snapshot after it's
gotten AccessShareLock on the table.  Arguably COPY should behave likewise.
Or to be even more concrete, COPY (SELECT * FROM tab) TO ... probably
already acts like he wants, so why isn't plain COPY equivalent to that?

What concerns me more is whether there are other utility statements that
have comparable issues.  We should not fix just COPY if there are more
cases.

            regards, tom lane


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

Предыдущее
От: Bernd Helmle
Дата:
Сообщение: Re: [HACKERS] COPY TO returning empty result with parallel ALTER TABLE
Следующее
От: Alejandro Carrillo
Дата:
Сообщение: Re: Tablespace limit feature