Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SEV
Тема Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions
Дата
Msg-id 219F68D65015D011A8E000006F8590C603FDC19B@sdexcsrv1.f000.d0188.sd.spardat.at
обсуждение исходный текст
Список pgsql-hackers
 
> Yes, that is true.  As long as the storage manager relies on 
> the filesystem for
> table names, this will be a problem, unless filesystem 
> deletions are delayed
> until COMMIT, and filesystem creates are undone at a ROLLBACK.

I like Bruce's idea of altering the filename from tablename_segnr 
to tablename_OID_segnr.
Then a leftover new or old file will not be a problem, since it has a 
guaranteed different name. 
The cleanup of leftover old (or rolled back new files) could then be 
a job that vacuum does.

Vadim needs _oid_ in the filenames for WAL anyway.

This solves create and drop table.

The alter table should imho keep an exclusive lock on the 
pg_class row for that table + exclusive on the usertable
until transaction commit. 
(Thus fails if table access is not exclusive)

Andreas


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

Предыдущее
От: Hiroshi Inoue
Дата:
Сообщение: Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions