The PostgreSQL documentation has some information about row locks. But typically, you cannot see them in pg_locks, and not […]
Stored procedures in PostgreSQL: getting started
Learn all about stored procedures in PostgreSQL right here with examples created by a database expert. Includes syntax & tips
LISTEN / NOTIFY: Automatic client notification in PostgreSQL
If 1000's of users constantly poll the database, a lot of load is caused for no benefit. LISTEN / NOTIFY is a better way, find out how.
PostgreSQL: Sequences vs. Invoice numbers
What's the problem with using PostgreSQL database side sequences to create unique invoice numbers to send to clients? Let's find out.
Transaction anomalies with SELECT FOR UPDATE
by
Laurenz Albe |
06.2022© Laurenz Albe 2022 I was recently confronted with a nice example of how adding FOR UPDATE to a query […]
WITH HOLD cursors and transactions in PostgreSQL
by
Laurenz Albe |
10.2021 Both cursors and transactions are basic ingredients for developing a database application. This article describes how cursors and transactions […]
PostgreSQL grouping sets: ROLLUP & CUBE
PostgreSQL offers many OLAP-style workload features. One of those features is called “GROUPING SETS”. Let's deep dive into ROLLUP & CUBE:
Speeding up count(*): Why not use max(id) - min(id)
The usage of max(id) - min(id) to speed up count(*) may seem like a good approach when it comes to speeding up the process, but it can be problematic.
Subtransactions and performance in PostgreSQL
by
Laurenz Albe |
03.2020 (Last updated on 2023-01-24) Recently, while troubleshooting PostgreSQL performance problems, I ran into problems with subtransactions twice. So I […]
Implementing Autonomous Transactions in Postgres
How to use autonomous transactions in PostgreSQL, with examples. Get insights, use them for logging/ auditing/ progress tracking.