Re: Cannot turn track_counts on

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Cannot turn track_counts on
Дата
Msg-id 2b48e2c9-a72a-4798-807a-43c92cd1f5d8@aklaver.com
обсуждение исходный текст
Ответ на Re: Cannot turn track_counts on  (Anton Shepelev <anton.txt@gmail.com>)
Ответы Re: Cannot turn track_counts on
Список 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@debian.org>
# (C) 2014-2018 Christoph Berg <myon@debian.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.klaver@aklaver.com




В списке pgsql-general по дате отправления: