Re: Alter definition of a column

From: af300wsm(at)gmail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Alter definition of a column
Date: 2007-01-18 14:27:04
Message-ID: 1169130424.484696.71810@m58g2000cwm.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


ksherlock(at)gmail(dot)com wrote:
> Hello,
>
> The +4 is for the overhead of a varchar field.
>
> Using ALTER TABLE <table> ALTER <field> TYPE VARCHAR(<newsize>) to
> change the size requires scanning the entire table. For large tables,
> this will be much slower than the pg_attribute query. Both will get
> the job done.
>

Thanks. Am I correct in assuming that this scanning of the entire
table is done when I use the 'ALTER TABLE' command and not something I
must do after it's done?

Thanks again for explaining it. I was thinking that the +4 had
something to do with overhead of some sort, but wanted to know for
sure.

Andy

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sjarosz 2007-01-18 14:50:49 Who is Slony Master/Slave + general questions.
Previous Message Ole Laurisch 2007-01-18 13:40:27 Defining data directory while installing [WinXP]