Bug 239514

Summary: [exp-run] databases/postgresql: Make PostreSQL 11 new default
Product: Ports & Packages Reporter: Torsten Zuehlsdorff <tz>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Only Me CC: mfechner, ports-bugs
Priority: --- Flags: antoine: exp-run+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 239609, 239637, 239639, 239652    
Bug Blocks:    
Attachments:
Description Flags
Patch to change the default PostgreSQL version from 9.5 to 11 none

Description Torsten Zuehlsdorff freebsd_committer 2019-07-29 18:39:18 UTC
Created attachment 206144 [details]
Patch to change the default PostgreSQL version from 9.5 to 11

Aloha,

it is time to bump the default PostgreSQL version from 9.5 to 11. To make sure everything works fine please perform an exp-run. Everything depending on PostgreSQL should be tested.

Thank you!
Torsten
Comment 3 commit-hook freebsd_committer 2019-08-03 07:43:52 UTC
A commit references this bug:

Author: tobik
Date: Sat Aug  3 07:43:35 UTC 2019
New revision: 507933
URL: https://svnweb.freebsd.org/changeset/ports/507933

Log:
  databases/tablelog: Unbreak build with PostgreSQL >= 11.0

  table_log.c:76:29: error: member reference type 'FormData_pg_attribute' (aka 'struct FormData_pg_attribute') is not a pointer; did you mean to use '.'?
      if (!tupleDesc->attrs[i]->attisdropped) {
           ~~~~~~~~~~~~~~~~~~~^~
                              .
  table_log.c:303:59: error: member reference type 'FormData_pg_attribute' (aka 'struct FormData_pg_attribute') is not a pointer; did you mean to use '.'?
        if (trigdata->tg_relation->rd_att->attrs[col_nr - 1]->attisdropped) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                                                            .
  table_log.c:348:59: error: member reference type 'FormData_pg_attribute' (aka 'struct FormData_pg_attribute') is not a pointer; did you mean to use '.'?
        if (trigdata->tg_relation->rd_att->attrs[col_nr - 1]->attisdropped) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                                                            .
  table_log.c:375:59: error: member reference type 'FormData_pg_attribute' (aka 'struct FormData_pg_attribute') is not a pointer; did you mean to use '.'?
        if (trigdata->tg_relation->rd_att->attrs[col_nr - 1]->attisdropped) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                                                            .
  4 errors generated.

  http://package18.nyi.freebsd.org/data/120amd64-default-PR239514/2019-07-29_20h41m52s/logs/tablelog-0.4.4_3.log

  While here

  - Mark it as deprecated.  The last release was in 2007 and upstream
    has been inactive since then.
  - Fix WWW

  PR:		239514
  Reported by:	antoine (via exp-run)

Changes:
  head/databases/tablelog/Makefile
  head/databases/tablelog/files/patch-table__log.c
  head/databases/tablelog/pkg-descr
Comment 4 commit-hook freebsd_committer 2019-08-03 08:23:56 UTC
A commit references this bug:

Author: tobik
Date: Sat Aug  3 08:23:01 UTC 2019
New revision: 507936
URL: https://svnweb.freebsd.org/changeset/ports/507936

Log:
  databases/ip4r: Update to 2.4.1

  This fixes the build with newer PostgreSQL versions.

  Drop the IDXPATCH option.  The patch no longer applies.  Unfortunately
  it was never upstreamed, its purpose is not clear, and the port no
  longer has a maintainer to ask about this.

  Changes:	https://github.com/RhodiumToad/ip4r/blob/2.4.1/README.ip4r
  PR:		239514

Changes:
  head/databases/ip4r/Makefile
  head/databases/ip4r/distinfo
  head/databases/ip4r/pkg-plist
Comment 5 commit-hook freebsd_committer 2019-08-03 09:03:00 UTC
A commit references this bug:

Author: tobik
Date: Sat Aug  3 09:02:39 UTC 2019
New revision: 507940
URL: https://svnweb.freebsd.org/changeset/ports/507940

Log:
  databases/pg_reorg: Do not build on newer PostgreSQL versions

  It fails to build with PostgreSQL 11:

  pgut/pgut.c:389:47: error: too few arguments to function call, expected 4, have 3
          return simple_prompt("Password: ", 100, false);
                 ~~~~~~~~~~~~~                         ^
  /usr/local/include/postgresql/server/port.h:193:1: note: 'simple_prompt' declared here
  extern void simple_prompt(const char *prompt, char *destination, size_t destlen,
  ^
  1 error generated.

  http://package18.nyi.freebsd.org/data/120amd64-default-PR239514/2019-07-29_20h41m52s/logs/pg_reorg-1.1.11_2.log

  And after fixing that one:

  reorg.c:230:55: warning: incompatible pointer types passing 'bool [1]' to parameter of type 'const char *' [-Wincompatible-pointer-types]
                  execute_plan(SPI_OK_SELECT, plan_peek, values_peek, nulls_peek);
                                                                      ^~~~~~~~~~
  ./pgut/pgut-spi.h:28:84: note: passing argument to parameter 'nulls' here
  extern void execute_plan(int expected, SPIPlanPtr plan, Datum *values, const char *nulls);
                                                                                     ^
  reorg.c:256:58: warning: incompatible pointer types passing 'bool *' to parameter of type 'const char *' [-Wincompatible-pointer-types]
                                  execute_plan(SPI_OK_INSERT, plan_insert, &values[2], &nulls[2]);
                                                                                       ^~~~~~~~~
  [...]
  reorg.c:573:34: error: use of undeclared identifier 'BTREE_AM_OID'
                          opclass = OpclassnameGetOpcid(BTREE_AM_OID, opcname);
                                                        ^
  reorg.c:590:57: error: member reference type 'FormData_pg_attribute' (aka 'struct FormData_pg_attribute') is not a pointer; did you mean to use '.'?
                                  opcintype = RelationGetDescr(indexRel)->attrs[nattr]->atttypid;
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
  etc.

  PR:		239514

Changes:
  head/databases/pg_reorg/Makefile
Comment 6 commit-hook freebsd_committer 2019-08-03 09:21:03 UTC
A commit references this bug:

Author: tobik
Date: Sat Aug  3 09:20:33 UTC 2019
New revision: 507942
URL: https://svnweb.freebsd.org/changeset/ports/507942

Log:
  databases/pgagent: Unbreak build with PostgreSQL 11+

  CMake Error at cmake/FindPG.cmake:74 (LIST):
    LIST index: 2 out of range (-2, 1)

  http://package18.nyi.freebsd.org/data/120amd64-default-PR239514/2019-07-29_20h41m52s/logs/pgagent-3.4.0_4.log

  PR:		239514

Changes:
  head/databases/pgagent/files/patch-cmake_FindPG.cmake
Comment 7 commit-hook freebsd_committer 2019-08-03 11:32:17 UTC
A commit references this bug:

Author: tobik
Date: Sat Aug  3 11:31:49 UTC 2019
New revision: 507965
URL: https://svnweb.freebsd.org/changeset/ports/507965

Log:
  databases/postgresql-mysql_fdw: Update to 2.5.1

  This fixes the build with PostgreSQL 10 and 11

  Changes:	https://github.com/EnterpriseDB/mysql_fdw/releases

  PR:		239514

Changes:
  head/databases/postgresql-mysql_fdw/Makefile
  head/databases/postgresql-mysql_fdw/distinfo
  head/databases/postgresql-mysql_fdw/pkg-descr
Comment 8 commit-hook freebsd_committer 2019-08-03 11:55:22 UTC
A commit references this bug:

Author: tobik
Date: Sat Aug  3 11:54:58 UTC 2019
New revision: 507967
URL: https://svnweb.freebsd.org/changeset/ports/507967

Log:
  databases/postgresql-plv8js: Fix supported PostgreSQL version range

  It does not build with PostgreSQL 11.  Updating the port is not
  trivial due to our outdated lang/v8 port.

  PR:		239514

Changes:
  head/databases/postgresql-plv8js/Makefile
Comment 9 commit-hook freebsd_committer 2019-08-04 07:57:44 UTC
A commit references this bug:

Author: tobik
Date: Sun Aug  4 07:57:07 UTC 2019
New revision: 508070
URL: https://svnweb.freebsd.org/changeset/ports/508070

Log:
  databases/postgresql-tds_fdw: Update to 2.0.0-alpha.3

  This adds support for PostgreSQL 11.

  Changes:	https://github.com/tds-fdw/tds_fdw/releases/tag/v2.0.0-alpha.3
  PR:		239514

Changes:
  head/databases/postgresql-tds_fdw/Makefile
  head/databases/postgresql-tds_fdw/distinfo
Comment 10 Matthias Fechner freebsd_committer 2019-08-08 11:06:41 UTC
Just for reference, the upgrade instruction could be:
service gitlab stop
service postgresql stop
pkg create postgresql95-server postgresql95-contrib
mkdir /tmp/pg-upgrade
tar xf postgresql96-server-9.5.18_1.txz -C /tmp/pg-upgrade
tar xf postgresql96-contrib-9.5.18_1.txz -C /tmp/pg-upgrade

pkg delete -f postgresql95-server postgresql95-contrib postgresql95-client
pkg install postgresql11-server postgresql11-contrib postgresql11-client
pkg upg

/usr/local/etc/rc.d/postgresql initdb
su -l postgres -c "pg_upgrade -b /tmp/pg-upgrade/usr/local/bin/ -d /var/db/postgres/data95/ -B /usr/local/bin/ -D /var/db/postgres/data11/"

service postgresql start
service gitlab start

#Verify everything works
su -l postgres -c "cd /var/db/postgres && /usr/local/bin/vacuumdb --all --analyze-in-stages"
su -l postgres -c "cd /var/db/postgres && rm -rf '/var/db/postgres/data95'"
rm /var/db/postgres/analyze_new_cluster.sh
rm /var/db/postgres/delete_old_cluster.sh

rm -R /tmp/pg-upgrade
Comment 11 Tobias Kortkamp freebsd_committer 2019-08-08 11:14:12 UTC
(In reply to Matthias Fechner from comment #10)
Matthias, please do not randomly remove dependent bugs.  databases/skytools is not
fixing itself. :-(
Comment 12 Matthias Fechner freebsd_committer 2019-08-09 05:14:56 UTC
(In reply to Tobias Kortkamp from comment #11)
Sorry Tobias, I was yesterday in a hurry and it seems that I clicked (had a conflict) the wrong button while posting comment #10.
Comment 13 Tobias Kortkamp freebsd_committer 2019-08-18 13:34:04 UTC
I think this is ready for another exp-run.
Comment 14 Torsten Zuehlsdorff freebsd_committer 2019-08-18 21:04:06 UTC
(In reply to Tobias Kortkamp from comment #13)

> I think this is ready for another exp-run.

I think so too!

And a big thank you Tobias for your work!
Comment 15 Antoine Brodin freebsd_committer 2019-08-22 08:24:52 UTC
Exp-run looks fine
Comment 16 Torsten Zuehlsdorff freebsd_committer 2019-08-23 19:27:34 UTC
Great news, thanks to all of you! :)

I'm going to commit the chance next week!