Skip to content

GRANT ON TABLE including schema always fails. #1642

@sandynomad

Description

@sandynomad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions