Setting default version in Poudriere

0 views
Skip to first unread message

Pat

unread,
Jul 4, 2024, 4:57:54 PM (yesterday) Jul 4
to freebsd-questions
Hello,

Got a couple of rather silly question, but I can't find a definitive answer to either.

If I build PostgreSQL15-server, I get version 15.7. That is the latest version, so not unexpected.

I would like to build version 15.6. Ideally I would like to have both versions available because for the most part I want to install 15.7, but I need 15.6 at the moment.

So my questions are:
How do I configure things to have both versions available?
If that is not possible, how do I set the default to be 15.6 for now, with the intent of undoing that after my testing?

Thanks,
Pat

Edward Sanford Sutton, III

unread,
4:57 AM (17 hours ago) 4:57 AM
to ques...@freebsd.org
There is only one port for version 15; to use 15.6 you need a copy of
the ports tree with any git commit from
6fa897631d45dd11a5b1fcea5993590f9ccbef48 to before
ade1c57e3a72ec9c4a7c02ce28dbfbd5efcce373 (probably
de67baaee9ffaf88fa80dcda1f89d83df424d0a4 but I'm bad at sorting through
git hashes). You could also manually patch the tree to have an older
copy in place of the newer one.
With poudriere, you can have multiple ports trees which once created
you can then select for tasks such as `poudriere bulk -j 14 -p outdated
databases/postgresql15-server`
I'm not sure how easily you can have just a directory separate from
the ports tree for poudriere to use in a port's place but tools such as
ports-mgmt/portdowngrade may simplify the process for downgrading the
port but I haven't tried it since git.
If you want both versions available simultaneously from 1 poudriere
run, I presume you need to add a new unique tree entry that is a copy of
15.6 under its own named path and add it to databaes's Makefile. If you
are just doing some a/b testing where you want to keep bouncing back and
forth, I'd just have the tree with the old version as a separate ports
tree and do the poudriere build of it and the updated version as 2
separate repos then change which one pkg looks at and (force?)
installation of packages for each test.

> Thanks,
> Pat


Pat

unread,
3:41 PM (7 hours ago) 3:41 PM
to ques...@freebsd.org
On Friday, July 5th, 2024 at 08:57, Edward Sanford Sutton, III <mirr...@hotmail.com> wrote:

>
>
> On 7/4/24 13:57, Pat wrote:
>
> > Hello,
> >
> > Got a couple of rather silly question, but I can't find a definitive
> > answer to either.
> >
> > If I build PostgreSQL15-server, I get version 15.7. That is the latest
> > version, so not unexpected.
> >
> > I would like to build version 15.6. Ideally I would like to have both
> > versions available because for the most part I want to install 15.7, but
> > I need 15.6 at the moment.
> >
> > So my questions are:
> > How do I configure things to have both versions available?
> > If that is not possible, how do I set the default to be 15.6 for now,
> > with the intent of undoing that after my testing?
>
>
> There is only one port for version 15; to use 15.6 you need a copy of
> the ports tree with any git commit from
> 6fa897631d45dd11a5b1fcea5993590f9ccbef48 to before
> ade1c57e3a72ec9c4a7c02ce28dbfbd5efcce373 (probably
> de67baaee9ffaf88fa80dcda1f89d83df424d0a4 but I'm bad at sorting through
> git hashes). You could also manually patch the tree to have an older
> copy in place of the newer one.

Thanks for taking the time to reply, and pinning to a specific commit
is in line with some of the information that I found, in particular
in the FreeBSD forums. But that leads to another question.

I haven't done a lot with git in some time, but I am familiar with the
basics. I seem to recall that in order to identify a directory as a
git repo there should be a .git directory and a few other git related
items. I do not see any of that in any of the ports directories. For
instance:

ls /usr/local/poudriere/ports/default/databases/postgresql15-server
total 259
drwxr-xr-x 3 root wheel 13 May 16 13:07 ./
drwxr-xr-x 1085 root wheel 1086 Jun 24 20:19 ../
-rw-r--r-- 1 root wheel 801 May 16 13:07 Makefile
-rw-r--r-- 1 root wheel 187 May 16 13:07 distinfo
drwxr-xr-x 2 root wheel 18 May 16 13:07 files/
-rw-r--r-- 1 root wheel 1238 Mar 1 11:12 pkg-descr
-rw-r--r-- 1 root wheel 482 Mar 1 11:12 pkg-install-server
-rw-r--r-- 1 root wheel 58816 Mar 1 11:12 pkg-plist-client
-rw-r--r-- 1 root wheel 10763 Mar 1 11:12 pkg-plist-contrib
-rw-r--r-- 1 root wheel 979 Mar 1 11:12 pkg-plist-plperl
-rw-r--r-- 1 root wheel 1389 Mar 1 11:12 pkg-plist-plpython
-rw-r--r-- 1 root wheel 197 Mar 1 11:12 pkg-plist-pltcl
-rw-r--r-- 1 root wheel 89992 May 16 13:07 pkg-plist-server

Is that the right tree, or should I be looking elsewhere? I'm just
not sure where run the git commands from. If I knew that I might
could figure the rest out from there.

> With poudriere, you can have multiple ports trees which once created
> you can then select for tasks such as `poudriere bulk -j 14 -p outdated databases/postgresql15-server`
> I'm not sure how easily you can have just a directory separate from
> the ports tree for poudriere to use in a port's place but tools such as
> ports-mgmt/portdowngrade may simplify the process for downgrading the
> port but I haven't tried it since git.
> If you want both versions available simultaneously from 1 poudriere
> run, I presume you need to add a new unique tree entry that is a copy of
> 15.6 under its own named path and add it to databaes's Makefile. If you
> are just doing some a/b testing where you want to keep bouncing back and
> forth, I'd just have the tree with the old version as a separate ports
> tree and do the poudriere build of it and the updated version as 2
> separate repos then change which one pkg looks at and (force?)
> installation of packages for each test.

Yeah, my intent here is to do some simple a/b testing prior to a
production upgrade. I think the easiest option is to just create
two jails, one at the current level, and one at 15.6. I just need to
figure out the pinning part and I'm probably good.

>
> > Thanks,
> > Pat
>
>

Daniel Lysfjord

unread,
5:15 PM (5 hours ago) 5:15 PM
to Pat, ques...@freebsd.org
I would suggest just creating a port for postgres 15.6 in addition to
the 15.7 that's already in the ports tree

Shane Ambler

unread,
9:48 PM (1 hour ago) 9:48 PM
to Pat, freebsd-questions
As far as ports go, you can configure the major postgresql version
(14.x, 15.x), in make.conf add DEFAULT_VERSIONS= pgsql=15

Considering you have a database requiring 15.6, you would have that
installed and running already, I would suggest setting up 15.7 DB in a
jail or second machine for regression tests and not need a second 15.6
server running. So you would only need to build the newer version.

Are you aware of the postgresql versioning changes since 10? The first
number is a major version, the second is a minor bug/security update

15.6 to 15.7 is a minor update that can be done in-place.

From https://www.postgresql.org/support/versioning/

Minor release upgrades do not require a dump and restore; you simply
stop the database server, install the updated binaries, and restart the
server. Such upgrades might require additional steps so always read the
release notes first.

Minor releases only contain fixes for frequently-encountered bugs,
low-risk fixes, security issues, and data corruption problems. The
community considers performing minor upgrades to be less risky than
continuing to run an old minor version.


--
FreeBSD - the place to B...Serving Data

Shane Ambler


Reply all
Reply to author
Forward
0 new messages