Re: Establishing a primary key - Mailing list pgsql-general

From Charles Simard
Subject Re: Establishing a primary key
Date
Msg-id E6AE5AD88D55B543A0A97FF0B93AA9E93C3060@TRADE200.DENARIUS.CA
Whole thread Raw
In response to Establishing a primary key  (Bob Pawley <rjpawley@shaw.ca>)
List 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 by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Establishing a primary key
Next
From: jef peeraer
Date:
Subject: permission denied for schema