diff options
| author | Tom Lane | 2021-03-08 23:47:23 +0000 |
|---|---|---|
| committer | Tom Lane | 2021-03-08 23:47:23 +0000 |
| commit | fed10d4eec79242688382d03ddca82007160ee6f (patch) | |
| tree | 80a52f70177423993e3b52655725c7c6c647ba9f | |
| parent | 5c06abb9b97b69513a3998cccf89556e73052e02 (diff) | |
Properly mark pg_stat_get_subscription() as returning a set.
The initial catalog data for this function failed to set proretset
or provide a prorows estimate. It accidentally worked anyway when
invoked in the FROM clause, because the executor isn't too picky
about this; but the planner didn't expect the function to return
multiple rows, which could lead to bad plans. Also the function
would fail if invoked in the SELECT list.
We can't easily back-patch this fix, but fortunately the bug's
consequences aren't awful in most cases. Getting this right is
mainly an exercise in future-proofing.
Discussion: https://postgr.es/m/1636062.1615141782@sss.pgh.pa.us
| -rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.dat | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 8805c99d6f..e28bbf1317 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202103061 +#define CATALOG_VERSION_NO 202103081 #endif diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 506689d8ac..a0fe0851c4 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -5287,8 +5287,9 @@ proargnames => '{slot_name,spill_txns,spill_count,spill_bytes,stream_txns,stream_count,stream_bytes,stats_reset}', prosrc => 'pg_stat_get_replication_slots' }, { oid => '6118', descr => 'statistics: information about subscription', - proname => 'pg_stat_get_subscription', proisstrict => 'f', provolatile => 's', - proparallel => 'r', prorettype => 'record', proargtypes => 'oid', + proname => 'pg_stat_get_subscription', prorows => '10', proisstrict => 'f', + proretset => 't', provolatile => 's', proparallel => 'r', + prorettype => 'record', proargtypes => 'oid', proallargtypes => '{oid,oid,oid,int4,pg_lsn,timestamptz,timestamptz,pg_lsn,timestamptz}', proargmodes => '{i,o,o,o,o,o,o,o,o}', proargnames => '{subid,subid,relid,pid,received_lsn,last_msg_send_time,last_msg_receipt_time,latest_end_lsn,latest_end_time}', |
