Logo
BEAUTY IN SIMPLE

Digital Garden

A collection of short solutions to daily tech problems, notes, some thoughts and explorations that might convert into a blog post someday. My take on Learn in public concept.

title: "PostgreSQL"

PostgreSQL

  1. Grant all privileges to user
  2. Connect to database by some user

Grant all privileges to user

  1. Connect to psql cli
psql -U <user>

Super user - postgres. You will be prompted to enter a password.

  1. Connect to database
c <database_name>
  1. Grant privileges
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public to <user_name>;
-----------------------------------------------------

Connect to database by some user

c <database_name> <user_name>

You will be prompted to enter a password.