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.

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 “[]”.

PostgreSQL UPPER() Function With Practical Examples

Postgres' UPPER() function accepts a string as an argument and converts the string’s case to upper. It can accept any character string, such as CHAR, TEXT, and VARCHAR.

PostgreSQL LOWER() Function With Practical Examples

PostgreSQL provides a built-in string function named LOWER() that accepts a string as an argument and converts it into lowercase.

How to Use FLOOR() Function in PostgreSQL

In PostgreSQL, the FLOOR() function is one of the math functions that accept a numeric value or expression and round down the given number to the nearest integer/whole number.

How to Use TRIM() Function in PostgreSQL

TRIM() is an inbuilt function in Postgres that accepts a string and deletes the leading, trailing, or both leading and trailing spaces or characters from a string.

How to Use MD5 Function in PostgreSQL

PostgreSQL provides a built-in function named MD5 that accepts a string as an argument and converts it into a 32 characters text string. It retrieves the resultant value in the hexadecimal.