Search Postgresql Archives

Is it safe to rename an index through pg_class update?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux