[Gambas-user] BUG: postgresql dropped columns

Benoît Minisini gambas at ...1...
Sat Nov 20 02:30:46 CET 2010


> If a column from a postgresql table is dropped, postgresql does not
> actually remove the column,  from the help files:
> 
> "The DROP COLUMN form does not physically remove the column, but simply
> makes it invisible to SQL operations. Subsequent insert and update
> operations in the table will store a null value 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. (These statements do not apply when dropping the system oid
> column; that is done with an immediate rewrite.)"
> (My emphasis)
> 
> Gambas does not respect this and continually returns a database error on
> subsequent row updates, viz:
> Database level error (-1) Cannot modify record: ERROR:  column
> "........pg.dropped.8........" of relation "track" does not exist
> 
> This is a fundamental error.

The Gambas PostgreSQL driver does not use the "drop column" instruction, so I 
was not aware of this strange feature.

I will see if dropped fields can be ignored.

Regards,

-- 
Benoît Minisini




More information about the User mailing list