POSTGRESQL database useful commands – PostgreSQL open source and most advanced relational database. It is powerful with long active and good reputation for reliability, feature robustness and performance. If you are interested there is lots of information available to download and found on its official website and documentation.
If you are first time using POSTGRESQL then you need to have some POSTGRESQL database useful commands handy to operate this key-value database. When I first started using POSTGRESQL I could not find any good site which will give me beginner commands which was needed to operate database. So I have created this tutorial to give you those command which you will always needed. I will keep adding more and more tutorial on how to use PostgreSQL in future for now I am keeping this tutorial short to just have important commands and below is details:
POSTGRESQL database useful commandss
- To see all table in sample book database: below is two command go to book db and see all tables:
- POSTGRESQL database useful commands – To see list of schema on PostgreSQL database
- Below will show list of command in PostgreSQL database
- Help for finding all commands which you can view and use
- Create table sample script (Here we are creating sample table conntries)
- Now view newly created table test
- Drop table test
- To see all table in book database
- Insert into table
- Select from table
- If you want to delete anything specific from countries table. Here we are deleting based on country_code
- Try to insert with same primary key you will get exception
- Update table and change values
Trigger, procedure and functions:
- View all trigger
select * from pg_trigger;
- View all trigger with source code:
\df+
in psql gives you the sourcecode.
- View all store procedure
select proname,prosrc from pg_proc;
- View procedure by name and below will show you procedure with source code:
For more information on Postgresql please visit : https://www.postgresql.org/