Solved After installing by ports, pkg update not work as expected

To install postgresql11 and phppgadmin:

  1. pkg install postgresql11-server
  2. pkg phppgadmin doesn't support postgresql11, it'll remove postgresql11 and install postgresql95, so I used ports to install: lang/php73 databases/php73-pgsql databases/phppgadmin-php73, finally all works well
But when pkg upgrade, it'll remove postgresql11 and install postgresql95 again, any way to pkg upgrade without degrading installed packages?
 
You cannot use ports AND pkgs or you will have issues. Use only one or the other, not both. If you need a specific version of something that is in ports only, you will need to use ports for all software you install then.
 
It is recommended not to mix packages with ports. What you could do is install phppgadmin in a jail to avoid version conflicts. So you would have postgresql11 in a jail (or in the host) and you would install phppgadmin in another jail so that it can pull the dependencies it needs without affecting your other environment.
 
To install postgresql11 and phppgadmin:

  1. pkg install postgresql11-server
  2. pkg phppgadmin doesn't support postgresql11, it'll remove postgresql11 and install postgresql95, so I used ports to install: lang/php73 databases/php73-pgsql databases/phppgadmin-php73 from ports, finally all works well
But when pkg upgrade, it'll remove postgresql11 and install postgresql95 again, any way to pkg upgrade without degrading installed packages?
No. The answer is no because databases/php73-pgsql requires databases/postgresql95-client as a library dependency. You can install php73 and postgresql11-server separately, but they won't be able to communicate without php73-pgsql as an interface between them, and php73-pgsql will only communicate with postgresql95-client and no other. I don't think it matters whether you use ports or packages because it's a library dependency.

This is also the case with php70-pgsql and php72-pgsql. I tried installing phppgadmin11 with php73 yesterday based on your previous threads, and discovered that the same thing is still true for php73-pgsql. You can make postgresql11 and php72 work together on Debian by using ondrej's PPA, which I've done, and you can probably make it work with php73 too, although I haven't actually tested that with php73 personally. But ondrej works for Debian and he hasn't ported his version of php-pgsql to FreeBSD, so on FreeBSD we'll just have to wait until somebody writes a new php-pgsql interface that works with these newer versions of postgresql.
 
To install postgresql11 and phppgadmin:

  1. pkg install postgresql11-server
  2. pkg phppgadmin doesn't support postgresql11, it'll remove postgresql11 and install postgresql95, so I used ports to install: lang/php73 databases/php73-pgsql databases/phppgadmin-php73 from ports, finally all works well
But when pkg upgrade, it'll remove postgresql11 and install postgresql95 again, any way to pkg upgrade without degrading installed packages?

You can't use pkg to install databases/phppgadmin and databases/postgresql11 because postgresql 9.5 is the default version. See /usr/ports/Mk/bsd.default-versions.mk for the default versions used on FreeBSD. If you want newer versions then you have to use ports (which work fine in my case).
 
You can't use pkg to install databases/phppgadmin and databases/postgresql11 because postgresql 9.5 is the default version. See /usr/ports/Mk/bsd.default-versions.mk for the default versions used on FreeBSD. If you want newer versions then you have to use ports (which work fine in my case).
Didn't know FreeBSD had this capability. Followed your suggestion by modifying PGSQL_DEFAULT value from 9.5 to 11 in /usr/ports/Mk/bsd.default-versions.mk, and PHP_DEFAULT from 7.2 to 7.3, and then compiled everything, including php73-pgsql and phppgadmin, from ports tree, on a fresh install of FreeBSD 12.0-RELEASE. Haven't had time to test it all out yet, but the compiler output indicates total success on every version conversion. Thank you very much for this hint. With KDE 5.14 now in the ports tree too, my FreeBSD installs will soon be more bleeding edge than ever before. :)

Now all I need to do is learn how to upgrade the system using these customized ports, because pkg upgrade threatens to undo the magic:
Code:
root@dellbsd24:/home/del # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (42 candidates): 100%
Processing candidates (42 candidates): 100%
The following 8 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    postgresql95-client: 9.5.15_2
    gcc8: 8.2.0_4
    mpfr: 4.0.1_2
    gmp: 6.1.2_1
    mpc: 1.1.0_2
    binutils: 2.30_7,1

Installed packages to be REINSTALLED:
    php73-pgsql-7.3.0_1 (direct dependency changed: postgresql95-client)
    dialog4ports-0.1.6 (option removed: BUCKETEER)

Number of packages to be installed: 6
Number of packages to be reinstalled: 2

The process will require 308 MiB more space.
55 MiB to be downloaded.

Proceed with this action? [y/N]: N
root@dellbsd24:/home/del #
 
Now all I need to do is learn how to upgrade the system using these customized ports, because pkg upgrade threatens to undo the magic:

Separate build server/machine :) That way you don't have to worry about what package is doing because you have only fed your main machine the customized repository you built on the separate build server. Just a thought, haven't tested changing /usr/ports/Mk/bsd.default-versions.mk, but my main PC only installs customized packages from my build machine.
 
Certainly I guess I obviously shouldn't be using pkg to install any packages at all on this kind of ports-only configuration, but I'm also guessing that I can still use pkg upgrade to check to see what upgrades might become available in the package repo, as long as I'm careful to always say No to the option to go ahead with it. I actually have no real need to upgrade postgresql at the present time, but it's very nice to know that FreeBSD has this kind of flexibility if I ever do have a need for it.
 
Back
Top