Skip to content

Instantly share code, notes, and snippets.

@kkasaei
Last active May 15, 2018 11:01
Show Gist options
  • Save kkasaei/1e154a477f754fcd4d5e141683131834 to your computer and use it in GitHub Desktop.
Save kkasaei/1e154a477f754fcd4d5e141683131834 to your computer and use it in GitHub Desktop.
SHOW TABLE:
Postgres psql needs escaping for capital letters.
Database=# \d+ "TestTable1"
Describe Table:
\d "myTable" describe table
\d+ "myTable"
Switch Database
\c tableName
Create Database:
create database "testdb2" OWNER postgres;
\q + enter -> Exit;
Import Database:
psql -U postgres database < SqlScript.sql'
Creating Roles
CREATE USER node_user WITH SUPERUSER PASSWORD 'node_password';
Checking for Users
SELECT * FROM PG_USER;
Update
UPDATE database SET column($1) WHERE id=($2), [$1 value, $2 value]
Delete
DELTE from databsae where id=
@kkasaei
Copy link
Author

kkasaei commented May 12, 2018

Started a Gist regarding Postgres commands

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