in lxc switch user to postgres, then connect to the db
first connect to the database using psql or sudo -u USER psql
CREATE USER username WITH PASSWORD 'password';
\l -- list all databases
\c DATABASE -- connect to database
\d TABLE -- describe a table "list its contents"
\d+ TABLE -- shows more information
\dn -- lists all database schemas
\du -- lists all users and their roles
\du USER -- retrieve information about specific user
\dt -- list all database tables
\df -- list all functions
\dv -- list all views
\o FILENAME -- save query results
\i FILENAME -- run commands from a file
\q -- quit
CREATE DATABASE db_name;
GRANT ALL ON DATABASE db_name TO username;
pg_indexes -- list all indexes
GRANT ALL ON SCHEMA exampl_schema TO example_user;GRANT ALL PRIVILEGES ON DATABASE example_db TO example_user;GRANT USAGE ON SCHEMA example_schema TO your_user;ALTER DATABASE my_database OWNER TO my_database_user;