Skip to content

{ Tag Archives } postgresql

Execute SQL outside of a transaction in Hibernate

I hit upon a snag today — while PostgreSQL requires that certain maintenance commands (e.g. vacuum analyze) are executed outside of a transactional context, it’s actually quite hard to get at Hibernate’s underlying database connection directly. Each Session object has a connection() method which returns a JDBC connection object, but this actually turns out to [...]

Also tagged ,

Finding out last VACUUM/ANALYZE times in PostgreSQL

When was my database last vacuumed or analyzed? This took me a while to figure out from googling around so I’ll put it here for posterity, short and sweet. select relname, last_vacuum, last_analyze from pg_stat_all_tables where schemaname = 'public' Add the columns last_autovacuum or last_autoanalyze if you use those features. Andrew.

Also tagged