Skip to content

Commit 8d4b311

Browse files
committed
Make pg_get_statisticsobjdef_expressions return NULL
The usual behavior for functions in ruleutils.c is to return NULL when the object does not exist. pg_get_statisticsobjdef_expressions raised an error instead, so correct that. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20210505210947.GA27406%40telsasoft.com
1 parent b65431c commit 8d4b311

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/ruleutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,9 +1759,9 @@ pg_get_statisticsobjdef_expressions(PG_FUNCTION_ARGS)
17591759
statexttup = SearchSysCache1(STATEXTOID, ObjectIdGetDatum(statextid));
17601760

17611761
if (!HeapTupleIsValid(statexttup))
1762-
elog(ERROR, "cache lookup failed for statistics object %u", statextid);
1762+
PG_RETURN_NULL();
17631763

1764-
/* has the statistics expressions? */
1764+
/* Does the stats object have expressions? */
17651765
has_exprs = !heap_attisnull(statexttup, Anum_pg_statistic_ext_stxexprs, NULL);
17661766

17671767
/* no expressions? we're done */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy