-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Problem:
When cloning using the restricted user template (e.g. Joe Bot) and Timescaledb hypertables, the clone fails:
High level logs:
ERROR: failed to create a Database Lab clone: failed to create a new clone: failed to create clone, unexpected status given: FATAL
Explanation from server logs:
FATAL failed to run objects restrict query: pq: operation not supported on chunk tables
The reason is because the restricted script tries to change the owner of all relations to the restricted user, which is not allowed for timescaledb chunks.
How to replicate the error:
- Set up a DB Lab instance with a snapshot that includes TimescaleDB tables. The clone container must also support TimescaleDB (Postgres.AI extended already does)
- Clone the snapshot with restricted mode active, or with a standard install of Joe Bot
Proposed solution:
Edit database-lab-engine/engine/internal/provision/databases/postgres/postgres_mgmt.go
Change and not n.nspname in ('pg_catalog', 'information_schema')
to and not n.nspname in ('pg_catalog', 'information_schema', '_timescaledb_internal')