ALTER TABLE results in "ERROR: could not open relation with OID 43707388" - Mailing list pgsql-bugs

From Manuel Rigger
Subject ALTER TABLE results in "ERROR: could not open relation with OID 43707388"
Date
Msg-id CA+u7OA4hkFSV_Y=sW_vNcYgKFEoq0WL5GtrBWEHUZnCqSqjhAA@mail.gmail.com
Whole thread Raw
Responses Re: ALTER TABLE results in "ERROR: could not open relation with OID 43707388"  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: ALTER TABLE results in "ERROR: could not open relation with OID 43707388"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15894: postgresql 9.5 will not install
Next
From: "David G. Johnston"
Date:
Subject: Re: ALTER TABLE results in "ERROR: could not open relation with OID 43707388"