Postgresql does not physically drop columns when
executing an "ALTER TABLE DROP COLUMN ... ", it just
makes them invisible by renaming them to something like
"........pg.dropped.1........".
Unfortunately, theese columns still appear in the
Webmin interface.
As a consequence, this prevents you from inserting more
rows via Webmin, as the field count does not match any
more.
To reproduce:
CREATE TABLE test( t1 varchar(10), t2 varchar(10));
ALTER TABLE test DROP COLUMN t2;
- Have a look at the table in Webmin.
- Try to insert a new row via Webmin.
Surprisingly, this does not happen when using Webmin to
drop the column.
nico (dot) erichsen (at) hsh-berlin (dot) de
Logged In: NO
On a second look, it is not surprising that this bug does
not occur when dropping columns via Webmin.
The Webmin module does not use the DROP COLUMN statement. It
copies the entire table content to a temporary table, then
drops the original table and recreates it without the
dropped column.
As a side effect, the table owner is changed to whatever
database user account the Webmin module is using, normally
postgres.
nico (dot) erichsen (at) hsh-berlin (dot) de
Logged In: YES
user_id=129364
I just tried this with Webmin 1.159 and PostgreSQL 7.3.3,
and it seemed to work fine. Which PostgreSQL version are you
running?