Skip to content

Instantly share code, notes, and snippets.

@oradrs
oradrs / .psqrc.config
Last active June 11, 2021 08:47 — forked from ekhabarov/.psqrc.config
PSQL config
-----------------------------------------
-- psqlrc file to set psql preferences --
-- Author : Prashanth Goriparthi --
-----------------------------------------
-- source : https://opensourcedbms.com/dbms/psqlrc-psql-startup-file-for-postgres/
-- in Linux - ~/.psqlrc
-- in Windows - %AppData%\postgresql\psqlrc.conf
-- C:\Users\[Login id]\AppData\Roaming\postgresql\psqlrc.conf
@oradrs
oradrs / oracle_compare_schemas.sql
Created September 12, 2020 09:02 — forked from tuksik/oracle_compare_schemas.sql
This script will compare two Oracle schemas and generate a report
REM http://www.dbspecialists.com/files/scripts/compare_schemas.sql
REM
REM compare_schemas.sql
REM ===================
REM
REM This script is provided by Database Specialists, Inc.
REM (http://www.dbspecialists.com) for individual use and not for sale.
REM Database Specialists, Inc. does not warrant the script in any way
REM and will not be responsible for any loss arising out of its use.
REM
@oradrs
oradrs / postgres-cheatsheet.md
Last active June 16, 2022 11:51 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)