A few PostgreSQL tricks