How to configure unixODBC

You can connect custom-built shell script with any database using unixODBC an implementation of the Open Database Connectivity standard and I will show you how to do this for SQLite and PostgreSQL databases. ...

How to reload PostgreSQL configuration

Today, I will describe how to cause PostgreSQL clusters to reload their configuration files using four simple methods. ...

How to perform PostgreSQL point-in-time recovery

This blog post is an update to the earlier PostgreSQL entries in which I will show you how to use continuous Write Ahead Log archiving to take advantage of the point-in-time recovery. ...

How to perform base PostgreSQL backup using pg_basebackup utility

I have already described a simple way to perform base PostgreSQL backup using file system utilities. Now I want to show you a different approach using pg_basebackup utility. ...

How to perform base PostgreSQL backup using standard file system utilities

Today I want to show you how to perform base PostgreSQL backup using standard file system utilities. It is great example as it briefly describes basics required before moving to more advanced topics. ...

How to perform action after SQL statement

Sometimes I want to monitor and log particular PostgreSQL statements or execute other kinds of external action. I am using the notify mechanism and slightly modified sample application found in the database documentation to achieve this. ...

How to pretty-print disk space used by PostgreSQL databases

I wrote a simple shell script to pretty-print disk space used by PostgreSQL databases while examining database object size functions. You can benefit from this too by inspecting used SQL statements. ...

How to exclude data from certain tables during PostgreSQL backup

I often want to omit data from certain tables during PostgreSQL database backup. Today I will look into this and post my findings for further reference. ...

How to inspect PostgreSQL queries

Sometimes I want to inspect and verify queries made by an application or hunt a bug that involves more complex queries. The essential part of this process requires altering PostgreSQL server configuration to log SQL statements. ...

How to terminate PostgreSQL sessions

Recently, I have encountered an interesting issue, as I could not perform specific database operations due to unwanted and active sessions using the database. Thus, I will briefly note the solution for further reference. ...

How to remotely check PostgreSQL version

Today I will shortly describe how you can remotely check the PostgreSQL version and use it inside shell scripts. This ability comes in handy at times, as it can be used to perform different tasks depending on the returned database version. ...

How to non interactively provide password for the PostgreSQL interactive terminal

There are two ways to non interactively provide a password for the psql command (PostgreSQL interactive terminal). Each method allows you to quickly write shell scripts using terminal-based PostgreSQL utilities as you can provide user credentials from the password file or environment variables. ...