Error on changing a primary key in Postgres

[expired user #9074]'s profile image [expired user #9074] posted 9 years ago in General Permalink
Steps:
Go to the Indexes tab of a Postgres table, expand the PRIMARY KEY node, and select a different field from the drop-down list of columns. I attempted to change the pk from the column ad_type to id. It appears the following SQL was generated:
ALTER TABLE "trailers" DROP PRIMARY KEY, ADD PRIMARY KEY ("id");

I think this needs to be:
ALTER TABLE "trailers" DROP CONSTRAINT pk_trailers, ADD CONSTRAINT pk_trailers PRIMARY KEY (id);
where pk_trailers is the name of the primary key constraint being edited.

Please login to leave a reply, or register at first.