Author: Şahap Aşçı

7 Nov by Şahap Aşçı

PostgreSQL – List the connections from the IP block

One of the useful data types of PostgreSQL is the inet data type. inet is used to define IPv4 and IPv6 addresses. The ip address can also be stored with the subnet if desired. It supports a total of 17 operators, including basic operators “<,>, =” operators. In addition to this, with the help of […]
27 Oct by Şahap Aşçı

PostgreSQL – Split The String With Regex Split

In PostgreSQL we have 2 functions to split a string according to a certain character; regexp_split_to_array and regexp_split_to_table.   regexp_split_to_array : It splits the string according to regular expression and returns its parts in an array. regexp_split_to_table :  It splits the string into pieces according to the regular expression and returns its parts in the rows of a table.   […]
15 Oct by Şahap Aşçı

PostgreSQL – List settings details

One of the features facilitating the management of PostgreSQL is that it hosts its basic document. We can easily learn a brief description of a configuration, what values it can take or who can change it by asking the server. This information applies to the extensions that we add to PostgreSQL from outside. Of course, […]
11 Oct by Şahap Aşçı

PostgreSQL – Insert on conflict(Upsert)

With PostgreSQL, it is very easy to manage the case “update if there is a record, if not, add”. In traditional methods, we first check whether a record with a SELECT statement is in the table, and then run the INSERT or UPDATE statement as the case. In PostgreSQL, we can resolve this situation with […]
7 Oct by Şahap Aşçı

PostgreSQL – List of Table Sizes

As with most database systems, PostgreSQL offers us various system functions to easily calculate the disk size of the objects. We can get the size of a table using these functions. These functions; pg_table_size: The size of a table, excluding indexes. pg_total_relation_size: Total size of a table. pg_relation_size: The size of an object (table index, […]
2 Oct by Şahap Aşçı

PostgreSQL up-time

There are countless ways of understanding how long PostgreSQL has been turned on. In this article we will talk about 3 methods.   1)Using SQL: [crayon-5bf19a4dea78e099548780/]   2)From Service Definitions: Firstly, we look at the status of the service with the following query. [crayon-5bf19a4dea794126274646/]   3) Using PID: First we take the PID of the […]
1 Oct by Şahap Aşçı

How To Install PostgreSQL 9.6 on Debian 8.x (Jessie)

As you know, at the end of September 2016, PostgreSQL version 9.6 was released. In this article you will find the installation steps of PostgreSQL 9.6 on a minimal Debian 8.x (Jessie). In addition, we will create a database with Turkish support. You can configure it to support your own language. Since PostgreSQL supports UTF-8, […]