puppetlabs / puppetlabs/puppetlabs-postgresql
GRANT ON TABLE including schema always fails.
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 232
- Forks
- 610
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 4
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the postgresql::server::table_grant resource and the generated GRANT ON TABLE statement. Reproduce the schema-qualified table case from the issue, then verify that the schema and table are quoted separately and that a failed grant is reported as unsuccessful.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, ruby
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100