Fed up with long WHERE-clauses?
SQL is a very easy to use language and it is pretty easy to make things work out of the box. In fact, from my point of view simplicity is one of the core advantages of SQL in general. But, what if you want to compare dozens of columns with each other? It is not […]
PostgreSQL shutdown modes
When doing trainings or consulting sessions I have the feeling that most people are not fully aware of PostgreSQL’s shutdown modes. However, knowing about this functionality is pretty important. Without this information sysadmins may cause unintended damage and issues. This can easily be avoided.
Tracking changes in PostgreSQL
Database security is always an essential issue in any database application. Especially when critical data is stored, it might be interesting to know who has changed which data when and how. To track those changes made to tables in PostgreSQL you can write yourself a generic changelog trigger. The easiest way to do that is […]
Making random() deterministic
Basically the idea of a random generator is to generate random data – ideally a lot of random and non-deterministic data. However, sometimes it is necessary to be able to reproduce a random sequence of numbers. Why would anybody want to do that? Well, what if you are running a simulation model? Or what if […]
Security barriers: Cheating on the planner
Inspired by some previous posts on PostgreSQL security barriers I had the idea of abusing PostgreSQL security barriers (http://www.postgresql.org/docs/9.3/static/sql-createview.html) to cheat on the optimizer. I have constructed an example how a security barrier can theoretically be used to speed up things under some very nasty circumstances.
PostgreSQL: Finding Christmas presents
Christmas is approaching fast so I thought I’d give PostgreSQL users some inspiration when it comes to buying their Christmas presents. I assume that I am not the only one who has constant troubles finding the right present for somebody. The trouble is that prices are usually strange numbers. Maybe EUR 49.95 or EUR 49.99. […]