Hi everyone,
The test case below unexpectedly results in "ERROR: could not open
relation with OID 43707388" (or some other number).
CREATE TABLE t0(c0 INT);
CREATE UNIQUE INDEX i0 ON t0(c0);
ALTER TABLE t0 ADD PRIMARY KEY USING INDEX i0, ALTER c0 TYPE BIGINT;
-- unexpected: ERROR: could not open relation with OID 43707388
I would expect that the statements are equivalent to the following,
where the ALTER TABLE actions were split up, and which execute without
errors:
CREATE TABLE t0(c0 INT);
CREATE UNIQUE INDEX i0 ON t0(c0);
ALTER TABLE t0 ADD PRIMARY KEY USING INDEX i0;
ALTER TABLE t0 ALTER c0 TYPE BIGINT; -- no error
I'm using the following Postgres version: psql (11.4 (Ubuntu
11.4-1.pgdg19.04+1)).
Best,
Manuel