Mon. Feb 17th, 2020

PostgreSQL 12.2, 11.7, 10.12, 9.6.17, 9.5.21 & 9.4.26 releases: bug & security fix and improvements

4 min read

PostgreSQL, often simply Postgres, is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards compliance. It can handle workloads ranging from small single-machine applications to large Internet-facing applications (or for data warehousing) with many concurrent users; on macOS Server, PostgreSQL is the default database; and it is also available for Microsoft Windows and Linux (supplied in most distributions).

PostgreSQL is ACID-compliant and transactional. PostgreSQL has updatable views and materialized views, triggers, foreign keys; supports functions and stored procedures, and other expandability.

PostgreSQL is developed by the PostgreSQL Global Development Group, a diverse group of many companies and individual contributors. It is free and open-source, released under the terms of the PostgreSQL License, a permissive software license. _Wiki

PostgreSQL 12
PostgreSQL 12.2, 11.7, 10.12, 9.6.17, 9.5.21 & 9.4.26 were released.

Security Issues

  • CVE-2020-1720: ALTER ... DEPENDS ON EXTENSION is missing authorization checks.

Versions Affected: 9.6 – 12

The ALTER ... DEPENDS ON EXTENSION sub-commands do not perform authorization checks, which can allow an unprivileged user to drop any function, procedure, materialized view, index, or trigger under certain conditions. This attack is possible if an administrator has installed an extension and an unprivileged user can CREATE, or an extension owner either executes DROP EXTENSION predictably or can be convinced to execute DROP EXTENSION.

The PostgreSQL project thanks Tom Lane for reporting this problem.

Bug Fixes and Improvements

This update also fixes over 75 bugs that were reported in the last several months. Some of these issues affect only version 12, but may also affect all supported versions.

Some of these fixes include:

  • Fix for partitioned tables with foreign-key references where TRUNCATE ... CASCADE would not remove all data. If you have previously used TRUNCATE ... CASCADE on a partitioned table with foreign-key references please see the “Updating” section for verification and cleanup steps.
  • Fix failure to add foreign key constraints to table with sub-partitions (aka a multi-level partitioned table). If you have previously used this functionality, you can fix it by either detaching and re-attaching the affected partition, or by dropping and re-adding the foreign key constraint to the parent table. You can find more information on how to perform these steps in the ALTER TABLE documentation.
  • Fix performance issue for partitioned tables introduced by the fix for CVE-2017-7484 that now allows the planner to use statistics on a child table for a column that the user is granted access to on the parent table when the query contains a leaky operator.
  • Several other fixes and changes for partitioned tables, including disallowing partition key expressions that return pseudo-types, such as RECORD.
  • Fix for logical replication subscribers for executing per-column UPDATE triggers.
  • Fix for several crashes and failures for logical replication subscribers and publishers.
  • Improve efficiency of logical replication with REPLICA IDENTITY FULL.
  • Ensure that calling pg_replication_slot_advance() on a physical replication slot will persist changes across restarts.
  • Several fixes for the walsender processes.
  • Improve performance of hash joins with very large inner relations.
  • Fix placement of “Subplans Removed” field in EXPLAIN output by placing it with its parent Append or MergeAppend plan.
  • Several fixes for parallel query plans.
  • Several fixes for query planner errors, including one that affected joins to single-row subqueries.
  • Several fixes for MCV extend statistics, including one for incorrect estimation for OR clauses.
  • Improve efficiency of parallel hash join on CPUs with many cores.
  • Ignore the CONCURRENTLY option when performing an index creation, drop, or reindex on a temporary table.
  • Fall back to non-parallel index builds when a parallelized CREATE INDEX has no free dynamic shared memory slots.
  • Several fixes for GiST & GIN indexes.
  • Fix possible crash in BRIN index operations with boxrange and inet data types.
  • Fix support for BRIN hypothetical indexes.
  • Fix failure in ALTER TABLE when a column referenced in a GENERATED expression is added or changed in type earlier in the same ALTER TABLE statement.
  • Fix handling of multiple AFTER ROW triggers on a foreign table.
  • Fix off-by-one result for EXTRACT(ISOYEAR FROM timestamp) for BC dates.
  • Prevent unwanted lowercasing and truncation of RADIUS authentication parameters in the pg_hba.conf file.
  • Several fixes for GSSAPI support, including having libpq accept all GSS-related connection parameters even if the GSSAPI code is not compiled in.
  • Several fixes for pg_dump and pg_restore when run in parallel mode.
  • Fix crash with postgres_fdw when trying to execute a remote query on the remote server such as UPDATE remote_tab SET (x,y) = (SELECT ...).
  • Disallow NULL category values in the crosstab() function of contrib/tablefunc to prevent crashes.
  • Several fixes for Windows, including a race condition that could cause timing oddities with NOTIFY.
  • Several ecpg fixes.