Skip to content

Instantly share code, notes, and snippets.

@crossle
Last active May 14, 2019 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crossle/ba645c467550e0a1af3d280e529b2173 to your computer and use it in GitHub Desktop.
Save crossle/ba645c467550e0a1af3d280e529b2173 to your computer and use it in GitHub Desktop.
Postgresql command
CREATE DATABASE database_name;
CREATE USER my_username WITH PASSWORD 'my_password';
GRANT ALL PRIVILEGES ON DATABASE "database_name" to my_username;
psql -U postgres
ALTER TABLE <tablename> OWNER TO <username>
ALTER DATABASE name OWNER TO new_owner;
sudo su - postgres
psql
# \password postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment