Difference between revisions of "Postgres:Database Creation"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
# Make sure the user that will be using the database is created ([[Postgres:User Creation|Creating a user]]) | # Make sure the user that will be using the database is created ([[Postgres:User Creation|Creating a user]]) | ||
− | # Either as the " | + | # Either as the "postgres" user, or as the user that will be using the db, run <tt>createdb</tt> |
#* <tt>createdb</tt> can be run with no paramenters, in which case a database is created who's name and owner are that of the current user. | #* <tt>createdb</tt> can be run with no paramenters, in which case a database is created who's name and owner are that of the current user. | ||
#* Syntax is: <tt>createdb <Options> ''dbname'' ''description''</tt> | #* Syntax is: <tt>createdb <Options> ''dbname'' ''description''</tt> |
Revision as of 14:15, 14 November 2016
- Make sure the user that will be using the database is created (Creating a user)
- Either as the "postgres" user, or as the user that will be using the db, run createdb
- createdb can be run with no paramenters, in which case a database is created who's name and owner are that of the current user.
- Syntax is: createdb <Options> dbname description
- Options:
- -D tablespace: Specify default tablespace
- -e: Echos the command that createdb generates
- -E encoding: Specify character encoding to be used
- -O owner: Specify
- -q: Do not desplay a response
- -T template: Specify template database to use
- All this and more can be found by typing man createdb at a prompt.