Skip to content

Commit

Permalink
Admin check: Update PostgreSQL supported versions
Browse files Browse the repository at this point in the history
Code was adapted to the change in PostgreSQL's version numbering policy:
until version 10, major releases increased the 1st or 2nd number; after
that, only the 1st one is bumped.

The versions' EOL date was updated to match the final release's [[1]],
instead of the initial release date + 5 years used until now.

[1]: https://www.postgresql.org/support/versioning/

Fixes #28528
  • Loading branch information
dregad committed May 11, 2021
1 parent 7c47708 commit bce35ba
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions admin/check/check_database_inc.php
Expand Up @@ -176,19 +176,26 @@

$t_database_server_info = $g_db->ServerInfo();
$t_db_version = $t_database_server_info['version'];
preg_match( '/^[0-9]+\.[0-9+]/', $t_db_version, $t_matches );
preg_match( '/^([0-9]+)\.[0-9+]/', $t_db_version, $t_matches );
$t_db_major_version = $t_matches[0];

# MantisBT minimum version
check_print_info_row(
'Database server version',
htmlentities( $t_database_server_info['version'] )
htmlentities( $t_db_version )
);

if( db_is_mysql() ) {
$t_db_min_version = DB_MIN_VERSION_MYSQL;
} elseif( db_is_pgsql() ) {
$t_db_min_version = DB_MIN_VERSION_PGSQL;

# Starting with PostgreSQL 10, a major version is indicated by increasing
# the first part of the version; before that a major version was indicated
# by increasing either the first or second part of the version number.
if( version_compare( $t_db_version, '10', '>=' ) ) {
$t_db_major_version = $t_matches[1];
}
} elseif( db_is_mssql() ) {
$t_db_min_version = DB_MIN_VERSION_MSSQL;
} elseif( db_is_oracle() ) {
Expand Down Expand Up @@ -290,16 +297,20 @@

# Version support information
$t_versions = array(
# Version => EOL date
'9.6' => '2021-09-31',
'9.5' => '2021-01-31',
'9.4' => '2019-12-31',
'9.3' => '2018-09-30',
'9.2' => '2017-09-30',
'9.1' => '2016-09-30',
'9.0' => '2015-09-30',
# Version => Final release (EOL) date
'13' => '2025-11-13',
'12' => '2024-11-14',
'11' => '2023-11090',
'10' => '2022-11-10',
'9.6' => '2021-11-11',
'9.5' => '2021-02-11',
'9.4' => '2020-02-13',
'9.3' => '2018-11-08',
'9.2' => '2017-11-09',
'9.1' => '2016-10-27',
'9.0' => '2015-10-15',
);
$t_support_url = 'http://www.postgresql.org/support/versioning/';
$t_support_url = 'https://www.postgresql.org/support/versioning/';

# Determine EOL date
if( array_key_exists( $t_db_major_version, $t_versions ) ) {
Expand All @@ -325,7 +336,7 @@
false => 'Release information for version ' . $t_db_major_version . ' is not available. '
. vsprintf( 'Since it is %s than %s, we assume it is %s. ', $t_assume )
. 'Please refer to the <a href="' . $t_support_url
. '">PostgreSQL release support policy</a> to make sure.'
. '">PostgreSQL Versioning Policy</a> to make sure.'
) );
}

Expand Down

0 comments on commit bce35ba

Please sign in to comment.