Similar posts

Getting Postgres data into a shell sc...
—
I use postgres for a lot of different things. Many times, it’s a full-blown application where I can directly access the database (i.e. python + psycopg2, java + jdbc, etc…). What if you’re using something a bit less formal, like a shell script? psql psql is the native, command-line interface that ships with a postgresql [...]

Is my query stuck? PostgreSQL 9.6
—
One of the most common queries that I keep in my pocket is SELECT pid, datname, usename, now() - query_start AS runtime, waiting, state, query FROM pg_stat_activity WHERE waiting='true'; This gives you a quick look at any queries that are ‘waiting’. Specifically, you will see queries that are explicitly blocked on some other database activity. [...]

PostgreSQL Schema Visualization
—
I spend a lot of time trying to learn what’s already been implemented, as DBA’s, we tend to live in that world. It’s important that you have tools that allow you to quickly get the visual so you can get on with your job. One of the biggest ‘reverse engineering’ tasks that DBA’s have to [...]

Strategic Autovacuum
—
There’s a big mis-conception that autovacuum is evil. Although it’s true that autovacuum can do things unexpectedly, I’ve found that it’s better to tune it up and let it do what it does best. There are always going to be large / busy / special tables that need special attention, and that’s okay. Attached is [...]