Practical solutions

PostgreSQL Howtos How-To Guides

Solve the problem. Keep building. Collection of PostgreSQL how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

Varchar vs Text in PostgreSQLThis article shows the difference between varchar and text datatypes in PostgreSQL and demonstrates each individually using code examples. How to Unnest in PostgreSQLThis article describes the PostgreSQL unnest and demonstrates its usage. How to Convert Timezone in PostgreSQL ServerThis article demonstrates different functions and statements in PostgreSQL that allow you to change from one timezone to another. How to Install and Start PostgreSQL Server on MacThis article walks mac users through installing and starting the PostgreSQL server on their system. It also analyses common problems that occur while starting it. How to SELECT if String Contains a Substring Match in PostgreSQLThis article explains how to select if a string contains a specific value in PostgreSQL. How to List Tables in PostgreSQLThis article shows the altenative ways or commands that can be used to return a collection of tables in a database using PostgreSQL. How to Insert Into Select in PostgreSQLThis article covers how we can insert data from an entity in a remote database to an entity in a local database using an SQL select statement in PostgreSQL. How to Drop All Tables in PostgreSQLThis article shows how multiple tables in a database can be deleted without removing the database conatining the tables in PostgreSQL. How to Change Column Type in PostgresThis article shows how to change the column type to another data type in Postgres. How to Use Database in PostgreSQLThis article demonstrates connecting to a database, creating a new database, and creating a table in PostgreSQL. How to Connect to PostgreSQL With PasswordThis article shows various methods for connecting PostgreSQL with password. It can be via command-line, pgpass file, PGPASSWORD environment variable or the connection string. How to Use Multiple WITH Statements in One PostgreSQL QueryIn this tutorial, we will learn how to use multiple WITH statements to execute a query using two temporary tables in PostgreSQL. How to Create Table if It Does Not Exist in PostgreSQLThis article discusses how to create a table in PostgreSQL if it does not exist. How to Query Between Date Ranges in PostgreSQLIn Postgres there're different types of ranges. To compare date you can use the daterange types in you're conditions. How to Query Between Date Ranges in PostgreSQLIn this article, learn the different types of ranges in PostgreSQL. To compare the date, you can use the daterange types in your conditions. How to Upsert (Merge, Insert on Duplicate Update) in PostgreSQLThis article describes how to perform an upsert operation in PostgreSQL. How to Upsert (Insert on Duplicate Update, Merge) in PostgreSQL With EXCLUDE ValuesThis article shows ways to use the EXCLUDED table values in upsert in PostgreSQL. How to Concatenate Columns in PostgreSQL Using SelectThis article describes how to concatenate columns in PostgreSQL using Select method. How to Extract Day of Week From Date Field in PostgreSQLThis article explains how to extract the respective day of the week from the date field in PostgreSQL. How to List All Tables in PostgreSQL INFORMATION_SCHEMA TableThis article shows the different ways to list all the tables in PostgreSQL INFORMATION_SCHEMA. How to Insert on Duplicate Update in PostgreSQLThis article explains how to perform an Insert on Duplicate Update in PostgreSQL. How to Use pg_dump to Create a Backup File of the Database in PostgreSQLThis article shows how to backup a PostgreSQL database and provide the different ways we can retrieve the file containing the backup. How to Use NOT IN With Subquery in PostgreSQLThis article describes how to use NOT IN in PostgreSQL. How to Subtract a Day From a Timestamp Date in PostgreSQLThis article describes how to subtract a day from a timestamp date in PostgreSQL.