Comments (14)
There was no lo_lseek64
in libpq-fe.h
in 9.2, so it looks like Makefile.PL
finds pg_config
from 9.2, but libpq
and headers are actually a newer version.
I see the CI job uses Debian and installs postgresql-server-dev-9.2
. While the Debian packages ship server and client binaries for every version, libpq
is by default only provided from the latest version, since that installs into /usr/{lib,include}/
and is protocol-compatible with older servers and ABI-compatible with older binaries. However, the /usr/bin/pg_config
wrapper from postgresql-common
prefers the pg_config
from postgresql-sever-dev-*
over the one from libpq-dev
, hence the version confusion.
To get older libpq
versions you need to add the version-specific suite to the sources.list
line e.g.
deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing main 9.2
and install the specific version with apt install libq{5,-dev}=9.2.*
.
from dbdpg.
I didn't realize apt.postgresql.org.sh
would install the Debian-packaged pg_config or libpq. The host does have libpq and pg_config in /usr/include/postgresql/9.2
; would it work if the PATH included /usr/include/postgresql/9.2/bin
?
from dbdpg.
@df7cb can you comment on this? The pg-start
script uses
apt.postgresql.org.sh -i -v 9.2
to instal the version. Is there a way for that script to also install libpq such that it's easily findable? Or do I need to figure out how to add /usr/include/postgresql/9.2/bin
to the path?
from dbdpg.
There's no need to add /usr/include/postgresql/9.2/bin
to $PATH
, the /usr/bin/pg_config
wrapper will find the most recent one in /usr/lib/postgresql/*/bin
and delegate to that. The crucial thing is that libpq{5,-dev}
(which is installed in /usr/{lib,include}
) must match that version.
from dbdpg.
Okay. A little surprised that apt.postgresql.org.sh
doesn't install them; maybe it could? I believe it sets up the apt repo, but maybe not, since I ran apt install libq{5,-dev}=9.2.*
and it couldn't find them. Apparently they're in /etc/apt/sources.list.d/pgdg.list
tho; it looks like this:
deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
#deb-src http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
Do I need to so something special to get apt-get
to use that source?
from dbdpg.
As I mentioned in my original comment:
To get older
libpq
versions you need to add the version-specific suite to thesources.list
line e.g.deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing main 9.2
and install the specific version with
apt install libq{5,-dev}=9.2.*
.
Note the 9.2
after main
.
from dbdpg.
Can't you use PG_VERSION_NUM instead? That will point to the more recent libpq version (at least in /usr/include/postgresql/pg_config.h), even if pg_config is older.
from dbdpg.
Where would I use it?
from dbdpg.
If the expectation is that setting as an environment variable will do the trick, I tried it with pg_config
and it made no difference:
# pg_config --includedir
/usr/include/postgresql
# /usr/lib/postgresql/9.2/bin/pg_config --includedir
/usr/include/postgresql
# PG_VERSION_NUM=90200 pg_config --includedir
/usr/include/postgresql
# export PG_VERSION_NUM=90200
# pg_config --includedir
/usr/include/postgresql
I also tried installing DBD::Pg with it set, but no joy.
from dbdpg.
Setting up the new apt source also does not work; it cannot find the specified packages to install:
$ echo deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg-testing main 9.2 >> /etc/apt/sources.list
$ cat /etc/apt/sources.list
# deb http://snapshot.debian.org/archive/debian/20211011T000000Z buster main
deb http://deb.debian.org/debian buster main
# deb http://snapshot.debian.org/archive/debian-security/20211011T000000Z buster/updates main
deb http://security.debian.org/debian-security buster/updates main
# deb http://snapshot.debian.org/archive/debian/20211011T000000Z buster-updates main
deb http://deb.debian.org/debian buster-updates main
deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg-testing main 9.2
$ apt install libq{5,-dev}=9.2.*
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libq5
E: Unable to locate package libq-dev
$ apt-get update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Get:4 http://apt.postgresql.org/pub/repos/apt buster-pgdg-testing InRelease [110 kB]
Hit:5 http://apt.postgresql.org/pub/repos/apt buster-pgdg InRelease
Get:6 http://apt.postgresql.org/pub/repos/apt buster-pgdg-testing/main amd64 Packages [256 kB]
Get:7 http://apt.postgresql.org/pub/repos/apt buster-pgdg-testing/9.2 amd64 Packages [1802 B]
Fetched 368 kB in 2s (228 kB/s)
Reading package lists... Done
$ apt install libq{5,-dev}=9.2.*
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libq5
E: Unable to locate package libq-dev
from dbdpg.
And finally, there is only one copy of libpq-fe.h
on the system:
find / -name libpq-fe.h
/usr/include/postgresql/libpq-fe.h
That's the default latest version that @ilmari mentioned; to his point, there needs to be a way to install the client headers and libraries that go with the version installed by apt.postgresql.org.sh
. Ideally there would be an option to apt.postgresql.org.sh
that would install them.
FWIW, I'm also getting signature errors when I add buster-pgdg
or buster-pgdg-testing
:
$ echo deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg-testing main 9.2 >> /etc/apt/sources.list
$ apt-get update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://apt.postgresql.org/pub/repos/apt buster-pgdg-testing InRelease [110 kB]
Get:5 http://security.debian.org/debian-security buster/updates/main amd64 Packages [309 kB]
Get:6 http://deb.debian.org/debian buster/main amd64 Packages [7906 kB]
Get:7 http://deb.debian.org/debian buster-updates/main amd64 Packages [15.2 kB]
Err:4 http://apt.postgresql.org/pub/repos/apt buster-pgdg-testing InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7FCC7D46ACCC4CF8
Reading package lists... Done
W: GPG error: http://apt.postgresql.org/pub/repos/apt buster-pgdg-testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7FCC7D46ACCC4CF8
E: The repository 'http://apt.postgresql.org/pub/repos/apt buster-pgdg-testing InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
from dbdpg.
Decided to look at this again today, and go it to work simply by adding the -t
option to [apt.postgresql.org.sh
] once I noticed it in the source: It configures pgdg-testing
instead of pgdg
. And now it's all green.
from dbdpg.
Glad it is working now. Can we close this, or do we need a doc tweak?
from dbdpg.
I don’t see why not
from dbdpg.
Related Issues (20)
- Value trimmed upon insert HOT 4
- Tests fail if root's shell is not a Bourne shell HOT 6
- Statement handle DESTROY slurps pending async queries
- Tests fail to start new DB: pg_ctl: unrecognized operation mode HOT 4
- DBD::Pg 3.16.0 tests fail HOT 11
- Dying with non-ASCII utf8 DB message, with use warnings FATAL => 'all'; leads to "Wide character in subroutine entry" error message with DB-message omitted HOT 6
- Old postgresql client has trouble with new DBD::Pg versions due to bug in old postgresql client libraries HOT 3
- Error building DBD::Pg on macOS Monterey HOT 5
- META.yaml should be META.yml HOT 4
- DBD::Pg builds are failing to produce MYMETA.json files HOT 3
- Simple select of jsonb field returning empty result when field is NULL HOT 6
- Change in result type of EXTRACT() with Pg14 upwards not handled HOT 1
- MERGE INTO statement handles not returning total count of rows affected HOT 2
- Can't load Pg.so on Ubuntu 20.04 and Postgres 8.3.5 - tries to use lo_import_with_oid HOT 1
- $dbh->ping documentation possibly not clear HOT 4
- failed to build in openwrt HOT 3
- Cannot detect the default value for a `generated always as identity` column HOT 3
- v5.40's builtin false keyword cannot be passed in a bind parameter as the value of a boolean field HOT 9
- DESTROY failed: no connection
- t/03smethod.t fails with DBI v1.641 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbdpg.