Re: [GENERAL] alter table is taking a long time

2009-11-09 Thread Johan Nel
Hi Sam, Typo in my haste on initial mail. attlen should actually be atttypmod. > > update pg_attribute set attlen = 4 + > > where attname = 'yourcolumnname' update pg_attribute set ATTTYPMOD = 4 + where attname = 'yourcolumnname' and > It will also update *every* column with that name.  Some

Re: [GENERAL] alter table is taking a long time

2009-11-07 Thread Sam Mason
On Sat, Nov 07, 2009 at 10:48:14AM +0200, Johan Nel wrote: > update pg_attribute set attlen = 4 + > where attname = 'yourcolumnname' > > That will take only a couple of milliseconds to do. It will also update *every* column with that name. Something involving the "attrelid" would be much safer.

Re: [GENERAL] alter table is taking a long time

2009-11-07 Thread stanciuthe...@gmail.com
is just a varchar field that i want to make it bigge ,right now the alter table is working for over 6 hours On 7 nov., 08:41, michael.har...@ericsson.com ("Michael Harris") wrote: > Hi, > > I recently had to do something similar: change one column from INT to BIGINT > in a table which has inherit

Re: [GENERAL] alter table is taking a long time

2009-11-07 Thread stanciuthe...@gmail.com
On 7 nov., 08:41, michael.har...@ericsson.com ("Michael Harris") wrote: > Hi, > > I recently had to do something similar: change one column from INT to BIGINT > in a table which has inherited to a depth of 3 and where some of the child > tables had millions of records. > > All affected tables hav

Re: [GENERAL] alter table is taking a long time

2009-11-07 Thread Johan Nel
Hi, stanciuthe...@gmail.com wrote: is just a varchar field that i want to make it bigge ,right now the alter table is working for over 6 hours You can try to update the pg_attribute table directly. Just first do some select statements to ensure you only update what you really want to. Also

Re: [GENERAL] alter table is taking a long time

2009-11-06 Thread Michael Harris
Hi, I recently had to do something similar: change one column from INT to BIGINT in a table which has inherited to a depth of 3 and where some of the child tables had millions of records. All affected tables have to be rewritten for such a command. One consequence of this is that you (temporar