Skip to content
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

Add ability to override default path to postgresql install #225

Open
connorblack opened this issue Sep 6, 2024 · 3 comments
Open

Add ability to override default path to postgresql install #225

connorblack opened this issue Sep 6, 2024 · 3 comments

Comments

@connorblack
Copy link

connorblack commented Sep 6, 2024

Hi - I'm currently unable to use pgx after switching over to a different postgresql image (bitnami) that installs postgres in /opt/bitnami/postgresql instead of /usr/lib/postgresql. It would be great to have a flag you can pass to override the path.

https://github.com/pgxman/pgxman/blob/5f197fcb9deb17d416c3c7def7a42c36a15b4b26/internal/pg/version.go#L26C23-L26C42:

func VersionExists(ctx context.Context, ver pgxman.PGVersion) bool {
	path := fmt.Sprintf("/usr/lib/postgresql/%s/bin/pg_config", ver)
	pgVer, err := pgConfigVersion(ctx, path)
	if err != nil {
		return false
	}

	return pgVer == ver
}
@owenthereal
Copy link
Collaborator

👍 I think this is a good thing to add. cc: @wuputah

@wuputah
Copy link
Contributor

wuputah commented Sep 7, 2024

I dont think this is easily possible in the near futures since pgxman is currently using apt packages, and those packages all have hardcoded paths, because they're also based on Postgres packages that has hardcoded paths, etc.

So I think this feature request is more like "add bitnami support". I don't know anything about bitnami so I can't guess what would be involved to do that, but I would think it's a lot more involved than just this one function for where pg_config is located.

@connorblack
Copy link
Author

@wuputah @owenthereal I think it might be as simple as that. Bitnami is just a collection of container images maintained by the VMWare team that have pretty minimal changes from the upstream images.

This specific image is debian as well, haven't had any issue apt installing pg packages directly in the container: https://hub.docker.com/r/bitnami/postgresql

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

No branches or pull requests

3 participants