at 25.11-pre 54 lines 1.9 kB view raw
1Empty the pg_config system information view. This view keeps references to 2several -dev outputs, which we want to avoid to keep closure size down. 3 4The alternative to this patch would be to nuke references across the board, 5but this will also affect the output of the pg_config utility. By emptying 6the view only, we keep the pg_config binary intact. It resides in the -dev 7output, so it's fine to have all those references there. 8 9--- 10--- a/src/backend/utils/misc/pg_config.c 11+++ b/src/backend/utils/misc/pg_config.c 12@@ -32,20 +32,5 @@ pg_config(PG_FUNCTION_ARGS) 13 /* initialize our tuplestore */ 14 InitMaterializedSRF(fcinfo, 0); 15 16- configdata = get_configdata(my_exec_path, &configdata_len); 17- for (i = 0; i < configdata_len; i++) 18- { 19- Datum values[2]; 20- bool nulls[2]; 21- 22- memset(values, 0, sizeof(values)); 23- memset(nulls, 0, sizeof(nulls)); 24- 25- values[0] = CStringGetTextDatum(configdata[i].name); 26- values[1] = CStringGetTextDatum(configdata[i].setting); 27- 28- tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls); 29- } 30- 31 return (Datum) 0; 32 } 33--- a/src/test/regress/expected/sysviews.out 34+++ b/src/test/regress/expected/sysviews.out 35@@ -29,7 +29,7 @@ select name, ident, parent, level, total_bytes >= free_bytes 36 (1 row) 37 38 -- At introduction, pg_config had 23 entries; it may grow 39-select count(*) > 20 as ok from pg_config; 40+select count(*) = 0 as ok from pg_config; 41 ok 42 ---- 43 t 44--- a/src/test/regress/sql/sysviews.sql 45+++ b/src/test/regress/sql/sysviews.sql 46@@ -18,7 +18,7 @@ select name, ident, parent, level, total_bytes >= free_bytes 47 from pg_backend_memory_contexts where level = 0; 48 49 -- At introduction, pg_config had 23 entries; it may grow 50-select count(*) > 20 as ok from pg_config; 51+select count(*) = 0 as ok from pg_config; 52 53 -- We expect no cursors in this test; see also portals.sql 54 select count(*) = 0 as ok from pg_cursors;