Ensure that pgAdmin 4 is compatible with PostgreSQL v17. #7537

This commit is contained in:
Akshay Joshi 2024-06-27 13:18:26 +05:30
parent 7d0bbf30ec
commit 3be2221948
27 changed files with 4947 additions and 18 deletions

View File

@ -12,6 +12,7 @@ notes for it.
:maxdepth: 1
release_notes_8_10
release_notes_8_9
release_notes_8_8
release_notes_8_7

View File

@ -0,0 +1,30 @@
************
Version 8.10
************
Release date: 2024-07-25
This release contains a number of bug fixes and new features since the release of pgAdmin 4 v8.9.
Supported Database Servers
**************************
**PostgreSQL**: 12, 13, 14, 15, and 16
**EDB Advanced Server**: 12, 13, 14, 15, and 16
Bundled PostgreSQL Utilities
****************************
**psql**, **pg_dump**, **pg_dumpall**, **pg_restore**: 16.3
New features
************
Housekeeping
************
| `Issue #7537 <https://github.com/pgadmin-org/pgadmin4/issues/7537>`_ - Ensure that pgAdmin 4 is compatible with PostgreSQL v17.
Bug fixes
*********

View File

@ -461,12 +461,14 @@ DEFAULT_BINARY_PATHS = {
"pg-14": "",
"pg-15": "",
"pg-16": "",
"pg-17": "",
"ppas": "",
"ppas-12": "",
"ppas-13": "",
"ppas-14": "",
"ppas-15": "",
"ppas-16": ""
"ppas-16": "",
"ppas-17": ""
}
##########################################################################
@ -481,12 +483,14 @@ FIXED_BINARY_PATHS = {
"pg-14": "",
"pg-15": "",
"pg-16": "",
"pg-17": "",
"ppas": "",
"ppas-12": "",
"ppas-13": "",
"ppas-14": "",
"ppas-15": "",
"ppas-16": ""
"ppas-16": "",
"ppas-17": ""
}
##########################################################################

View File

@ -4,4 +4,4 @@ FROM
pg_attribute
WHERE
attrelid = '{{ tid }}' :: regclass
and attstattarget =-1;
and attnum > 0;

View File

@ -4,4 +4,4 @@ FROM
pg_attribute
WHERE
attrelid = '{{ tid }}' :: regclass
and attstattarget =-1;
and attnum > 0;

View File

@ -0,0 +1,10 @@
SELECT c.oid, c.collname AS name, COALESCE(c.collcollate, c.colllocale) AS lc_collate,
COALESCE(c.collctype, c.colllocale) AS lc_type, c.collisdeterministic AS is_deterministic, c.collversion AS version,
c.collprovider AS provider, c.collicurules AS rules,
pg_catalog.pg_get_userbyid(c.collowner) AS owner, description, n.nspname AS schema
FROM pg_catalog.pg_collation c
JOIN pg_catalog.pg_namespace n ON n.oid=c.collnamespace
LEFT OUTER JOIN pg_catalog.pg_description des ON (des.objoid=c.oid AND des.classoid='pg_collation'::regclass)
WHERE c.collnamespace = {{scid}}::oid
{% if coid %} AND c.oid = {{coid}}::oid {% endif %}
ORDER BY c.collname;

View File

