I'm trying to alter table's primary key, but it fails even the primary key constraint was dropped before.
Table user already has a primary key
🐜 This seems to be an execution error, which means that your request syntax seems okay,
but the resulting statement cannot be executed → Probably not a pg-mem error.
*️⃣ Reconsituted failed SQL statement: ALTER TABLE "user" DROP CONSTRAINT user_pkey, ADD primary key(name)
👉 You can file an issue at https://github.com/oguimbal/pg-mem along with a way to reproduce this error (if you can), and the stacktrace:
CREATE TABLE "user" ("id" SERIAL NOT NULL, "name" text NOT NULL, CONSTRAINT "user_pkey" PRIMARY KEY ("id"));
ALTER TABLE "user" DROP CONSTRAINT "user_pkey", ADD PRIMARY KEY(name); # <= Error on this line
Describe the bug
I'm trying to alter table's primary key, but it fails even the primary key constraint was dropped before.
To Reproduce
Reproducible with pg-mem playground: https://oguimbal.github.io/pg-mem-playground/
pg-mem version
2.6.3