Experts in Postgres and Open Source Infrastructure

24x7, 365 Enterprise services since 1997

Education

Professional Postgres and Open Source support

Command Prompt, Inc., is the oldest Postgres Company in North America and one of the oldest Open Source firms still operating today. We serve our clients with best in class expertise and professionalism. You can read more about support and services here:


You have landed at the largest single source of Postgres education blogs in the world. At Command Prompt, we believe deeply that the education of the community is critical to the continued success of Postgres and related technologies. We hope you find content you are looking for and don't hesitate to Contact us today for all your Postgres and Open Source consulting and support needs.

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.

How to DROP UNIQUE CONSTRAINT in PostgreSQL

UNIQUE constraints can be dropped by running the ALTER TABLE command with the "DROP CONSTRAINT" clause followed by the constraint’s name.

PostgreSQL DIV() Function With Practical Examples

PostgreSQL provides a built-in DIV() function that takes two numeric values as arguments, performs division on them, and retrieves the resultant integer.

PostgreSQL CREATE DATABASE IF NOT EXISTS

Postgres doesn’t support the “IF NOT EXISTS” option for the CREATE DATABASE command. To achieve the functionality of the “IF NOT EXISTS” option, a subquery can be used in Postgres.

How to Comment in PostgreSQL

In Postgres, double hyphen “--” sign is used for single-line comments, while to use multi-line comments, you need to enclose the comments within “/*” and “*/”.

How to Create Arrays in PostgreSQL

To create an array in Postgres, users must specify the column name, then the data type, followed by the square brackets “[]”.