Skip to content

K8SPG-571 public schema access fix #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 2, 2025
Merged

Conversation

nmarukovich
Copy link
Contributor

@nmarukovich nmarukovich commented Jul 1, 2025

K8SPG-571 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
The logs show the following error message: "stderr": "psql::5: ERROR: role "username" does not exist
This occurred in this part of the method:
GRANT ALL PRIVILEGES ON SCHEMA public TO :"username";
The problem is with using :"username" in the SQL. This kind of placeholder works for values, but not for names like roles, or users.
Names (called identifiers) must be written directly in the SQL. Placeholders don’t work for them.
In our case:
GRANT ALL PRIVILEGES ON SCHEMA public TO :"username";
PostgreSQL looks for a role literally named "username", instead of using the actual value. Since that role doesn’t exist, we get an error.

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Instead of using a placeholder like :"username" in the SQL, we insert the actual username directly into the SQL string.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

@nmarukovich nmarukovich requested review from egegunes and laudares July 2, 2025 10:01
@hors hors merged commit 8a4d0b7 into main Jul 2, 2025
17 of 18 checks passed
@hors hors deleted the K8SPG-571_public_schema_access_fix branch July 2, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants