When the locially dropped column is also physically dropped

Поиск
Список
Период
Сортировка
Искать

When the locially dropped column is also physically dropped

От:
"rupesh bajaj" <rupesh.bajaj@gmail.com>
Дата:
Hi,
I have dropped a column (say column name is 'A') from the relation R. By setting the attisdropped as true in the pg_catalog.pg_attribute table. But the column is dropped locially not the physically. Can you please tell me when this column will be physically also dropped. Is this column is automatically physically dropped? or I have to run some command to dropped it physically.

Thanks,
Rupesh Bajaj

Re: When the locially dropped column is also physically dropped

От:
Gregory Stark <stark@enterprisedb.com>
Дата:
"rupesh bajaj"  writes:

> Hi,
> I have dropped a column (say column name is 'A') from the relation R. By
> setting the attisdropped as true in the pg_catalog.pg_attribute table. But
> the column is dropped locially not the physically. Can you please tell me
> when this column will be physically also dropped. Is this column is
> automatically physically dropped? or I have to run some command to dropped
> it physically.

These kinds of questions are best sent to pgsql-general instead of -hackers.

The column won't be dropped physically until you execute one of the commands
that rewrites the table entirely. "CLUSTER" and "ALTER TABLE ALTER column TYPE
type" are the two popular ones.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


Re: When the locially dropped column is also physically dropped

От:
Jim Nasby <decibel@decibel.org>
Дата:
On Apr 27, 2007, at 12:35 PM, Gregory Stark wrote:
>> I have dropped a column (say column name is 'A') from the relation  
>> R. By
>> setting the attisdropped as true in the pg_catalog.pg_attribute  
>> table. But
>> the column is dropped locially not the physically. Can you please  
>> tell me
>> when this column will be physically also dropped. Is this column is
>> automatically physically dropped? or I have to run some command to  
>> dropped
>> it physically.
>
> These kinds of questions are best sent to pgsql-general instead of - 
> hackers.
>
> The column won't be dropped physically until you execute one of the  
> commands
> that rewrites the table entirely. "CLUSTER" and "ALTER TABLE ALTER  
> column TYPE
> type" are the two popular ones.

UPDATE SET field1 = field1; would also work, right?
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



Re: When the locially dropped column is also physically dropped

От:
Heikki Linnakangas <heikki@enterprisedb.com>
Дата:
Jim Nasby wrote:
> On Apr 27, 2007, at 12:35 PM, Gregory Stark wrote:
>> The column won't be dropped physically until you execute one of the 
>> commands
>> that rewrites the table entirely. "CLUSTER" and "ALTER TABLE ALTER 
>> column TYPE
>> type" are the two popular ones.
> 
> UPDATE SET field1 = field1; would also work, right?

Well, yes, except that it will bloat the table. If you wanted to 
physically drop the column to save space, you're not going to be happy 
with that.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com

FAQ