Thursday, December 18, 2014

Postgresql different syntaxes

As I am currently working on a project involving PostgreSql, I came to learn some very important commands that I use. here's a list of those commands.

Connect to database using 'psql'

psql -h <host name> -p <port number> -U <user name> <database name>

Using passwords with special characters

export PGPASSWORD="<password>"
psql -h <host name> -p <port number> -U <user name> <database name> -w

Using sql files

export PGPASSWORD="<password>"
psql -h <host name> -p <port number> -U <user name> <database name> -w -f <file location>

Listing all DBs from Postgres prompt

\list

Logging into DB

\c <db name>

Generate a dump

pg_dump -h localhost -p 5432 vreze_live -U vrezeyau_user -f ~/Code/vreze_live.sql

Quit

\q

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...