Chris Browne <cbbrowne@acm.org> writes:
> I have a table that has a candidate primary key (e.g. - unique, not
> null) that I wish to actually assert _is_ a primary key.
> Is there a way to do that without too much (mwahahhaha! fiddling with
> pg_class!!!) trickery?
Why don't you just ALTER TABLE ADD PRIMARY KEY and then drop the
existing unique constraint?
You could probably fool with pg_constraint and pg_index to manually
transform the unique constraint into a pkey constraint, but the odds
of messing it up seem to outweigh the possible time savings.
regards, tom lane