Install PostgreSQL 18.1 / 17.7 / 16.11 on Fedora 43/42 and RHEL/CentOS/Rocky/Alma 10/9/8

This is guide, howto install PostgreSQL 18.1 / 17.7 / 16.11 database server on Fedora 43/42 and RHEL/CentOS/Rocky/Alma 10/9/8. The guide shows how to install PostgreSQL 18.1 / 17.7 / 16.11 from the PostgreSQL Global Development Group (PGDG) repositories and also how to install the distro-provided package where appropriate. Use the detection commands in the installation section to list available majors in your enabled repositories. Check video guide howto install PostgreSQL on Fedora / Rocky (example older recordings):
Read more →

Postgresql (psql) .psqlrc tips and tricks

Psql is a good tool for the PostgreSQL database management and use. Psql client functioning can easily be improved by adding a few lines ~/.psqlrc file. 1. Tuning psqlrc 1.1 Set all null fields to NULL: \pset null 'NULL' After this, the query results look like this: select 'test' as test_text, null as test_null; test_text | test_null -----------+----------- test | NULL (1 row) 1.2 Set the command history file names for each host and database: \set HISTFILE ~/.psql_history- :HOST - :DBNAME After this, the history file naming look like this:
Read more →

Create PostgreSQL Table Partitioning (Part 1)

PostgreSQL supports partitioning via table inheritance. So the partitioning is made in such a way that every child table inherits single parent table. Parent table is empty and it exists just to describe the whole data set. PostgreSQL partitioning can be implemented in range partitioning or list partitioning. Range partitioning can be done for example by ID ranges (like 0-100 000, 100 001-200 000, 200 001-300 000…) or Date ranges (like 2009-11-01 – 2009-11-30, 2009-12-01 – 2009-12-31…). List partitioning can be done for example by list of cities (like New York, Los Angeles, Chicago, Houston, Philadelphia…) or list of categories (like Programming, Home, Food…). It’s important to ensure that there is no overlap between the key values permitted in different partitions.
Read more →

PHP Script to Generate PostgreSQL Table Partitioning (Part 2)

As Part 1 (Howto create PostgreSQL table partitioning) shows, making of PostgreSQL partitioning needs a lot of SQL commands. So this Part 2 explains how SQL commands for PostgreSQL partitioning can be made with a simple PHP script. This example script make SQL for child tables, indexes, trigger function and parent table trigger. This example script can make PostgreSQL table partitioning with using Date ranges. Script can be configured with following configuration section:
Read more →

PostgreSQL: Partitioned Table vs Non Partitioned Table (Part 3)

This article compares the speed and performance of queries between partitioned and non partitioned PostgreSQL tables. However, it is important to remember that the PostgreSQL tables partitioning has also another benefits, than the better performance on queries. More information about other benefits from the first part ‘Howto create PostgreSQL table partitioning (Part 1)‘. This is comparision between partitioned and non partitioned PostgreSQL tables. The same tests were carried out with and without indices, because using the indices, it is no longer very meaningful example on table, which has one billion rows of data (if the table is not partitioned). This comparison is used an example of an existing table, which looks like this:
Read more →

Install PostgreSQL 8.4 Database Server on CentOS, Fedora, Red Hat

This is quick guide howto install PostgreSQL 8.4 (current stable 8.4.7) database server on CentOS, Fedora and Red Hat. Fedora 14, Fedora 13, CentOS 5.5 and Red Hat (RHEL) 5.5 has PostgreSQL 8.4 database server as default so extra repositories is not needed. Personally, I like to use Postgres own repositories, because the latest version of PostgreSQL may be quickly and easily installed. The following commands run as root and postgres user, so “su -” or “sudo -i” first.
Read more →

Support inttf:

Buy Me a Coffee:

Support inttf:

Buy me a coffee Buy me a coffee