Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

fix: Issues when PG username is 'cloudquery' #371

Merged
merged 1 commit into from
Jun 24, 2022
Merged

fix: Issues when PG username is 'cloudquery' #371

merged 1 commit into from
Jun 24, 2022

Conversation

shimonp21
Copy link
Contributor

@shimonp21 shimonp21 commented Jun 24, 2022

Before this fix, cloudquery misbehaved when the PG username was named 'cloudquery'.
It created tables in the 'cloudquery' schema instead of the 'public' schema.
This happened because the search path was '"$user", public', which means it depended on the username.

This fix, upon connection to PG, will change serach_path to 'public' only, i.e. not dependent on username (which is way more predictable).

This won't impact us explicitly accessing the 'cloudquery' schema via 'cloudquery.', which is what we do when we actually need the 'cloudquery' schema.

closes: cloudquery/cloudquery#901.

Summary


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

Before this fix, cloudquery misbehaved when the PG username was named 'cloudquery'.
It created tables in the 'cloudquery' schema instead of the 'public' schema.
This happened because the search path was  '"$user", public', which means it depended on the username.

This fix, upon connection to PG, will change serach_path to 'public' only, i.e. not dependent on username (which is way more predictable).

This won't impact us explicitly accessing the 'cloudquery' schema via 'cloudquery.<table-name>', which is what we do when we actually need the 'cloudquery' schema.
@shimonp21 shimonp21 requested a review from a team as a code owner June 24, 2022 10:20
Copy link
Member

@yevgenypats yevgenypats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just make sure it wont put the cloudquery schema in public.

@shimonp21
Copy link
Contributor Author

Made sure :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify Schema
2 participants