Hey guys,
I am trying to upgrade from timescale 2.0.2 , PSQL 11 → Timescale 2.13, PSQL 16.
Now what I am currently facing only in 2.13 is the following:
pg_restore: error: COPY failed for table “chunk”: ERROR: null value in column “creation_time” of relation “chunk” violates not-null constraint
DETAIL: Failing row contains (1, 2, _timescaledb_internal, _hyper_2_1_chunk, null, f, 0, f, null).
CONTEXT: COPY chunk, line 1: “1 2 _timescaledb_internal _hyper_2_1_chunk \N f 0 f”
pg_restore: error: COPY failed for table “chunk_constraint”: ERROR: insert or update on table “chunk_constraint” violates foreign key constraint “chunk_constraint_chunk_id_fkey”
DETAIL: Key (chunk_id)=(1) is not present in table “chunk”.
pg_restore: error: COPY failed for table “chunk_index”: ERROR: insert or update on table “chunk_index” violates foreign key constraint “chunk_index_chunk_id_fkey”
DETAIL: Key (chunk_id)=(1) is not present in table “chunk”.
pg_restore: warning: errors ignored on restore: 3
There I was able to jump to any timescale/PSQL version without any issue.
I have tried upgrading to Timescale 2.13 with PSQL 15, still had the same issue.
I saw a topic opened regarding that matter:
However, I didn’t understand what the author meant.
The process I am doing is as follows:
- Restore my data.
- Docker compose down, upgrade my docker-compose file to take the targeted version.
- Move the old volume to old.
- Docker-compose up -d db
- Copy the backup file to the container.
- ALTER DATABASE DB SET timescaledb.restoring=‘on’;
- docker exec with pg_restore
Any help would be great, appreciate it in advance.
Update: This issue appears to be in the _timescaledb_catalog schema