How to Create Database in PostgreSQL

How to Create Database in PostgreSQL

A web application starts with a database owned by its administrator account. That seems convenient until a deployment changes the wrong objects, an application bug has permission to delete tables, and nobody knows whether the latest backup can be restored. Learning how to create database in PostgreSQL involves more than running CREATE DATABASE. Ownership, application … Read more >>

PostgreSQL Unique Constraint

Postgresql unique constraint

A retail startup called me after their support team found two customer accounts with the same email address. Orders, loyalty points, and password resets were split across both records. The developers had checked for duplicates in application code, but two requests arrived at the same moment and both passed the check. The database accepted both … Read more >>

PostgreSQL Like Operator

Multiple Values Substring PostgreSQL Like Operator

In this PostgreSQL tutorial, I will show how to use like operator in PostgreSQL. Additionally, you will learn about the wildcard percent symbol (%), which is used with the LIKE operator in a pattern to match one or multiple values. Additionally, you will learn how to use the wildcard underscore (_) while performing pattern matching. PostgreSQL Like Operator … Read more >>

PostgreSQL group_concat Example

STRING_AGG Function Pipe Separator in Postgresql

In this PostgreSQL tutorial, I will show you PostgreSQL group_concat Examples. I will use the different functions in place of group_concat to get a string of values separated by a separator. PostgreSQL group_concat Example With the Examples, I will show you how to use the STRING_AGG() function and combine the ARRAY_TO_STRING() and ARRAY_AGG() functions to achieve a similar result … Read more >>

How To Set Auto Increment In PostgreSQL

Auto Increment in PostgreSQL using SERIAL

In this PostgreSQL tutorial, I will show you how to define auto-increment in PostgreSQL. Additionally, you will understand the data types (such as SERIAL) used to define auto-increment for the column. How To Set Auto Increment In PostgreSQL When you don’t use the primary key with every table in PostgreSQL, then it is not a … Read more >>

How To Create An Index In PostgreSQL

How to Create Index If Not Exist in PostgreSQL

In this PostgreSQL tutorial, I will show how to create index in PostgreSQL.You will learn about the syntax of creating an index with multiple approaches. How To Create An Index In PostgreSQL While managing data in the database, indexes play a crucial role. The index enables you to locate information in the database quickly. The … Read more >>

MariaDB Vs MySQL Vs PostgreSQL

mariadb vs mysql vs postgresql

Choosing the right database system can significantly impact your application’s performance. Today, I’m diving deep into three of the most popular relational database management systems: MySQL, MariaDB, and PostgreSQL. MariaDB Vs MySQL Vs PostgreSQL Overview of the three Databases Before we dive into the technical comparisons, let’s discuss a foundational understanding of each database system. … Read more >>

PostgreSQL To_Number

How to use PostgreSQL To_Number for Thousand Separator

The TO_NUMBER() Function stands out as a handy tool when working with string representations of numeric values. In this PostgreSQL tutorial, I will teach you how to use the PostgreSQL To_Number function with multiple examples. PostgreSQL To_Number The to_number() function of PostgreSQL converts the given string into a number or numeric value. This function takes … Read more >>

PostgreSQL list users

postgresql list users using sql statement

I’ve found that understanding how to list and manage users is fundamental to maintaining secure and efficient database environments. In this PostgreSQL tutorial, we will learn about listing users in PostgreSQL. PostgreSQL list users In this section, we will explore the use of the PostgreSQL list user command to display all users in a PostgreSQL database … Read more >>

PostgreSQL To_Char Date Format

Using PostgreSQL To_Char to Format Date in Table

In this PostgreSQL tutorial, I will demonstrate how to utilize PostgreSQL’s TO_CHAR format date, enabling you to understand how to use the TO_CHAR() function to format dates in a meaningful way. You will learn practical examples where I will show you how to use TO_CHAR() on a column of type date in the table, and also how to use the TO_CHAR() function with … Read more >>