Tag: administration
Find out the best PostgreSQL database administration tips and tricks right here in CYBERTEC’s administration blog posts – speed up your database and keep customers happy.
Syslog logging with journald in PostgreSQL
Logging to syslog is not a new PostgreSQL feature at all. Still, I find few people using it, so perhaps an introductory tutorial will be helpful. Since today’s Linux distributions normally use journald for logging, I’ll focus on that. Syslog terminology Syslog is the de-facto logging standard on Unix systems. A syslog daemon receives […]
What you should know about PostgreSQL minor upgrades
© Laurenz Albe 2023 The PostgreSQL documentation is rather terse on the subject of minor upgrade. The reason is probably that the procedure is so simple. Still, I find that many people don’t understand this topic well, so I thought I should compile the relevant information in an article. What is a PostgreSQL minor upgrade? […]
kill -9 explained for PostgreSQL
Do you want to kill a database connection? Or maybe you want to use kill -9? On your PostgreSQL database server? Well, there are things you should be aware of before you do that. The question we want to answer in this blog therefore is: How do I kill PostgreSQL processes properly? Killing PostgreSQL processes […]
pg_resetwal: When to reset the WAL in PostgreSQL
pg_resetwal (formerly known as pg_resetxlog) is a command provided by PostgreSQL which allows you to reset the WAL (Write Ahead Log) in case of trouble. It is a means of last resort to get a broken database server to start. However, what happens behind the scenes when this command is called? Is it dangerous? Required? […]
pg_stat_io and PostgreSQL 16 performance
Learn about pg_stat_io‘s debugging power: PostgreSQL 16 blesses users around the world with many features which ensure an even better user experience. One of those features is a system view called pg_stat_io. It offers deep insights into the I/O behavior of your PostgreSQL database server. From PostgreSQL 16 onward, it will make it far easier […]
Why does my pg_wal keep growing?
“Why does my pg_wal keep growing?” That’s a question I keep hearing again and again. It is an urgent question, since the PostgreSQL server will crash if pg_wal runs out of disk space. I decided to answer the question once and for all. What is pg_wal and why is it growing? You can skip […]
Bulk load performance in PostgreSQL
There are several techniques to bulk load data into PostgreSQL. I decided to compare their performance in a simple test case. I’ll add some recommendations for parameter settings to improve the performance even more. An example table to bulk load data The table is simple enough: It is a narrow table (only two columns), […]
View Access Logging – Fix it in PostgreSQL
By Kirk Wolak Continuous Improvement is an important part of reducing technical debt. Over 30 years our active database has collected some technical debt. We wanted to rename all of our views to be consistently named. Besides that, we had a lack of code reviews for what is happening in the database. The latter situation […]
Use HOT, so CLUSTER won’t rot in PostgreSQL
CLUSTER is sometimes the last resort to squeeze performance out of an index scan. Normally, you have to repeat CLUSTER regularly to maintain good performance. In this article, I will show you how you can get away without re-CLUSTERing even in the face of concurrent UPDATEs. Thanks to Steven Hulshof for the idea! Why […]
ERROR: invalid byte sequence – Fix bad encoding in PostgreSQL
(Inscription seen on a T-shirt) It’s annoying to get error messages caused by encoding problems. But it is more annoying not to get error messages and end up with bad data in the database. I’ll show you how to fix bad encoding. Some basic facts about encoding in PostgreSQL Each PostgreSQL database has a server […]
Huge Pages and PostgreSQL
When talking to customers, sometimes I get the question: How should PostgreSQL installations deal with huge pages and large memory allocations? In particular, experienced Oracle DBA’s are interested in the details behind PostgreSQL and Huge Pages on Linux, so I’ll try to explain it in a bit more detail in the following blog post. What […]
PostgreSQL ALTER DEFAULT PRIVILEGES – permissions explained
Many people have heard that ALTER DEFAULT PRIVILEGES makes it easy to allow other users access to tables. But then, many people don’t understand the command in depth, and I hear frequent complaints that ALTER DEFAULT PRIVILEGES does not work as expected. Read on if you want to know better! Default privileges You cannot […]