On Thu, 29 Nov 2001, Ligia Pimentel wrote:
> Hello.
>
> I'm using postgres 7.1. I have an easy question...
>
> I want to create a primary key constraint on an existing table. The
> documentation says I can't . Please confirm. If this is true... How can I
> rename the existing table so I can create the new one and copy the data?
I believe that's correct for 7.1 at least. You can rename tables using
ALTER TABLE (alter table <table> rename to <newtable>). If the column(s)
are marked not null already, you may be able to just get away with
creating a unique index on the column(s) named "<table>_pkey"