From rjessil@yahoo.com Tue Jul 17 18:44:10 2007 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-- From jd@commandprompt.com Tue Jul 17 18:47:42 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 1AA819FBBA2 for ; Tue, 17 Jul 2007 15:47:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 07834-10 for ; Tue, 17 Jul 2007 15:47:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 9124E9FBA0C for ; Tue, 17 Jul 2007 15:47:38 -0300 (ADT) Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l6HIlbtj006215; Tue, 17 Jul 2007 11:47:38 -0700 Message-ID: <469D0F30.60002@commandprompt.com> Date: Tue, 17 Jul 2007 11:49:20 -0700 From: "Joshua D. Drake" User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: Jessica Richard CC: pgsql-admin@postgresql.org Subject: Re: Can primary key be dropped and added back in? References: <42645.34466.qm@web56403.mail.re3.yahoo.com> In-Reply-To: <42645.34466.qm@web56403.mail.re3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.90.3/3688/Tue Jul 17 01:24:08 2007 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Tue, 17 Jul 2007 11:47:38 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/183 X-Sequence-Number: 26164 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. > -- === 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/ From ineyman@perceptron.com Tue Jul 17 19:20:54 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 0EFAE9FB8C9 for ; Tue, 17 Jul 2007 16:20:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 91626-01 for ; Tue, 17 Jul 2007 16:20:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from EXCHANGE.perceptron.com (exchange.perceptron.com [68.22.13.203]) by postgresql.org (Postfix) with ESMTP id E21B39FB9C5 for ; Tue, 17 Jul 2007 16:20:49 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7C8A7.947BB897" Subject: Re: Can primary key be dropped and added back in? Date: Tue, 17 Jul 2007 15:20:47 -0400 Message-ID: In-Reply-To: <42645.34466.qm@web56403.mail.re3.yahoo.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ADMIN] Can primary key be dropped and added back in? Thread-Index: AcfIpZ2X2trm0TnWRjmgBLbCHmaqHwAAdnSQ References: <42645.34466.qm@web56403.mail.re3.yahoo.com> From: "Igor Neyman" To: "Jessica Richard" , X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.067 tagged_above=0 required=5 tests=AWL=0.065, BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200707/185 X-Sequence-Number: 26166 This is a multi-part message in MIME format. ------_=_NextPart_001_01C7C8A7.947BB897 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable ALTER TABLE tableName ADD CONSTRAINT pkname_pkey (column1, column2, ...); ________________________________ From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Jessica Richard Sent: Tuesday, July 17, 2007 2:44 PM To: pgsql-admin@postgresql.org Subject: [ADMIN] Can primary key be dropped and added back in? I have a huge table to load (30+M rows).=20 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=20 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. =20 ------_=_NextPart_001_01C7C8A7.947BB897 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
ALTER TABLE tableName ADD CONSTRAINT = pkname_pkey (column1,=20 column2, ...);


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

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

Dropping = indexes=20 before loading will speed up my process, but I am not sure about the = primary key=20 that was created with the table creation. Is the Postgres primary key = treated=20 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=20 the command to put the primary key back (all for testing now)

Is = there a=20 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=20 Stories at Yahoo! Games. ------_=_NextPart_001_01C7C8A7.947BB897--