36.6. Deleting a Field

Unlike MySQL, the PostgreSQL database server has no built-in SQL command for deleting a field from a table. It is possible, however, to carry out the removal of a field by creating a new temporary table that lacks the field, deleting the old table, and renaming the temporary table back to the original name. This works, and Webmin can do it all for you automatically; however, some information such as indexes and default field values will be lost in the process. The actual data in the table (apart from that in the deleted field), however, will be safe.

If your table does not contain any indexes or fields with default values, you can go ahead and remove a field by following these steps:

1.
Click on the icon for the database ...

Get Managing Linux® Systems with Webmin™ System Administration and Module Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.