DROP COLUMN

Zen - April 23, 2007 - 16:07
Project:Drupal
Version:6.x-dev
Component:postgresql database
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Forking from http://drupal.org/node/109104

  1. According to the notes (~ line 1187) in system.install, postgres supports dropping columns only from 7.4 (which is the minimum requirement for D6, but not for D5 and earlier).
  2. The above, however, does not appear to be true. The provided link also states that additional steps might be required to "finish the job". To quote:

    The DROP COLUMN command does not physically remove the column, but simply makes it invisible to SQL operations. Subsequent inserts and updates of the table will store a NULL for the column. Thus, dropping a column is quick but it will not immediately reduce the on-disk size of your table, as the space occupied by the dropped column is not reclaimed. The space will be reclaimed over time as existing rows are updated. To reclaim the space at once, do a dummy UPDATE of all rows and then vacuum, as in:

    UPDATE table SET col = col;
    VACUUM FULL table;

  3. There are a few places (early) in system.install where equivalent updates for pgSQL are avoided altogether stating point 1.
  4. Testing on pgSQL 8.2.3, both the following syntaxes are supported:
    • ALTER TABLE {boxes} DROP COLUMN title
    • ALTER TABLE {boxes} DROP title

    The latter is what is used almost everywhere in system.install and according to the docs, is the recommended syntax. The keyword COLUMN is also considered to be needless noise. update_1006 uses the former.

A pgSQL-head should probably investigate this issue and establish a degree of consistency throughout system.install.

Thanks,
-K

#1

sammys - September 18, 2007 - 03:58

Hi and thanks for submitting your post. We've updated the requirement for D5 and beyond to 7.4. See http://drupal.org/node/113318 for more details about that.

Regarding system.install poorly mirroring the updates applied to MySQL. Agreed. However, the number of PostgreSQL sites versus the time required to patch system.install was deemed as too low. I'm happy to push through a fix or even test/approve a patch to system.install so we can have those users supported.

--
Sammy Spets
Synerger
http://synerger.com

#2

douggreen - December 16, 2007 - 14:29

With all the talk about postgres support, has anything been done with this, maybe from another issue?

#3

webernet - February 9, 2008 - 02:50
Status:active» fixed

Schema API, a minimum requirement of PGSQL 7.4, and removal of old updates hopefully makes this fixed.

#4

Anonymous (not verified) - February 23, 2008 - 02:51
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.