File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
log INFO Waiting until postgres is listening at $PGHOST ...
8
8
while true ; do
9
- psql --list > /dev/null 2>&1 && break
9
+ # If your postgres connection has minimal permissions, you should
10
+ # have at least an empty PGDATABASE and rights on this
11
+ # databases. The following will then succeed:
12
+ [ -n " $PGDATABASE " ] && echo " SELECT 1;" | psql " $PGDATABASE " > /dev/null 2>&1 && break
13
+
14
+ # if previous check failed (if PGDATABASE is set, but not yet
15
+ # created), you are in a more common scenario where odoo is
16
+ # expected to manage databases, and it should have the permissions
17
+ # to create it and will attempt to do it. In that case, you'll
18
+ # probably also have the permissions to list the databases.
19
+ psql -l > /dev/null 2>&1 && break
10
20
sleep 1
11
21
done
You can’t perform that action at this time.
0 commit comments