Is it safe to rename an index through pg_class update?

Поиск
Список
Период
Сортировка
От Kouber Saparev
Тема Is it safe to rename an index through pg_class update?
Дата
Msg-id CAN4RuQtkwaP90yUvpP8=nJGoYTk_ni50=8e=jHvwHyetz3=MJA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is it safe to rename an index through pg_class update?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello everybody,

Renaming an index the classical way through "ALTER INDEX xxx RENAME TO yyy" needs an AccessExclusiveLock over the table holding the index (at least on 9.3 it does). Instead, couldn't I simply:

UPDATE pg_class SET relname = 'yyy' WHERE oid = 'xxx'::regclass;

Are there any risks to corrupt the database or to lose concurrent transactions? I tried to make some tests with parallel queries and locks over the table, but I did not discover anything special.

--
Kouber Saparev

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

Предыдущее
От: "sivapostgres@yahoo.com"
Дата:
Сообщение: Re: Need to find the no. of connections for a database
Следующее
От: Iban Rodriguez
Дата:
Сообщение: Re: unexpected behavior with pglogical -- bug?