Migration to Version 13 v13
A dump/restore using pg_dumpall or pg_upgrade or logical replication is required for migrating data from any previous release. See Upgrading an Installation With pg_upgrade for information on migrating to new major releases.
Version 13 contains a number of changes that may affect compatibility with previous releases. Listed is the following incompatibilities:
Change
SIMILAR TO ... ESCAPE NULLto returnNULL.This new behavior matches the SQL specification. Previously a null
ESCAPEvalue was taken to mean using the default escape string (a backslash character). This also applies tosubstring(text FROM pattern ESCAPE text). The previous behavior has been retained in old views by keeping the original function unchanged.Make
json[b]_to_tsvector()fully check the spelling of itsstringoption.Change the way non-default
effective_io_concurrencyvalues affect concurrency.Previously, this value was adjusted before setting the number of concurrent requests. The value is now used directly. Conversion of old values to new ones can be done using:
SELECT round(sum(OLDVALUE / n::float)) AS newvalue FROM generate_series(1, OLDVALUE) s(n);
Prevent display of auxiliary processes in
pg_stat_sslandpg_stat_gssapisystem views. Queries that join these views topg_stat_activityand wish to see auxiliary processes will need to use left joins.Rename various
wait eventsto improve consistency.Fix
ALTER FOREIGN TABLE ... RENAME COLUMNto return a more appropriate command tag. Previously it returnedALTER TABLE; now it returnsALTER FOREIGN TABLE.Fix
ALTER MATERIALIZED VIEW ... RENAME COLUMNto return a more appropriate command tag. Previously it returnedALTER TABLE; now it returnsALTER MATERIALIZED VIEW.Rename configuration parameter
wal_keep_segmentstowal_keep_size.This determines how much WAL to retain for standby servers. It is specified in megabytes, rather than number of files as with the old parameter. If you previously used
wal_keep_segments, the following formula will give you an approximately equivalent setting:wal_keep_size = wal_keep_segments * wal_segment_size (typically 16MB)
Remove support for defining operator classes using pre-PostgreSQL 8.0 syntax.
Remove support for defining foreign key constraints using pre-PostgreSQL 7.3 syntax.
Remove support for "opaque" pseudo-types used by pre-PostgreSQL 7.3 servers.
Remove support for upgrading unpackaged (pre-9.1) extensions.
The
FROMoption ofCREATE EXTENSIONis no longer supported. Any installations still using unpackaged extensions should upgrade them to a packaged version before updating to PostgreSQL 13.Remove support for
posixrulesfiles in the timezone database.IANA's timezone group has deprecated this feature, meaning that it will gradually disappear from systems' timezone databases over the next few years. Rather than have a behavioral change appear unexpectedly with a timezone data update, we have removed PostgreSQL's support for this feature as of version 13. This affects only the behavior of POSIX-style time zone specifications that lack an explicit daylight savings transition rule; formerly the transition rule could be determined by installing a custom
posixrulesfile, but now it is hard-wired. The recommended fix for any affected installations is to start using a geographical time zone name.In ltree, when an
lquerypattern contains adjacent asterisks with braces, e.g.,*{2}.*{3}, properly interpret that as*{5}.Fix pageinspect's
bt_metap()to return more appropriate data types that are less likely to overflow.The
SELECT DISTINCT...ORDER BYclause of theSELECT DISTINCTquery behavior differs after upgrade.If
SELECT DISTINCTis specified or if aSELECTstatement includes theSELECT DISTINCT …ORDER BYclause then all the expressions inORDER BYmust be present in the select list of theSELECT DISTINCTquery (applicable when upgrading from version 9.6 to any higher version of Advanced Server).All objects depending on collation must be rebuilt using
pg_upgradeto migrate from earlier versions (12, 11, 10, 9.6) using ICU to the latest Advanced Server version.A change in collation definitions can lead to corrupt indexes and other problems because the database system relies on stored objects having a certain sort order. Generally, this should be avoided, but it can happen in legitimate circumstances, such as when using
pg_upgradeto upgrade to server binaries linked with a newer version of ICU. When this happens, all objects depending on the collation should be rebuilt, for example, usingREINDEX. When that is done, the collation version can be refreshed using the commandALTER COLLATION ... REFRESH VERSION. This will update the system catalog to record the current collator version and will make the warning go away. Note that this does not actually check whether all affected objects have been rebuilt correctly.