PostgreSQL

PostgreSQL

Resetting the postgres user’s password

For some reason, this is something that even experienced PostgreSQL people don’t know about, which is: What do you do if you’ve forgotten the postgres user’s password, and you have no other superuser available?

The answer is: Bring up PostgreSQL in single-user mode, reset the password, bring it back up in standard mode.

Of course, this requires

A PostgreSQL Response to Uber

The slides from my talk at Percona Live 2017, A PostgreSQL Response to Uber, which I also gave as “Why Uber Was (Mostly) Wrong” at PGDay Nordic 2017, are now available.

“Corruption War Stories” from PGConf US 2017

The slides from my presentation, Corruption War Stories, are now available.

PostgreSQL When It’s Not Your Job

My slides from my PGConf US 2017 tutorial, PostgreSQL When It’s Not Your Job, are available now.

Corruption War Stories at PGDay FOSDEM 2017

The slides for my talk Corruption War Stories are now available.

Estimates “stuck” at 200 rows?

So, what’s weird about this plan, from a query on a partitioned table? (PostgreSQL 9.3, in this case.)

1test=> explain select distinct id from orders where order_timestamp > '2016-05-01';
2 QUERY PLAN
3-----------------------------------------------------------------------------------------------------------------------------------------------
4 HashAggregate (cost=347341.56..347343.56 rows=200 width=10)
5 Group Key: orders.id
6 -> Append (cost=0.00..337096.10 rows=4098183 width=10)
7 ->

The Multi-Column Index of the Mysteries

The one thing that everyone knows about compositive indexes is: If you have an index on (A, B, C), it can’t be used for queries on (B) or (B, C) or (C), just (A), (A, B) or (A, B, C), right? I’ve said that multiple times in talks. It’s clearly true, right?

Well, no, it’s not. It’s one of

A Cheap and Cheerful Replication Check

On a PostgreSQL primary / secondary pair, it’s very important to monitor replication lag. Increasing replication lag is often the first sign of trouble, such as a network issue, the secondary disconnecting for some reason (or for no reason at all, which does happen rarely), disk space issues, etc.

You can find all kinds of complex scripts that do

Securing PostgreSQL at PGConf EU

The slides for my talk, Securing PostgreSQL at PGConf EU 2016 are now available.

Unclogging the VACUUM at PGConf EU

The slides for my presentation Unclogging the VACUUM at PGConf EU in Tallinn, Estonia are now available.