Postgres RDBMS/Working with PostgreSQL
||This page or section is an undeveloped draft or outline.
You can help to develop the work, or you can ask for assistance in the project room.
- 1 Data types
- 2 Constraints
- 3 Managing a database
- 4 Users and Groups
Date and Time types
Network address data types
- Represents a MAC address
- Represents an IP network or host. This includes an optional netmask. For example,
- Represents an IP network, with an optional netmask. For example,
Primary key constraints
Managing a database
Each database is a separate collection of data. The only thing shared between databases is the list of users and groups. Each connection to the server must be to a single database, and cannot read or write data in any other database.
This is different to the way MySQL uses the term "database". A MySQL database is closer to PostgreSQL's concept of a schema.
You can create a new database from the SQL shell, with the command
CREATE DATABASE dbname;
Alternatively, you can create the database from the command line with the createdb script:
$ createdb dbname
createdb takes the same user authentication parameters as psql.