Skip to content

Fix #94: Support custom start parameters. #102

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

Closed
wants to merge 2 commits into from

Conversation

jgiles
Copy link
Contributor

@jgiles jgiles commented Feb 22, 2023

Add a StartParameters config taking configuration settings.

These run-time configuration parameters override those set in the default postgres.conf, and are passed to the postgres process via the options flag of pg_ctl.

Add a StartParameters config taking configuration settings.

These run-time configuration parameters override those set in the
default postgres.conf, and are passed to the postgres process via the
options flag of pg_ctl.
@@ -231,7 +231,7 @@ func Test_ErrorWhenCannotStartPostgresProcess(t *testing.T) {

err = database.Start()

assert.EqualError(t, err, fmt.Sprintf(`could not start postgres using %s/bin/pg_ctl start -w -D %s/data -o "-p 5432"`, extractPath, extractPath))
assert.EqualError(t, err, fmt.Sprintf(`could not start postgres using %s/bin/pg_ctl start -w -D %s/data -o -p 5432`, extractPath, extractPath))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

exec.Command actually ensures each of the arguments are passed directly, so we don't need to wrap the whole options string in quotes - in fact, if you do (as I did initially) it causes problems. See https://stackoverflow.com/a/26473771

@fergusstrange
Copy link
Owner

This is a nice little feature. Could you get it rebased and I'll take it for a spin, then hopefully should be able to get it merged.

@JasonLiuZhuoCheng
Copy link

when can this be merged? This is a really helpful feature @fergusstrange

@fergusstrange
Copy link
Owner

when can this be merged? This is a really helpful feature @fergusstrange

Will need this rebased and tests passing from @jgiles first @JasonLiuZhuoCheng.

@JasonLiuZhuoCheng
Copy link

when can this be merged? This is a really helpful feature @fergusstrange

Will need this rebased and tests passing from @jgiles first @JasonLiuZhuoCheng.

I saw the tests are all passing. Is it possible that you can help @jgiles rebase and expedite this process?

@fergusstrange
Copy link
Owner

@JasonLiuZhuoCheng I can't access this branch. If @jgiles hasn't rebased and pushed it up by this weekend I will look at copying the code over myself.

@felipecsl
Copy link

I just tested this on a repo where I was getting lots of test failures due to (FATAL: sorry, too many clients already (SQLSTATE 53300) and it fixed the issue 🎉

@fergusstrange
Copy link
Owner

That's great, thanks @felipecsl.

I'm going to close this and have rebased it manually myself here. Should merge and release soon.

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.

4 participants