You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PostgreSQL version (output of postgres --version): 12
TimescaleDB version (output of \dx in psql): 1.7.3 -> 2.2.1 upgrade
Installation method: source
Describe the bug
When upgrading timescaledb, I ran into the following error:
db=# alter extension timescaledb update;
ERROR: duplicate key value violates unique constraint "saved_privs_tmpnsp_tmpname_key"
DETAIL: Key (tmpnsp, tmpname)=(_timescaledb_catalog, chunk_constraint_name) already exists.
During the pre-upgrade phase, TSDB saves the pg_init_privs temporarily into a table, with the following SQL.
-- Table for ACL and initprivs of tables.
CREATE TABLE saved_privs(
tmpnsp name,
tmpname name,
tmpacl aclitem[],
tmpini aclitem[],
UNIQUE (tmpnsp, tmpname));
-- We save away both the ACL and the initprivs for all tables and
-- views in the extension (but not for chunks and internal objects) so
-- that we can restore them to the proper state after the update.
INSERT INTO saved_privs
SELECT nspname, relname, relacl, initprivs
FROM pg_class cl JOIN pg_namespace ns ON ns.oid = relnamespace
JOIN pg_init_privs ip ON ip.objoid = cl.oid
WHERE nspname IN ('_timescaledb_catalog', '_timescaledb_config')
OR nspname = '_timescaledb_internal'
AND relname IN ('hypertable_chunk_local_size', 'compressed_chunk_stats',
'bgw_job_stat', 'bgw_policy_chunk_stats');
The UNIQUE constraint of this table was validated. Indeed, when looking into the catalog, I found multiple rows in pg_init_privs for the same (tmpnsp, tmpname).
I "fixed" it manually by removing one row from the pg_init_privs table so that it was unique again, and then I ran the upgrade. But I wonder why the upgrade script does not support multiple rows here. At first, I was going to do dismiss it as some strange one-off, but I've encountered this twice now during an upgrade. I'm not sure under what circumstances this occurs exactly though.
The text was updated successfully, but these errors were encountered:
Relevant system information:
postgres --version
): 12\dx
inpsql
): 1.7.3 -> 2.2.1 upgradeDescribe the bug
When upgrading timescaledb, I ran into the following error:
During the pre-upgrade phase, TSDB saves the pg_init_privs temporarily into a table, with the following SQL.
The UNIQUE constraint of this table was validated. Indeed, when looking into the catalog, I found multiple rows in pg_init_privs for the same
(tmpnsp, tmpname)
.I "fixed" it manually by removing one row from the pg_init_privs table so that it was unique again, and then I ran the upgrade. But I wonder why the upgrade script does not support multiple rows here. At first, I was going to do dismiss it as some strange one-off, but I've encountered this twice now during an upgrade. I'm not sure under what circumstances this occurs exactly though.
The text was updated successfully, but these errors were encountered: