Skip to content

Instantly share code, notes, and snippets.

@kixorz
Last active December 15, 2015 19:29
Show Gist options
  • Select an option

  • Save kixorz/5311705 to your computer and use it in GitHub Desktop.

Select an option

Save kixorz/5311705 to your computer and use it in GitHub Desktop.
Create user and db on PostgreSQL
CREATE USER <user> WITH PASSWORD '<password>';
CREATE DATABASE <db>;
CREATE SCHEMA <schema>;
GRANT ALL PRIVILEGES ON DATABASE <db> TO <user>;
GRANT ALL PRIVILEGES ON SCHEMA <schema> TO <user>;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA <schema> TO <user>;
#clone db command
createdb -O <owner> -T <db> <new db>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment