Editing the structure of your database
Webmin allows you to quickly modify the structure of tables in your PostgreSQL database through an easy-to-use interface. In this recipe, we will demonstrate how to perform the following list of tasks:
Create a table in a database
Add a field to a database table
Create an index
Delete an index
Delete a field
Delete a table from the database
Getting ready
For demonstration purposes, we will be using a database called testdb
. You can create a database with this name through Webmin by following steps described in the recipe, Creating a new database.
How to do it...
In the testdb
database, we'll create a table called people
and add a field called name
to the table. We'll then change the name of the field, add a unique index, and finally delete the index, field, and table from the database.
Perform the following steps to create a table in a database:
Navigate to Servers | PostgreSQL Database Server.
Click the icon that represents the
testdb
database.Click the Create...