JuliusBrussee/caveman · error

postgres: inspect resolver schema: %w

Error message

postgres: inspect resolver schema: %w

What it means

Error "postgres: inspect resolver schema: %w" thrown in JuliusBrussee/caveman.

Source

Thrown at shared/platform/postgresconfig/postgresconfig.go:753

			JOIN pg_roles role ON role.rolname=rr.role_name
			CROSS JOIN pg_class c
			JOIN pg_namespace n ON n.oid=c.relnamespace
			JOIN pg_attribute org_col ON org_col.attrelid=c.oid
			  AND org_col.attname='organization_id' AND NOT org_col.attisdropped
			WHERE n.nspname='public' AND c.relkind IN ('r','p')
			  AND has_table_privilege(rr.role_name, c.oid, 'SELECT,INSERT,UPDATE,DELETE')
			  AND NOT EXISTS (
			    SELECT 1 FROM pg_policy policy
			    WHERE policy.polrelid=c.oid
			      AND role.oid=ANY(policy.polroles)
			      AND policy.polqual IS NOT NULL
			      AND policy.polwithcheck IS NOT NULL
			  )
		)
		SELECT coalesce(string_agg(violation, '; ' ORDER BY violation), '') FROM violations
	`).Scan(&violations)
	if err != nil {
		return fmt.Errorf("postgres: inspect resolver schema: %w", err)
	}
	if violations != "" {
		return fmt.Errorf("postgres: resolver isolation incomplete: %s", violations)
	}
	return nil
}

// WithOrg runs fn inside a transaction whose tenant GUC is transaction-local.
// Empty scopes are rejected: tenant work must never degrade to an unscoped
// query when RLS is the hard boundary.
func WithOrg(ctx context.Context, pool *pgxpool.Pool, orgID string, fn func(pgx.Tx) error) error {
	orgID = strings.TrimSpace(orgID)
	if orgID == "" {
		return errors.New("postgres: organization scope is required")
	}
	tx, err := pool.Begin(ctx)
	if err != nil {
		return err

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Fix the resolver schema inspection error and retry.

When it happens

Trigger: Thrown at shared/platform/postgresconfig/postgresconfig.go:753 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/bacb1f4dac1e95f5. Report an issue: GitHub.