Thursday, June 25, 2015

Some Commonly used postgre sql commands



Log in command to access the postgre sql database

psql -U

psql -U postgresadmin postgres


List down all the in schemas in the database

\l

List down all the tables in a schema

\dt

List down all the tables in a schema

\dt

Executing a sql file in a schema

CREATE DATABASE userdb; 
psql -U postgresadmin -f /usr/local/script/userdb/postgresql.sql -d userdb;

No comments:

Post a Comment