Leo Hsu and Regina Obe: Caching data with materialized views and statement...
One exciting new feature coming in PostgreSQL 9.3 is materialized views. Materialized views is really a mechanism for caching data of a query. It is especially useful if you have long running queries...
View ArticleJoe Van Dyk: Use UUIDs as Keys
If data integrity is critical for your systems, you should be using UUIDs for keys. True, they take up a bit more space in storage and memory and aren’t quite as fast. But since UUIDs are by definition...
View ArticleLeo Hsu and Regina Obe: Materialized geometry_columns using Event Triggers
One of the big changes in PostGIS 2.0 was that the geometry_columns table became a read only view. This change was not without sacrifice. On the plus it meant a table no longer needed to be maintained...
View ArticleHans-Juergen Schoenig: Common mistakes: UNION vs. UNION ALL
In my role as a PostgreSQL consultant and trainer there are a couple of issues, which pop up on a regular basis. One of those issues has to do with set operations. Many people seem to misunderstand the...
View ArticleDavid Fetter: Querying Rows in Statement Triggers
Until very weird xylophones yell Z! Which they're doing now. Back in the bad old days, triggers could see rows or act on a per-statement basis, but not both at once. With this system, they can do...
View ArticleJoe Abbate: Is This Relational?
This post was prompted by Hans-Juergen Schoenig’s Common mistakes: UNION vs. UNION ALL because it touches on one of my pet peeves: the claim that some feature of SQL exemplifies or conforms to the...
View ArticleSelena Deckelmann: Catalog SQL Friday: using DO when we’ve got tables as...
Just a quick note about modifying constraints:There’s no such thing as ALTER CONSTRAINT. So, if you want to safely change a CHECK constraint, like on a partition, you need to DROP and ADD it in a...
View ArticleFabien Coelho: Turing Machine in SQL (1)
PostgreSQL implementation of SQL is Turing Complete, as show by Andrew Gierth on PostgreSQL wiki, where a Cyclic Tag System (CTS), which is proven Turing-complete, is implemented using WITH RECURSIVE,...
View ArticleLeo Hsu and Regina Obe: PostGIS 2.1.0 released
The 2.1.0 release of PostGIS is now available.The PostGIS development team is proud to release PostGIS 2.1.0. As befits a minor release, the focus is on speed improvements, more features, and bug...
View ArticleLeo Hsu and Regina Obe: Raster Words using PostGIS 2.1
Two of the big changes in PostGIS 2.1 raster are the improved speed and functionality of the raster ST_Union function and ST_Clip. Aside from speed, the big thing with ST_Union in 2.1 is that it...
View ArticleJosh Williams: The Un-unaccentable Character
I typed "Unicode" into an online translator, and it responded saying it had no idea what the language was but it roughly translates to "Surprise!"Recently a client sent over a problem getting some of...
View ArticleChris Travers: In defence of hand coded SQL
One common comment I get when I point out I hand-write all my SQL queries rather than relying on an ORM or the like is that this is drudge work, obsoleted by modern tools, and when I mention these are...
View ArticleBruce Momjian: Postgres 9.3 Release Notes Updated
I have updated the Postgres 9.3 release notes to include current commits. I have also added the list of major 9.3 features.
View ArticleMichael Paquier: Tuning disks and Linux for Postgres
Tuning the OS on which is running a database server is important to get good performance for an application. There are many tricks to know when tuning a system, being generally dependent on the...
View ArticleFabien Coelho: Turing Machine in SQL (2)
In a previous post I presented how to implement a Turing Machine (TM) with an ARRAY to store the tape contents. This solution is not really relational, so in this post I’ll show how to build a TM with...
View ArticleHans-Juergen Schoenig: Detecting table bloat
If your PostgreSQL database is purely maintained (lack of VACUUM) or badly structured, you might face some table bloat. Table bloat is somewhat nasty because it slows down your database and eats up...
View ArticleDimitri Fontaine: Understanding Window Functions
There was SQL before window functions and SQL after window functions: that's how powerful this tool is. Being that of a deal breaker unfortunately means that it can be quite hard to grasp the feature....
View ArticleFabien Coelho: Turing Machine in SQL (3)
In previous posts (12), I have presented how to implement a Turing Machine (TM) with the tape stored as an ARRAY or in a separate TABLE accessed through SQL functions. In this post the solution is more...
View ArticleJosh Williams: Log Jam: Be careful with local syslog
Elephant by Shaun TarltonAll they really wanted to do is log any query that takes over 10 seconds. Most of their queries are very simple and fast, but the application generates a few complicated...
View ArticleLeo Hsu and Regina Obe: CREATE SCHEMA IF NOT EXISTS in 9.3 and tiger geocoder
One of the new features in PostgreSQL 9.3 is CREATE SCHEMA IF NOT EXISTS someschema;. We were so excited about this new feature that we started using it in the tiger geocoder loader routine. For some...
View Article