public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Anton Shepelev <[email protected]>
Cc: [email protected]
Subject: Re: Cannot turn track_counts on
Date: Fri, 18 Apr 2025 08:32:50 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

On 4/17/25 15:25, Anton Shepelev wrote:
> Adrian Klaver to Anton Shepelev:

> Yet that is what we get for `pg_config --version' on the
> affected system.  A nearly identical error message seems to
> come up while installing psycopg2 -- a Python library for
> Postgres, e.g.:
> 
>     <https://stackoverflow.com/q/28253681/2862241;
>     <https://www.matheusmello.io/posts/python-you-need-to-install-postgresql-server-dev-x-y-for-building-...;
> 
> I have not the slightest idea why pg_config should print
> this message, unless it is not a genuine pg_config.  I will
> be checking its binary against the one that works as expected
> on our reference system.

Found it. It is coming from the Debian postgresql-common packaging.

/usr/bin/pg_config  is  wrapper that contains:

#!/bin/sh

# If postgresql-server-dev-* is installed, call pg_config from the latest
# available one. Otherwise fall back to libpq-dev's version.
#
# (C) 2011 Martin Pitt <[email protected]>
# (C) 2014-2018 Christoph Berg <[email protected]>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

set -e
PGBINROOT="/usr/lib/postgresql/"
#redhat# PGBINROOT="/usr/pgsql-"
LATEST_SERVER_DEV=`ls -v $PGBINROOT*/bin/pg_config 2>/dev/null|tail -n1`

if [ -n "$LATEST_SERVER_DEV" ]; then
     exec "$LATEST_SERVER_DEV" "$@"
else
     if [ -x /usr/bin/pg_config.libpq-dev ]; then
         exec /usr/bin/pg_config.libpq-dev "$@"
     else
         echo "You need to install postgresql-server-dev-NN for building 
a server-side extension or libpq-dev for building a client-side 
application." >&2
         exit 1
     fi
fi


The message is telling you that on the machine you ran pg_config you 
have not installed either:

postgresql-server-dev-X where X is a major version

or

libpq-dev


If you want to get information from pg_config you will need to install 
one or the other. I would suggest libpq-dev.





-- 
Adrian Klaver
[email protected]







view thread (10+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Cannot turn track_counts on
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox