Content-Length: 265312 | pFad | http://github.com/postgrespro/postgres/commit/8d4b311d2494ca592e30aed03b29854d864eb846

9A Make pg_get_statisticsobjdef_expressions return NULL · postgrespro/postgres@8d4b311 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/8d4b311d2494ca592e30aed03b29854d864eb846

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy