Closed bkuhlmann closed 7 months ago
This is a bug: the script is named PGENV_SCRIPT_POSTINITDB
but the system tries to execute it with PGENV_SCRIPT_INITDB
as in https://github.com/theory/pgenv/blob/master/bin/pgenv#L964
@bkuhlmann please use v1.3.5, thanks for reporting.
Thanks! I picked up 1.3.5 and see the changes. The only problem is that it seems like PostgreSQL isn't fully running by the time my setup
script is applied. Here's the output:
Running post-initdb script [/Users/bkuhlmann/.config/pgenv/setup]
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
Would you like me to report this as a different issue?
Uhm... post-initdb scripts are meant to be run after initdb
, at that time PostgreSQL is not supposed to be running.
What you probably want is a post-start script, but you should handle the error on re-creating the same user (or checking before creating it).
@theory should we add a "run-once" post-start script to handle such kind of initialization? Something that is supposed to be run only once as the instance is started for the very first time?
Sure why not?
Why
Hello. :wave: I'm wanting to make use of the
PGENV_SCRIPT_POSTINITDB
environment variable so my custom script will run only once afterinitdb
has finished but I never see the script execute.How
Here's my setup:
The permissions of
setup
are755
but when I use the following:...the
setup
script never gets executed. I assume this is a bug or am I doing something wrong?