Re: An easy question about creating a primary key

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: An easy question about creating a primary key
Дата
Msg-id 20011203111257.H93680-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на An easy question about creating a primary key  ("Ligia Pimentel" <lmpimentel@yahoo.com>)
Список pgsql-sql
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"



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Ligia Pimentel"
Дата:
Сообщение: An easy question about creating a primary key
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: persistent connections, AOLserver (Was: maybe Offtopic :