Postgres and Open Source Experts

24x7x365 since 1997


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 Install PostgreSQL Database on Ubuntu

To install PostgreSQL on your Ubuntu operating system, run the “sudo apt install postgresql postgresql -contrib” command.

psycopg: PostgreSQL Python Connector

psycopg is a Postgres Python connector that allows Python programs to access Postgres databases. It is used to perform various operations on Postgres database via python.

What Does ILIKE Operator Do in PostgreSQL?

In PostgreSQL, the “ILIKE” operator is used to fetch/query the data based on pattern matching. The ILIKE operator queries the data case-insensitively.

How to Delete/Drop a User in PostgreSQL

In Postgres, the DROP USER statement is used to drop a single user or multiple users simultaneously. Use IF EXISTS option to check the existence of a user.

How to Change the Password of a User in PostgreSQL

Use the ALTER USER or ALTER ROLE statement to change/modify the password of a Postgres user. You can use the VALID UNTIL clause to specify the password’s expiry date and time.

How to Add or Drop Primary Key Constraints in PostgreSQL

Use the ADD CONSTRAINT or DROP CONSTRAINT clause with the ALTER TABLE command to add or drop a primary key constraint from a Postgres table.

How Do I Backup a PostgreSQL Database

Postgres offers a couple of standard tools/utilities, such as pg_dump and pg_dumpall, to back up a single or all databases.

How to Connect To PostgreSQL Database Server Using Python

Install “psycopg2” module, import it into your python program, and use the connect() function of “psycopg2” module to connect to the Postgres database server via python.

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.