Postgres and Open Source Experts

24x7x365 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 Use UPDATE RETURNING Clause in PostgreSQL

In PostgreSQL, the UPDATE RETURNING clause not only updates the selected rows but also retrieves the modified rows.

How to Drop a Sequence in PostgreSQL

To remove a Postgres sequence, execute the “DROP SEQUENCE” command followed by the sequence name to be dropped.

How to List Constraints of a Table in PostgreSQL?

In PostgreSQL, the “\d” command and “pg_catalog” schema with the “pg_constraint” and “pg_class” views are used to get the list of table constraints.

How to Select One Row From Each Group in PostgreSQL?

In PostgreSQL, the “SELECT DISTINCT ON” statement is used to select one row per group. The stated command selects and retrieves a random row from each group.

How Do I Use FILTER Clause to Have Multiple Counts in PostgreSQL?

In PostgreSQL, the FILTER clause can be used with the COUNT() function to do multiple counts on a particular table.

How Does the CONCAT_WS() Work in PostgreSQL

The CONCAT_WS() is an inbuilt string function and an extended form of the CONCAT() function which allows the users to put a specific separator between the strings to be concatenated

How to Get the Age in Years in PostgreSQL

In PostgreSQL, the AGE() function must be used with the DATE_PART() or the EXTRACT() function to get the age in years.

How to Get the Year Month and Day From an INTERVAL in PostgreSQL

In PostgreSQL, the DATE_PART() and EXTRACT() functions are used to get a specific date field such as a year, month, etc. from any date, timestamp, or interval.

How to RESET a SEQUENCE in PostgreSQL?

In PostgreSQL, the ALTER SEQUENCE command is used with the RESTART WITH clause to reset the value of a specific sequence.

MySQL’s GROUP_CONCAT() Equivalent in PostgreSQL

In PostgreSQL, the STRING_AGG() function can be utilized as an alternative to the MySQL's GROUP_CONCAT() function.