Experts in Postgres and Open Source Infrastructure

24x7, 365 Enterprise services since 1997

Education

This is the Education section of the Command Prompt Website. Here you will find blogs specifically about how to use Postgres and related technologies.

PostgreSQL ARRAY_APPEND() Function With Examples

Postgres provides an ARRAY_APPEND() function that is used to append/add elements at the end of the array. It accepts two parameters: an array and an element to be appended.

How to Get First Non-Null Value in PostgreSQL

To get the first non-null value in Postgres, an inbuilt function named COALESCE() is used. It accepts the “n” number of arguments and retrieves the first non-null value.

PostgreSQL OFFSET Clause With Practical Examples

In PostgreSQL, the OFFSET clause is used to skip some records before returning the result set of a query. By default, the OFFSET clause skipped the records from the top.

How to Compare Two Tables Using EXCEPT Operator in PostgreSQL

In PostgreSQL, the EXCEPT operator is used to compare multiple tables. It executes two SELECT queries and retrieves only those records that are not available in the second SELECT query.

PostgreSQL NOW() Function With Practical Examples

In Postgres, the NOW() function retrieves the current date and time along with the time zone(based on the database server’s setting).

PostgreSQL LENGTH() Function With Practical Examples

The Postgres LENGTH() function accepts a string as an argument and calculates the total number of characters in that particular string.

How to Get Table Size in PostgreSQL

PostgreSQL provides a pg_relation_size() function to get the size of a particular table. The “pg_size_pretty()” function is used to get the table’s size in a human-readable format like KBs, MBs.

How to Rename Databases in PostgreSQL?

To rename a database in Postgres, specify an ALTER DATABASE command, followed by the database’s old name, and after that, specify the RENAME TO clause followed by the database’s new/modified name.

PostgreSQL CURRENT_DATE Function With Practical Examples

CURRENT_DATE is one of the Postgres built-in date functions that retrieve the current/today’s date. It doesn’t take any argument.

How to Grant All Privileges to Users in PostgreSQL

PostgreSQL offers a GRANT statement that is used to assign privileges to the database objects. In Postgres, you can grant all privileges to a user via the "GRANT ALL" statement.