This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing few important and basic commands for Database Administrator of PostgreSQL and PSQL Console.
Below are the important PSQL command:
# \l : to list all databases
# \? : to list help for all commands
# \h create table : show help with topics
# \d : to list all tables
# \df : to list all functions
# \da : to list all aggregate functions
# \dn : to list all schemas
# \du : to list all users
# \r : to reset the query buffer
# \db : to list all table space
To show current data directory.
1 |
SHOW data_directory; |
To change current data directory and it requires a server restart.
1 |
SET data_directory TO NewPath; |
To show current server configuration setting.
1 |
SHOW ALL; |
1 |
SELECT name, setting, unit, context FROM pg_settings; |