From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Dick Visser <dnmvisser(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: client/server versions |
Date: | 2023-11-21 15:43:23 |
Message-ID: | 93770442-ad9a-4fb5-9baa-0005b305e8c7@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 11/21/23 03:28, Dick Visser wrote:
> Hi
>
> I'm working with AWS RDS PG instances that have been created over time,
> and that by now are a mix of several major/minor versions ranging from
> 12 to 15.
> The initial configuration and management is done from an EC2 instance
> running Debian 11, which has Postrgres 13.13.
> I already found out that there are compatibility issues if I use the
> client programs from the Debian VM when they're older than the server
> version.
> To avoid this I tried to run the client programs from a dedicated PG
> container image with the same version as the server.
> So instead of running:
>
> PGSERVICE=foobar psql
>
> I would now run:
>
> podman run -e PGSERVICE=foobar -v
> $(pwd)/.pg_service.conf:/root/.pg_service.conf --rm -it
> docker.io/library/postgres:15.3 <http://docker.io/library/postgres:15.3>
> psql
>
> This is reasonably straightforward and seems to just work.
> Now that I have a way to pick whatever client version I need, I wonder
> what the best strategy is wrt versions...
> Keeping them exactly the same, or is it better to always use the latest
> client version?
Not sure how you installed the Postgres versions and what the OS'es are
for all the instances? If you used the Debian/Ubuntu repos or Postgres
community repo Debian/Ubuntu packages then you got the program
pg_wrapper installed.
Per man pg_wrapper or postgresql-common(they point to the same thing) file:
"""
This program is run only as a link to names which correspond to
PostgreSQL programs in /usr/lib/postgresql/version/bin. It determines
the configured cluster and database for the user and calls the
appropriate version of the desired program to connect to that cluster
and database, supplying any specified options to thatcommand.
...
For psql, pg_archivecleanup, and pg_isready, pg_wrapper will always use
the binary from the newest PostgreSQL version installed, as these are
downwards compatible.
"""
> I know that the latter is a bit easier as one can just pick an untagged
> container image, because that corresponds to the latest version.
> Also I'm thinking that using the latest version of pg_dump/pg_restore
> allows you to have more options.
>
> thx
>
> Dick Visser
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Joan Pujol | 2023-11-21 18:10:15 | Retrieve results in PostgreSQL stored procedure allowing query parallelism |
Previous Message | Dick Visser | 2023-11-21 14:07:46 | Re: client/server versions |