Re: Can primary key be dropped and added back in?

From: "Igor Neyman" <ineyman(at)perceptron(dot)com>
To: "Jessica Richard" <rjessil(at)yahoo(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Can primary key be dropped and added back in?
Date: 2007-07-17 19:20:47
Message-ID: F4C27E77F7A33E4CA98C19A9DC6722A202131DC3@EXCHANGE.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

ALTER TABLE tableName ADD CONSTRAINT pkname_pkey (column1, column2,
...);

________________________________

From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Jessica Richard
Sent: Tuesday, July 17, 2007 2:44 PM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] Can primary key be dropped and added back in?

I have a huge table to load (30+M rows).

Dropping indexes before loading will speed up my process, but I am not
sure about the primary key that was created with the table creation. Is
the Postgres primary key treated like an index? If yes, dropping the
primary key might help my loading as well.... I can drop the primary key
by

alter table tbleName drop constraint pkname_pkey.. it dropped clean this
way.

But I haven't found the command to put the primary key back (all for
testing now)

Is there a command to add the primary key back after loading the data?

Thanks

________________________________

Moody friends. Drama queens. Your life? Nope! - their life, your story.
Play Sims Stories at Yahoo! Games.
<http://us.rd.yahoo.com/evt=48224/*http://sims.yahoo.com/>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Andrew Sullivan 2007-07-17 19:21:56 Re: cache problem (v2)
Previous Message Joshua D. Drake 2007-07-17 18:49:20 Re: Can primary key be dropped and added back in?