Your message dated Thu, 3 Dec 2020 18:09:09 +0100
with message-id <[email protected]>
and subject line Re: Bug#976336: postgresql-client-common: pg_wrapper selects 
wrong versions for pg_dump/pg_restore
has caused the Debian Bug report #976336,
regarding postgresql-client-common: pg_wrapper selects wrong versions for 
pg_dump/pg_restore
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
976336: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976336
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: postgresql-client-common
Version: 223
Severity: normal

When accessing a remote cluster pg_wrapper always select the newest
version of pg_dump. This, combined with pg_restore on a local cluster
results in an error when multiple clusters with different PostgreSQL
versions are available on the local machine.

For example, if the local machine has both PostgreSQL 11 and 12
installed, the following command will fail:

pg_dump -Fc -h $REMOTE_HOST -p $REMOTE_PORT remote_db \
| pg_restore -Fc -d pg11_db

because pg_wrapper will use pg_dump version 12 and pipe the result
into pg_restore version 11 (that does not support a dump generated
with pg_dump version 12).

A possible solution is to always use the last version of pg_restore
(it is backward compatible so there should be no issues).

-- System Information:
Debian Release: bullseye/sid
  APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.9.0-4-amd64 (SMP w/16 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages postgresql-client-common depends on:
ii  netbase  6.2

Versions of packages postgresql-client-common recommends:
ii  libreadline8  8.1~rc3-1

postgresql-client-common suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Re: Federico Di Gregorio
> When accessing a remote cluster pg_wrapper always select the newest
> version of pg_dump. This, combined with pg_restore on a local cluster
> results in an error when multiple clusters with different PostgreSQL
> versions are available on the local machine.

Hi,

pg_wrapper cannot figure out which version to use, so you have to tell
it which. The --cluster argument supports remote hosts:

OPTIONS
       --cluster version/cluster
       --cluster version/host:[port]
           cluster is either the name of a cluster on the local system, or 
takes the form
           host:port for a remote cluster. If port is left empty (i. e. you 
just specify
           host:), it defaults to 5432.

> pg_dump -Fc -h $REMOTE_HOST -p $REMOTE_PORT remote_db \

Try pg_dump --cluster 11/$REMOTE_HOST -Fc -p $REMOTE_PORT remote_db

Christoph

--- End Message ---

Reply via email to