Sunday, September 13, 2009

Important Meta Commands in PostgreSQL

\c database name [username]
  • to connect to a database
\l
  • will return you the list of available databases
\du
  • will return you the list of databases users
\dt
  • will return you the list of tables in connected database
\d table name
  • will returns you the structure of the given table
\e
  • opens the sql query in editor or opens an editor to write query
show port
  • will returns you the port no on which postgres is running

few notations which are supposed to use while parsing these inputs :
  • -d : database name
  • -U : User name
  • -h : Host name
  • -p : Port No.
  • -f : File name (sql)
  • -w : Password

No comments:

Post a Comment

Followers