CheatSheet
  • Introduction
  • Garbage Collection
  • Scala
  • Kafka
  • Shell Scripting
  • Notebook
  • Hadoop
  • Git
  • Mac Terminal
  • IntelliJ Idea
  • Garbage Collection
  • YARN
  • NoSQL
  • DBConnection
  • ProjectBuild
  • Microservices
  • WebServices
  • Cloud Services
  • iTerm2
  • SBT
  • Useful Java Libraries
  • Python
  • Postgres
  • UML Class Diagram
  • Groovy
  • Mac Brew Install
  • Maven
  • Rough Works
  • Spark
  • AWS
  • Kubernetes
  • Docker
  • Redis
  • Telnet
Powered by GitBook
On this page

Was this helpful?

Postgres

connect to Postgres SQL shell

(generally you may find in location), /Applications/PostgreSQL 11/SQL Shell (psql).app

\h for help with SQL commands
\? for help with psql commands
\l -> this to list all databases.
\c db -> to connect with database caled db
\d -> to list all tables.
\dn -> list all schema
\dt lists tables for public schema. To show tables of all schemas use \dt *.* 
and for a particular schema use \dt schema_name.*
\q to quit

Copy from csv file to table:

COPY Emp(name, id) FROM '\tmp\test.csv' DELIMITER ',' HEADER ;
PreviousPythonNextUML Class Diagram

Last updated 2 years ago

Was this helpful?