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

pg_restore TODO - delay PK creation

From: "Iain" <iain(at)mst(dot)co(dot)jp>
To: <pgsql-admin(at)postgresql(dot)org>
Cc: <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: pg_restore TODO - delay PK creation
Date: 2004-11-01 02:22:31
Message-ID: 017501c4bfb9$a70b7f20$7201a8c0@mst1x5r347kymb (view raw, whole thread or download thread mbox)
Lists: pgsql-admin

I'm wondering if this is already on some todo list for pg_restore but I 
didn't find any mention of it anywhere, so I thought I should post this and 
see what people think..

Basically, I'd like to see an option at restore time to not include the 
primary key constraint when issuing the create table command. I'd like the 
PK to be added after data has been loaded using an ALTER command.

The principle reason for this is performance.

There may also be a bug somewhere, or perhaps just a problem with my system, 
but I was trying to restore a fairly large table (over 7000000 rows) which 
would run for a couple hours before failing. Dropping the PK enabled the 
load to complete in 3 or 4 minutes. Adding the PK took another 3 or 4 
minutes which adds up to quite a difference.



pgsql-admin by date

Next:From: Bruce MomjianDate: 2004-11-01 02:36:06
Subject: Re: pg_restore TODO - delay PK creation
Previous:From: John DeSoiDate: 2004-11-01 02:12:17
Subject: Re: psql won't "createdb"

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