Usage

PostgreSQL view dependencies

We all know that in PostgreSQL we cannot drop an object if there are view dependencies on it:

Continue reading

PostgreSQL function dependencies

When using PostgreSQL functions, you need to be careful not to end up with dangling functions, since the dependency between functions is not well maintained in the PostgreSQL system catalog. The following example shows how you can end up with a dangling function:

Continue reading

Managing Complex Data with JSON

Are you looking at your stale, flat relational database and thinking: “It’s so rigid and lifeless!” Do you need polymorphism? Do you have a NoSQL database that has no obvious shape and is causing you lack-of-relationship nightmares? With JSON in PostgreSQL, you can have your cake and relationships too!

Continue reading

Difference Between GROUP BY and PARTITION BY

The GROUP BY and PARTITION BY clauses are both used in SQL to group data and calculate aggregate values, then what’s the difference between them?

Continue reading

Analyze Nginx access logs with PostgreSQL

PostgreSQL supports the data types json and jsonb, while nginx supports log output in JSON format. We can easily implement the analysis of nginx access logs using PostgreSQL.

Continue reading