-
Bug
-
Resolution: Fixed
-
Minor
-
2.5.5, 2.6, 2.7
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
-
MOODLE_25_STABLE, MOODLE_26_STABLE
-
W14_
MDL-44862_m27_pgsocket -
It seems that current connection in the postgresql driver is unable to handle both dbsocket and dbport at the same time.
And this is needed if you run a postgres instance, accepting socket connections in an non-standard port, because the socket file is named, always:
dbsocket/.s.PGSQL.dbport
So it works perfectly if using the standard 5432 port, because php find the file, but not if the port is different, because we don't pass the " port=5433" to the connection when using dbsockets.
I discovered this while creating different postgresql instances to run by CI servers. There I performed multiple "initdb" executions, every one using a different port 5432, 5433... and in every case, the socket became named as specified above.
I know that I could be using -h 127.0.0.1 -p 5433, but in this case I prefer to keep any "host" connection rejected and only enable sockets.
I think this is easy to fix and will allow those non-standard port sites using sockets to work without a problem, straight from config.php, without having to be forced to use host access.
Note this is not a problem with mysql because we pass the socket file to the connection. Problem in postgresql is that we pass the directory and the port and php / postgres uses both to determine the socket file. I know it's idiot to mix sockets and ports but php / postgres does it for naming purposes and I've not been able to find a way to specify the socket file, it's always directory and port (initdb, psql, php's->connect()...).
Ciao
- has a non-specific relationship to
-
MDL-55124 Support for connection pooler (pgbouncer) in PostgreSQL connection
-
- Closed
-