pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua D. Drake <jd@commandprompt.com>
To: Jessica Richard <rjessil@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Can primary key be dropped and added back in?
Date: Tue, 17 Jul 2007 11:49:20 -0700
Message-ID: <469D0F30.60002@commandprompt.com> (raw)
In-Reply-To: <42645.34466.qm@web56403.mail.re3.yahoo.com>
References: <42645.34466.qm@web56403.mail.re3.yahoo.com>

Jessica Richard wrote:
> 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)

alter table foo add primary key (baz);

Joshua D. Drake

> 
> 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/;


-- 

       === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
              http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/




view thread (3+ messages)  latest in thread

Message-ID: <469D0F30.60002@commandprompt.com>
Permalink:  ../469D0F30.60002@commandprompt.com/
Also on:    postgresql.org/message-id/469D0F30.60002@commandprompt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jd@commandprompt.com, rjessil@yahoo.com
  Subject: Re: Can primary key be dropped and added back in?
  In-Reply-To: <469D0F30.60002@commandprompt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox