puppetlabs-postgresql icon indicating copy to clipboard operation
puppetlabs-postgresql copied to clipboard

GRANT ON TABLE including schema always fails.

Open sandynomad opened this issue 7 months ago • 0 comments

Describe the Bug

postgresql::server::table_grant { 'grant test': privilege => 'ALL', table => 'my_schema.my_table', db => 'my_database', role => 'my_role' }

generates:

# GRANT ALL ON TABLE "my_schema.my_table" TO "my_role";
ERROR:  relation "my_schema.my_table" does not exist

the issue being that when including a schema the schema with table cannot be enclosed in double quotes.

The grant is not reported as unsuccessful - that is puppet runs without error even though the grant failed.

# GRANT ALL ON TABLE my_schema.my_table TO "my_role";
GRANT

Expected Behavior

The capabilities are granted to the user.

Steps to Reproduce

create a schema create a table grant access to a role of the schema.table

Environment

Rocky 9 Puppet Server 8.7.0 Postgresql module 10.5.0

Additional Context

None.

sandynomad avatar Jul 07 '25 13:07 sandynomad