How to use ilike in PostgreSQL

ILIKE Case Insensitive in PostgreSQL Percent Sign

In this PostgreSQL tutorial, I will show how to use ILIKE in PostgreSQL. You will learn about using the ILIKE case-insensitive with columns in the table. Also, learn how to use the wildcards like underscore (_) and percent symbol (%) with ILIKE case-insensitive. How to use ilike in PostgreSQL Let’s discuss all possible cases, along … Read more >>

How To Concat In PostgreSQL

Concat in Postgres using Pipe Operator

In this PostgreSQL tutorial, I will show how to use concat in postgresql. Also, you will learn about different functions of PostgreSQL to combine more than one string value into a single value. How To Concat In PostgreSQL The full name of the word “concatenate” is concatenate, which means to add something together. In terms … Read more >>

PostgreSQL Add Primary Key: Existing Table, Composite Key and Drop

PostgreSQL add primary key with ALTER TABLE and the customers_pkey index shown in psql

Your customers table went live without a primary key, and now you want one. The statement is short. The data in the column decides whether it works. Quick answer: the PostgreSQL add primary key command is ALTER TABLE customers ADD PRIMARY KEY (customer_id);. PostgreSQL builds a unique index named customers_pkey and marks the column NOT … Read more >>

PostgreSQL Add Primary Key Autoincrement

PostgreSQL Add Primary Key Autoincrement

As a database architect, I usually get a common requirement to set up auto-incrementing primary keys in Postgresql. In this article, I’ll walk you through various methods to implement auto-incrementing primary keys in PostgreSQL with real-time examples. PostgreSQL Add Primary Key Autoincrement Auto-increment in Postgresql will allow a unique number to be generated automatically when … Read more >>

PostgreSQL WHERE Clause: IN, NOT IN, LIKE, NULL and BETWEEN

PostgreSQL WHERE NOT IN vs NOT EXISTS query run in PostgreSQL 18

Say you need every order over $100 from a US store’s October 2026 sales. The PostgreSQL WHERE clause keeps only rows where the condition is true: I tested this in psql on PostgreSQL 18.6, Windows 64-bit: Sample tables for the WHERE examples Six customers, seven orders. Guest order 106 (NULL customer_id), the NULL coupons and … Read more >>

PostgreSQL Order By Enum

postgresql order by enum

In this article, I’ll explain everything you need to know about ordering by enum values in PostgreSQL, providing real-time examples and best practices I’ve developed while working with some of my prestigious clients. PostgreSQL Order By Enum When you create an enum type in PostgreSQL, it automatically establishes an order based on the sequence in … Read more >>

PostgreSQL Order By JSON Field

PostgreSQL Order By JSON Field

As a database developer, I’ve frequently encountered the challenge of sorting data based on JSON fields. In this tutorial, I’ll explain everything you need to know about ordering by JSON fields in PostgreSQL, complete with practical examples. PostgreSQL Order By JSON Field JSON is a data type in Postgresql used for storing JSON, which is … Read more >>

PostgreSQL ORDER BY: DESC LIMIT 1, Dates, NULLs and Custom Order

PostgreSQL ORDER BY DESC LIMIT 1 query returning the newest order in PostgreSQL 18

If you’ve tried ORDER BY ship_date DESC to find your latest shipment, you’ve probably seen blank dates land on top. PostgreSQL ORDER BY sorts rows by any column or expression; add NULLS LAST and those blanks drop to the bottom. Without ORDER BY, PostgreSQL returns rows in no guaranteed order, so every “top N” or … Read more >>

What is PostgreSQL Good For

What is PostgreSQL Good For

As a senior PostgreSQL developer, I was recently required to clarify to my client why we needed to use PostgreSQL for one of my critical healthcare applications. In this article, I will list all the points about what PostgreSQL is Good For. What is PostgreSQL Good For PostgreSQL is an advanced open-source relational database that … Read more >>