Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 891359FBAB9 for ; Tue, 17 Jul 2007 15:44:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 28676-03 for ; Tue, 17 Jul 2007 15:44:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web56403.mail.re3.yahoo.com (web56403.mail.re3.yahoo.com [216.252.111.82]) by postgresql.org (Postfix) with SMTP id 76AC19FB9A6 for ; Tue, 17 Jul 2007 15:44:06 -0300 (ADT) Received: (qmail 34605 invoked by uid 60001); 17 Jul 2007 18:44:05 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=gn6yH7KhWZGbk6nEoEwDS9SXE7rvKA3hjICahkoS3Alte7MBWFDi1AEiIqOLiFWqI+MUcLe2XwbY1iZdQwCBci3WCUM5vk41owFf2HHyVGT4DUDp7zlfQCom/o/FOCvL0u9MxMfwd/MYCZtWqzz0XX4dBrIITQNmVA9h6+QOYQs=; X-YMail-OSG: HaNYr2QVM1kknGvbXl8n9F6ge0VCKTKXOBhqITnjqvCwaUX5OTAw5CvWHPyaYrl9dg-- Received: from [198.119.134.32] by web56403.mail.re3.yahoo.com via HTTP; Tue, 17 Jul 2007 11:44:05 PDT Date: Tue, 17 Jul 2007 11:44:05 -0700 (PDT) From: Jessica Richard Subject: Can primary key be dropped and added back in? To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-141741686-1184697845=:34466" Content-Transfer-Encoding: 8bit Message-ID: <42645.34466.qm@web56403.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.738 tagged_above=0 required=5 tests=AWL=0.922, BAYES_40=-0.185, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200707/182 X-Sequence-Number: 26163 --0-141741686-1184697845=:34466 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-141741686-1184697845=:34466 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-141741686-1184697845=:34466--