PostgreSQL healthcheck fails for read-only user after upgrade (pg_temp schema permission error) #245

Closed
opened 2026-04-05 16:16:03 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @AeroDemon666 on 1/12/2026

After upgrading Databasus from v2.18.1 to a newer version, PostgreSQL connection healthcheck fails for a read-only user with the following error:

cannot check SELECT privileges: permission denied for schema pg_temp_N (SQLSTATE 42501)

On v2.18.1 everything worked correctly with the same configuration.

Details

  • Backups (pg_dump) work correctly

  • TEMP privilege is granted and verified

  • CREATE TEMP TABLE works when tested manually

  • Connecting with postgres user works without issues

  • The problem affects only the healthcheck

  • Clean reinstall of Databasus does not help

It looks like the healthcheck queries internal PostgreSQL schemas (pg_temp_*), which are session-specific and not accessible to other users, causing the permission error.

Environment

  • Databasus version: latest (after v2.18.1)

  • PostgreSQL version: 14.x

  • Auth method: read-only backup user

  • Deployment: Docker / docker-compose

Expected behavior

Healthcheck should not fail for a valid read-only PostgreSQL user with proper privileges.

Actual behavior

Healthcheck fails with permission denied for schema pg_temp_N, while backups continue to work.

*Originally created by @AeroDemon666 on 1/12/2026* After upgrading Databasus from v2.18.1 to a newer version, PostgreSQL connection healthcheck fails for a read-only user with the following error: `cannot check SELECT privileges: permission denied for schema pg_temp_N (SQLSTATE 42501)` On v2.18.1 everything worked correctly with the same configuration. **Details** - Backups (pg_dump) work correctly - TEMP privilege is granted and verified - CREATE TEMP TABLE works when tested manually - Connecting with postgres user works without issues - The problem affects only the healthcheck - Clean reinstall of Databasus does not help It looks like the healthcheck queries internal PostgreSQL schemas (`pg_temp_*`), which are session-specific and not accessible to other users, causing the permission error. **Environment** - Databasus version: latest (after v2.18.1) - PostgreSQL version: 14.x - Auth method: read-only backup user - Deployment: Docker / docker-compose **Expected behavior** Healthcheck should not fail for a valid read-only PostgreSQL user with proper privileges. **Actual behavior** Healthcheck fails with` permission denied for schema pg_temp_N`, while backups continue to work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/databasus#245