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.

How to Add Days to a Date in PostgreSQL

Postgres allows us to add a certain number of days to a date field using the plus “+” operator. It retrieve a new date representing the original date plus the specified number of days.

PostgreSQL TIMESTAMP Data Types and Functions

PostgreSQL provides two temporal data types to deal with the TIMESTAMPS: TIMESTAMP(without the time zone) and TIMESTAMPTZ(with a time zone).

How to Find the Interval Between Two Dates in PostgreSQL

In PostgreSQL, finding the interval between two dates can be accomplished using the built-in AGE() function or the minus “-” operator.

How to Convert a TIMESTAMP to String in PostgreSQL

PostgreSQL provides a built-in TO_CHAR() function that converts the given timestamp to a string. It utilizes a format mask to convert the input value to a string.

How to Extract DOW in PostgreSQL?

In PostgreSQL, the EXTRACT() and DATE_PART() functions are used to extract a DOW(an acronym for Day of Week) from a date or timestamp.

PostgreSQL TO_CHAR Function With Practical Examples

In Postgres, a built-in function named TO_CHAR() is used to convert any data type, such as an integer, interval, timestamp, date, etc., to a string.

PostgreSQL CURRENT_TIME Function With Practical Examples

The CURRENT_TIME function retrieve the current time and the time zone. It can accept an optional parameter “precision” to set the precision of the retrieved fractional seconds.

CREATE TABLE AS SELECT Statement in PostgreSQL

In Postgres, a new table can be created via the SELECT command; for this, the CREATE TABLE statement is used along with an AS clause followed by a SELECT statement.

PostgreSQL ARRAY_PREPEND() Function

PostgreSQL provides a built-in ARRAY_PREPEND() function that is used to append an element at the start of an array. It accepts two arguments: an element and an array.

PostgreSQL UNION ALL Operator With Examples

In Postgres, the UNION ALL operator combines the result sets of two or more queries into one table, including the duplicate records.