feature request - adding columns with default value - Mailing list pgsql-general

From Henrik Steffen
Subject feature request - adding columns with default value
Date
Msg-id 027a01c2fa81$6ce38350$9800a8c0@henrik
Whole thread Raw
Responses Re: feature request - adding columns with default value  (Shridhar Daithankar <shridhar_daithankar@persistent.co.in>)
Re: feature request - adding columns with default value  (Andrew Sullivan <andrew@libertyrms.info>)
Re: feature request - adding columns with default value  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: feature request - adding columns with default value  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: feature request - adding columns with default value  (Dennis Gearon <gearond@cvc.net>)
List pgsql-general
hello,

when doing an "alter table blub add column blah int2"
and then issuing an "alter table blub alter column blah set default 0"
I will always have to manually "update blub set blah=0" to initialize
all existing records.... this is quite annoying while performing this
update on a running database with 100 simultaneous clients accessing
the database and about 443482 rows in the table.

it takes about 10 minutes to perform this update, and for about 6 minutes
all other updates to the table are in status "waiting", this leads to
a very high load and all max_connection setting is reached soon
(on a Dual-Xeon 2.4 GHz machine with 2 GB RAM)

i would suggest to change the "alter table add column" function to
adding a default value while adding the column if this is possible
and if this minimizes "down-time".

thank you

--

Mit freundlichem Gruß

Henrik Steffen
Geschäftsführer

top concepts Internetmarketing GmbH
Am Steinkamp 7 - D-21684 Stade - Germany
--------------------------------------------------------
http://www.topconcepts.com          Tel. +49 4141 991230
mail: steffen@topconcepts.com       Fax. +49 4141 991233
--------------------------------------------------------
24h-Support Hotline:  +49 1908 34697 (EUR 1.86/Min,topc)
--------------------------------------------------------
Ihr SMS-Gateway: JETZT NEU unter: http://sms.city-map.de
System-Partner gesucht: http://www.franchise.city-map.de
--------------------------------------------------------
Handelsregister: AG Stade HRB 5811 - UstId: DE 213645563
--------------------------------------------------------


pgsql-general by date:

Previous
From: Thomas Beutin
Date:
Subject: Re: php - postgreSQL link module
Next
From: Darko Prenosil
Date:
Subject: Re: Converting from dbase