Skip site navigation (1) Skip section navigation (2)

Can primary key be dropped and added back in?

From: Jessica Richard <rjessil(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Can primary key be dropped and added back in?
Date: 2007-07-17 18:44:05
Message-ID: 42645.34466.qm@web56403.mail.re3.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-admin
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. 

Responses

pgsql-admin by date

Next:From: De Leeuw GuyDate: 2007-07-17 18:45:13
Subject: Re: cache problem (v2)
Previous:From: Paul SilveiraDate: 2007-07-17 18:16:24
Subject: Re: Several postgres installation on windows possible?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group