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

How to Drop Database Through PSQL in PostgreSQLThis article describes how to drop a database through Psql in PostgreSQL. How to Compare Dates in Datetime Fields in PostgreSQLThis article describes how to compare two DATETIME fields in PostgreSQL. How to Use Variables in PostgreSQLYou might need to use variables in PostgreSQL. You can declare your variables using DECLARE in the PL/SQL. How to Use Loop in PostgreSQLIn PL/SQL, you might need to use the loop in Postgres. We can use the FOR and WHILE statements to create a loop. How to Show Connections in PostgreSQLThis article shows how to list active connections on PostgreSQL. How to Run SQL File in PSQLThis article explains how to run a SQL file direct from terminal/command-line or psql shell. For that, you need to specify the hostname, port, username, and database name. How to Locate Configuration Files in PostgreSQL on UbuntuThis article shows how to locate the configuration files for PostgreSQL database on Ubuntu. How to Left Join Lateral in PostgreSQLThis article is about the left join lateral in PostgreSQL. How to Declare a Variable in a PostgreSQL QueryThis article teaches the reader how to create variables in PostgreSQL and use them to query the database. How to Cast String to Date DD/MM/YYYY in PostgreSQLThis article shows how we can retrieve dates using a desired format in PostgreSQL. How to Round an Average to 2 Decimal Places in PostgreSQLThis article describes how to round an average in PostgreSQL to 2 decimal places. How to Exit From the Command Line Utility in PostgreSQLThis article describes how to exit from the Psql command line utility in PostgreSQL. How to Terminate a PostgreSQL ConnectionThis article describes how to terminate an opened connection in PostgreSQL. How to Save PL/pgSQL Output From PostgreSQL to CSVThis article describes how to save the PL/pgSQL output from PostgreSQL to a CSV file. How to Run PostgreSQL Queries in PSQLThis article describes how to run Queries from the PostgreSQL Command Line Tool. How to Rename a Table Inside a Schema in PostgreSQLThis article describes renaming a table inside a schema in PostgreSQL. How to Create a Pivot Table in PostgreSQLThis article describes how to create a pivot table in PostgreSQL. How to Select Random Rows in PostgreSQLThis article teaches about the different ways we can select random rows in PostgreSQL. How to Comment Characters in PostgreSQLThis article explains us about the process of commenting characters in PostgreSQL. How to Create Role or User if It Does Not Exist in PostgreSQLThis article teaches how to create a PostgreSQL role for the first time. How to Configure PostgreSQL in LinuxThis article teaches how to configure and use PostgreSQL for the first time in Linux. How to Write Case-Insensitive Queries in PostgreSQLThis article teaches how to write case-insensitive queries in PostgreSQL . How to Start PostgreSQL Server on WindowsThis article teaches how to start a PostgreSQL server on Windows. How to PostgreSQL DATE_TRUNC() FunctionUsing the DATE_TRUNC() function you can define the precision of datetime in Postgres.