Re: Establishing a primary key

Поиск
Список
Период
Сортировка
От Charles Simard
Тема Re: Establishing a primary key
Дата
Msg-id E6AE5AD88D55B543A0A97FF0B93AA9E93C3060@TRADE200.DENARIUS.CA
обсуждение исходный текст
Ответ на Establishing a primary key  (Bob Pawley <rjpawley@shaw.ca>)
Список pgsql-general
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Bob Pawley
> Sent: 22 juin 2007 14:15
> To: Postgresql
> Subject: [GENERAL] Establishing a primary key
>
>
> I have numerous entries in a column of table 1, some of which are
duplicated.
>
> I need to transfer this information to table 2 so that I have column that
can be used as a primery key.
>
> Any help is appreciated.
>
> Bob Pawley

Something like:

Table1{
    col1 text,
    col2 text
}

Table2{
    idtable2 serial,
    col1     text,
    col2     text,
    primary key (idtable2)
}

INSERT INTO Table2 (col1, col2) SELECT col1, col2 FROM Table1;


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Establishing a primary key
Следующее
От: jef peeraer
Дата:
Сообщение: permission denied for schema