Create a PostgreSQL Database: Just modify the database_name to the name you prefer for your new database.
create database database_name
Delete a PostgreSQL Database: Again just modify the database_name to the name of the database you would like to remove from Postgres.
drop database database_nameBelow is output from a shell where a connection is made to Postgres with psql, a database is added, and then the same database is deleted. In the example below the database that is added and removed is called “newdb”.
[root@server ~]# psql -U postgres Welcome to psql 8.3.5, the PostgreSQL int terminal. Type: copyright for distribution terms h for help with SQL commands ? for help with psql commands g or terminate with semicolon to execute query q to quit postgres=# create database newdb; CREATE DATABASE postgres=# drop database newdb; DROP DATABASE postgres=# q [root@server ~]#
biOos
No comments:
Post a Comment