Describe the bug
DROP INDEX fails in pg-mem after a column rename, even though the same SQL succeeds on PostgreSQL.
Specifically:
- Create an index on
old_col
- Rename
old_col to new_col
- Drop the old index by name
Step 3 fails:
DROP INDEX IF EXISTS demo_some_id_old_col_unique
Error: Column "old_col" not found
To Reproduce
CREATE TABLE demo (
some_id text NOT NULL,
old_col text NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS demo_some_id_old_col_unique
ON demo USING btree (some_id, old_col);
ALTER TABLE demo RENAME COLUMN old_col TO new_col;
DROP INDEX IF EXISTS demo_some_id_old_col_unique;
This succeeds on a real PostgreSQL database, but fails in pg-mem.
pg-mem version
Installed version from local node_modules: "3.0.12"