In a MySQL database I can change a table structure with an ALTER
statement but how to do that in PostgreSQL with pgAdmin III? In pgAdmin III every time I drop the table and again run the updated create query of that table. Is is possible to ALTER
the table in the PostgreSQL database using pgAdmin III?
Server -> Database -> Schema -> Table -> Right Click On Table -> Properties...
Step1 :
Step2 :
Step3 :
Last step is Save your changes...
In pgAdmin III you basically have two options to alter a table structure:
In the hierarchy to the left, navigate to the table and use the context menu (right-click with the mouse) to access the properties of the table. In the pop-up dialog you can make the changes. You can also drill down in the hierarchy to the individual columns and make changes to column names, data types, column constraints, etc.
After you connect to the database, you see a SQL button in the top button bar. Clicking that opens up a SQL console and you can type in an ALTER
statement using standard SQL syntax.
Note that pgAdmin III does not refresh the tree hierarchy on the left of the screen after making changes through the SQL console, you have to do that manually. Right click on a node and click "Refresh" to update the information in that node and everything under that node. (So if you made changes to a single table, r-click on the table name, if multiple tables are affected r-click on the schema name, etc.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With