@ -24,7 +24,7 @@ ALTER FOREIGN TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
{{ VARIABLE.SET(conn, 'COLUMN', data.name, data.attoptions) }}
{% endif %}
{### Alter column statistics value ###}
{% if data.attstattarget is defined and data.attstattarget > -1 %}
{% if data.attstattarget is defined and data.attstattarget is not none and data.attstattarget > -1 %}
ALTER FOREIGN TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STATISTICS {{data.attstattarget}};

View File

@ -93,7 +93,7 @@ ALTER FOREIGN TABLE IF EXISTS {{conn|qtIdent(data.basensp, data.name)}}
{% endif %}
{### Alter column statistics value ###}
{% if c.attstattarget is defined and c.attstattarget > -1 %}
{% if c.attstattarget is defined and c.attstattarget is not none and c.attstattarget > -1 %}
ALTER FOREIGN TABLE IF EXISTS {{conn|qtIdent(data.basensp, data.name)}}
ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};

View File

@ -33,7 +33,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
{% endif %}
{### Alter column statistics value ###}
{% if data.attstattarget is defined and data.attstattarget > -1 %}
{% if data.attstattarget is defined and data.attstattarget is not none and data.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STATISTICS {{data.attstattarget}};

View File

@ -33,7 +33,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
{% endif %}
{### Alter column statistics value ###}
{% if data.attstattarget is defined and data.attstattarget > -1 %}
{% if data.attstattarget is defined and data.attstattarget is not none and data.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STATISTICS {{data.attstattarget}};

View File

@ -33,7 +33,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
{% endif %}
{### Alter column statistics value ###}
{% if data.attstattarget is defined and data.attstattarget > -1 %}
{% if data.attstattarget is defined and data.attstattarget is not none and data.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STATISTICS {{data.attstattarget}};

View File

@ -33,7 +33,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
{% endif %}
{### Alter column statistics value ###}
{% if data.attstattarget is defined and data.attstattarget > -1 %}
{% if data.attstattarget is defined and data.attstattarget is not none and data.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STATISTICS {{data.attstattarget}};

View File

@ -171,7 +171,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
{% endif %}
{### Alter column statistics value ###}
{% if c.attstattarget is defined and c.attstattarget > -1 %}
{% if c.attstattarget is defined and c.attstattarget is not none and c.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};

View File

@ -197,7 +197,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
{% endif %}
{### Alter column statistics value ###}
{% if c.attstattarget is defined and c.attstattarget > -1 %}
{% if c.attstattarget is defined and c.attstattarget is not none and c.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};

View File

@ -199,7 +199,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
{% endif %}
{### Alter column statistics value ###}
{% if c.attstattarget is defined and c.attstattarget > -1 %}
{% if c.attstattarget is defined and c.attstattarget is not none and c.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};

View File

@ -199,7 +199,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
{% endif %}
{### Alter column statistics value ###}
{% if c.attstattarget is defined and c.attstattarget > -1 %}
{% if c.attstattarget is defined and c.attstattarget is not none and c.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};

View File

@ -170,7 +170,7 @@ ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
{% endif %}
{### Alter column statistics value ###}
{% if c.attstattarget is defined and c.attstattarget > -1 %}
{% if c.attstattarget is defined and c.attstattarget is not none and c.attstattarget > -1 %}
ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};

View File

@ -0,0 +1,8 @@
SELECT CASE WHEN datlocprovider = 'i' THEN
(SELECT datlocale as cname FROM pg_database WHERE datname = current_database())
ELSE
(SELECT datcollate as cname FROM pg_database WHERE datname = current_database()
UNION
SELECT datctype as cname FROM pg_database WHERE datname = current_database())
END
FROM pg_database WHERE datname = current_database();

View File

@ -0,0 +1 @@
SELECT colllocale as colliculocale from pg_collation where collprovider = 'i'

View File

@ -0,0 +1,41 @@
SELECT
db.oid AS did, db.oid, db.datname AS name, db.dattablespace AS spcoid,
spcname, datallowconn, pg_catalog.pg_encoding_to_char(encoding) AS encoding,
pg_catalog.pg_get_userbyid(datdba) AS datowner, db.datcollate, db.datctype,
datconnlimit, datlocale AS daticulocale, daticurules, datcollversion,
CASE WHEN datlocprovider = 'i' THEN 'icu' ELSE 'libc' END datlocaleprovider,
pg_catalog.has_database_privilege(db.oid, 'CREATE') AS cancreate,
pg_catalog.current_setting('default_tablespace') AS default_tablespace,
descr.description AS comments, db.datistemplate AS is_template,
{### Default ACL for Tables ###}
'' AS tblacl,
{### Default ACL for Sequnces ###}
'' AS seqacl,
{### Default ACL for Functions ###}
'' AS funcacl,
pg_catalog.array_to_string(datacl::text[], ', ') AS acl
FROM pg_catalog.pg_database db
LEFT OUTER JOIN pg_catalog.pg_tablespace ta ON db.dattablespace=ta.OID
LEFT OUTER JOIN pg_catalog.pg_shdescription descr ON (
db.oid=descr.objoid AND descr.classoid='pg_database'::regclass
)
WHERE
{% if show_user_defined_templates is defined %}
db.datistemplate = {{show_user_defined_templates}} AND
{% endif %}
{% if did %}
db.oid = {{ did|qtLiteral(conn) }}::OID
{% else %}
{% if name %}
db.datname = {{ name|qtLiteral(conn) }}::text
{% endif %}
{% endif %}
{% if db_restrictions %}
{% if did or name %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did and not name%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
ORDER BY datname;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -90,6 +90,9 @@ BINARY_PATHS = {
"isDefault": False},
{"version": "160000", "next_major_version": "170000",
"serverType": gettext("EDB Advanced Server 16"), "binaryPath": None,
"isDefault": False},
{"version": "170000", "next_major_version": "180000",
"serverType": gettext("EDB Advanced Server 17"), "binaryPath": None,
"isDefault": False}
],
"pg_bin_paths": [
@ -107,6 +110,9 @@ BINARY_PATHS = {
"isDefault": False},
{"version": "160000", "next_major_version": "170000",
"serverType": gettext("PostgreSQL 16"), "binaryPath": None,
"isDefault": False},
{"version": "170000", "next_major_version": "180000",
"serverType": gettext("PostgreSQL 17"), "binaryPath": None,
"isDefault": False}
]
}

View File

@ -76,7 +76,8 @@ def get_version_mapping_directories():
:param server_type:
:return:
"""
return ({'name': "16_plus", 'number': 160000},
return ({'name': "17_plus", 'number': 170000},
{'name': "16_plus", 'number': 160000},
{'name': "15_plus", 'number': 150000},
{'name': "14_plus", 'number': 140000},
{'name': "13_plus", 'number': 130000},

View File

@ -281,8 +281,9 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
default_binary_path = self.server['default_binary_paths']
if default_binary_path is not None:
def get_server_version_string():
server_version = {160000: '16', 150000: '15', 140000: '14',
130000: '13', 120000: '12', 110000: '11'}
server_version = {170000: '17', 160000: '16', 150000: '15',
140000: '14', 130000: '13', 120000: '12',
110000: '11'}
for k, v in server_version.items():
if k <= self.server_information['server_version']:
return v