#991024 amanda-client: Please adjust ampgsql to newer postgres version

Package:
amanda-client
Source:
amanda
Description:
Advanced Maryland Automatic Network Disk Archiver (Client)
Submitter:
Kamil Jonca
Date:
2026-03-07 15:21:01 UTC
Severity:
important
Tags:
#991024#5
Date:
2021-07-13 07:44:23 UTC
From:
To:
In newer (>=10) postgres version (https://www.postgresql.org/docs/10/release-10.html)
"xlog" function renames to "wal" functions.
This makes ampgsql script pretty unusable.
here is rough patch adjusting it.
--- /usr/lib/amanda/application/ampgsql 2021-06-28 23:46:06.000000000 +0200
+++ /usr/lib/amanda/application/ampgsql.kj      2021-07-13 09:00:45.569729736 +0200
@@ -977,9 +977,13 @@

    my $incremental_val = $self->{'props'}->{'pg-incremental'} || 'yes';
    my $incremental = string_to_boolean($incremental_val);
-
+   my $pg_version = $self->_get_pg_version();
    if ($self->{'action'} eq 'backup') {
-      _run_psql_command($self, "SELECT file_name from pg_xlogfile_name_offset(pg_switch_xlog())");
+          if ($pg_version < 100000 ) {
+          _run_psql_command($self, "SELECT file_name from pg_xlogfile_name_offset(pg_switch_xlog())");
+         } else {
+          _run_psql_command($self, "SELECT file_name from pg_walfile_name_offset(pg_switch_wal())");
+         }
       if (defined($self->{'switch_xlog_filename'})) {
         $self->_wait_for_wal($self->{'switch_xlog_filename'});
       }