Psql: Difference between revisions

From annawiki
No edit summary
No edit summary
Line 25: Line 25:
But http://www.postgresql.org/docs/9.3/static/sql-createdatabase.html says
But http://www.postgresql.org/docs/9.3/static/sql-createdatabase.html says
  "To create a database, you must be a superuser or have the special CREATEDB privilege."
  "To create a database, you must be a superuser or have the special CREATEDB privilege."
Where to find "privilege"-listing?
Where to find "privilege"-listing?  
* Not listed at http://www.postgresql.org/docs/9.3/static/index.html
* http://www.postgresql.org/search/?u=%2Fdocs%2F9.3%2F&q=privilege - the search result listing comes with little texts, the first contains " See Section 5.6 for more information about privileges."
* Clicking that result leads to http://www.postgresql.org/docs/9.3/static/functions-info.html, the first result for in-page search repeats the above sentence, with hyperlink to the http://www.postgresql.org/docs/9.3/static/ddl-priv.html

Revision as of 2013-11-21T10:46:57

Create database

tobiasco@main:/root$ psql CREATE DATABASE test2;
psql: warning: extra command-line argument "test2" ignored
psql: FATAL:  Peer authentication failed for user "DATABASE"

Create table

tobiasco@main:/root$ psql test
psql (9.3.1)
Type "help" for help.
 
test=> CREATE TABLE testtable
test-> \dt test
No matching relations found.
test->

List roles

test-> \dg
                             List of roles
 Role name |                   Attributes                   | Member of
-----------+------------------------------------------------+-----------
 gis       |                                                | {}
 postgres  | Superuser, Create role, Create DB, Replication | {}
 tobiasco  | Create DB                                      | {}

But http://www.postgresql.org/docs/9.3/static/sql-createdatabase.html says

"To create a database, you must be a superuser or have the special CREATEDB privilege."

Where to find "privilege"-listing?