Re: Cannot turn track_counts on

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Anton Shepelev <anton(dot)txt(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Cannot turn track_counts on
Date: 2025-04-18 15:32:50
Message-ID: 2b48e2c9-a72a-4798-807a-43c92cd1f5d8@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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-a-server-side-extensi>
>
> 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 <mpitt(at)debian(dot)org>
# (C) 2014-2018 Christoph Berg <myon(at)debian(dot)org>
#
# 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
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mansky, Edmund J. (GSFC-671.0)[ADNET Affiliate] 2025-04-18 17:28:26 Why is an error not thrown when the time exceeds the lock timeout for an ExclusiveLock on a transaction ?
Previous Message sivapostgres@yahoo.com 2025-04-18 11:20:13 Re: Error while updating a table