-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
Please document search path for eg pg_service.conf when having pip installed psycopg2-binary #1365
Comments
I wasn't aware of this settings, which is probably a compile setting of the libpq. In psycopg2 we build the libpq from source and we already make an adjustment to use a more popular socket dir: psycopg2/scripts/build/build_libpq.sh Lines 104 to 108 in 3430dcd
would you please like to take a look if there are other directories which might use an adjustment? |
Just stumbled for other reasons on the env vars page and it says:
so probably we shoud tweak these settings from the source default to the values expected on major distros. |
I'm not 100%, but I think this is related - on Debian 10 with Python 3.7 and psycopg2-binary 2.8.0 I get: The path on vanilla Debian 10 w/ Unfortunately ~Scott |
@CrypticRabbit that error comes from the server, not from Psycopg, and looks like contribs have not been installed correctly |
Thanks, @dvarrazzo. Do you have a sense of what contribs I need to reinstall to get this working? IIRC, the postgresql-contrib package is depreciated after v10, and they recommend just installing postgresql-xx (with xx being the major version, 14 in my case). |
I haven't been able to determine what standards are used on the various platforms. I only use Ubuntu and Debian and they use the same directory layout. As far as I'm concerned just documenting the locations is a good start. |
No, if we document them they become part of the interface, whereas now they are there just by accident. I'd rather put them in the right place before documenting where they are (if we would still feel the need of it). |
There's no standard location. See extended discussion about such here: https://postgrespro.com/list/thread-id/1674314 The absolute default location if you download the PG source and build from that without specifying anything is /usr/local/pgsql/etc See https://www.postgresql.org/docs/14/install-procedure.html#CONFIGURE-OPTIONS-LOCATIONS RPM distros seem to use /etc (at least CentOS 8 does) So which to choose? Use the absolute default location /usr/local/pgsql/etc ? |
I have no idea, because we don't customise it in our build chain. I thought it was the source default. |
This affects where the pg_service.conf file is looked for. See psycopg/psycopg2#1365
This affects where the pg_service.conf file is looked for. See psycopg/psycopg2#1365
This affects where the pg_service.conf file is looked for. See psycopg/psycopg2#1365
This affects where the pg_service.conf file is looked for. See psycopg/psycopg2#1365
This is a bug tracker
If you have a question, such has "how do you do X with Python/PostgreSQL/psycopg2" please write to the mailing list or open a question instead.
Please complete the following information:
Describe the bug
Used
pip install psycopg2-binary
while previously using
pip install psycopg2
with OS installed libpq (from the official Postgres APT repository).
I was briefly flumoxed by
errors, even though I had
pg_service.conf
in/etc/postgresql-common
as normal.After running
strings libpq-6f24e430.so.5.13 | grep postgresql
I noticed
/usr/local/etc/postgresql
in the output. I symlinked it to
/etc/postgresql-common
and everything started working.I couldn't find anything about this in the documentation. Could you add it somewhere?
The text was updated successfully, but these errors were encountered: