Re: xlogdump fixups and WAL log question.

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: xlogdump fixups and WAL log question.
Дата
Msg-id 20061022155919.GA2138@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: xlogdump fixups and WAL log question.  ("Simon Riggs" <simon@2ndquadrant.com>)
Ответы Re: xlogdump fixups and WAL log question.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Simon Riggs wrote:
> On Sat, 2006-10-21 at 19:24 -0400, Tom Lane wrote:

> > Can you make the patch cover the case of
> > 
> >     begin;
> >     truncate foo;
> >     copy foo from ...
> >     commit;
> > 
> > It might be infeasible to detect this case, but if it's not ...
> 
> I think it is possible to detect this case without making catalog
> entries, so I'll give this a try. Methinks that the truncate *must* be
> the immediately preceding command, otherwise we might have a trigger
> executing to put rows back into the table before we COPY.

Hmm, is it possible to save the "is empty" info somewhere in local
memory, perhaps the relcache (not necessarily propagated), and have
heap_insert turn it off?

That would help when you do things like

begin;
truncate foo, bar;
copy foo from ...
copy bar from ...
commit;

On the other hand, what happens if you do

begin;
truncate foo;
-- another sessioncopy foo from ...

-- original session
copy foo from ...
commit;


How do you detect that the table is no longer empty?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: "Simon Riggs"
Дата:
Сообщение: Re: adminpack and pg_catalog
Следующее
От: Tom Lane
Дата:
Сообщение: Re: xlogdump fixups and WAL log question.