Re: switch UNLOGGED to LOGGED

Поиск
Список
Период
Сортировка
От Leonardo Francalanci
Тема Re: switch UNLOGGED to LOGGED
Дата
Msg-id 263033.9223.qm@web29013.mail.ird.yahoo.com
обсуждение исходный текст
Ответ на Re: switch UNLOGGED to LOGGED  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: switch UNLOGGED to LOGGED  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
> Maybe you should change  xl_act_commit to have a separate list of rels to
> drop the init fork for  (instead of mixing those with the list of files to
> drop as a  whole).


I tried to follow your suggestion, thank you very much.

Here's a first attempt at the patch.

I "tested" it with:


create table forei (v integer primary key);
insert into forei select * from generate_series(1,10000);
create unlogged table pun (c integer primary key, constraint
    con foreign key (c) references forei(v));
insert into pun select * from generate_series(1,10000);
alter table pun  set logged;


then shutdown the master with "immediate":

bin/pg_ctl -D data -m immediate stop
bin/pg_ctl -D data start


and "pun" still has data:

select * from pun where c=100;


Question/comments:

1) it's a very-first-stage patch; I would need to know if something is
*very* wrong before cleaning it.
2) there are some things I implemented using a logic like "let's see how it
worked 10 lines above, and I'll do the same". For example, the 2PC stuff
is totally "copied" from the other places, I have no idea if the code makes
sense at all (how can I test it?)
3) Should we have a "cascade" option? I don't know if I have to handle
inherited tables and other dependent objects
4) During the check for dependencies problems, I stop as soon as I find an
error; would it be enough?



Leonardo
Вложения

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

Предыдущее
От: Yves Weißig
Дата:
Сообщение: Re: best way to test new index?
Следующее
От: "Deka, Rajib IN MAA SL"
Дата:
Сообщение: Re: Re: database system identifier differs between the primary and standby