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 containing the table on the module's main page, and then on the table icon itself.

2.
Click on the Drop Field button on the table editing form, below the list of existing fields. This brings you to a page listing all the fields in table, each of which has a radio button next to it under Drop This One.

3.
Select the radio button field that you want to remove from the table.

4.
Check the Select box to confirm… checkbox at the bottom of the form.

5.
Hit the Drop Field button to remove the chosen field. Once it has been deleted, the same page will be redisplayed so that you can remove another if you wish.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.90.246