Skip to content

Instantly share code, notes, and snippets.

@JeOam
Last active September 24, 2016 03:57
Show Gist options
  • Save JeOam/b292b568491e5ec968b76b8d7ff67642 to your computer and use it in GitHub Desktop.
Save JeOam/b292b568491e5ec968b76b8d7ff67642 to your computer and use it in GitHub Desktop.
PostgreSQL Note
@JeOam
Copy link
Author

JeOam commented Sep 23, 2016

为当前用户设置密码:

\password [current_user_name]

创建新用户和数据库:

CREATE USER dbuser WITH PASSWORD 'password';
CREATE DATABASE exampledb OWNER dbuser;
GRANT ALL PRIVILEGES ON DATABASE exampledb to dbuser;

@JeOam
Copy link
Author

JeOam commented Sep 24, 2016

Drop Database:

$ dropdb 'database name'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment