From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Cache by-reference missing values in a long lived context
Date: Sat, 26 Aug 2023 18:25:41 +0200
Message-ID: <20230826162541.4cny4fb6z2cvpy4j@alvherre.pgsql> (raw)
In-Reply-To: <4126204.1692970814@sss.pgh.pa.us>
On 2023-Aug-25, Tom Lane wrote:
> Another point that I wasn't thinking of yesterday is that 11 is
> still expected to compile on pre-C99 compilers. I'm not sure
> to what extent we are still able to test that -- my old animals
> have all gone to buildfarm heaven, although I see that Noah's
> AIX menagerie is still soldiering on. Were we relying on "{ 0 }"
> anywhere else pre-v12?
We have a few occurrences of {0} in initializations in pg11, so it
should work.
$ git grep '{\s*0\s*}' -- *.c
contrib/pgrowlocks/pgrowlocks.c: values[Atnum_xids] = "{0}";
contrib/pgrowlocks/pgrowlocks.c: values[Atnum_pids] = "{0}";
contrib/pgstattuple/pgstatapprox.c: output_type stat = {0};
contrib/pgstattuple/pgstattuple.c: pgstattuple_type stat = {0};
contrib/pgstattuple/pgstattuple.c: pgstattuple_type stat = {0};
src/backend/access/transam/xloginsert.c: XLogRecordBlockCompressHeader cbimg = {0};
src/backend/commands/explain.c: JitInstrumentation ji = {0};
src/backend/commands/explain.c: HashInstrumentation hinstrument = {0};
src/backend/commands/tablecmds.c: static Node bogus_marker = {0}; /* marks conflicting defaults */
src/backend/executor/execExpr.c: ExprEvalStep scratch = {0};
src/backend/executor/execExpr.c: ExprEvalStep scratch = {0};
src/backend/executor/execExpr.c: ExprEvalStep scratch = {0};
src/backend/executor/execExpr.c: ExprEvalStep scratch = {0};
src/backend/executor/execExpr.c: ExprEvalStep scratch = {0};
src/backend/executor/execExpr.c: ExprEvalStep scratch = {0};
src/backend/executor/execExpr.c: ExprEvalStep scratch2 = {0};
src/backend/executor/execExpr.c: ExprEvalStep scratch = {0};
src/backend/executor/execExpr.c: ExprEvalStep scratch = {0};
src/backend/regex/regcomp.c: /* postpone everything else pending possible {0} */
src/backend/regex/regcomp.c: /* annoying special case: {0} or {0,0} cancels everything */
src/backend/utils/adt/jsonfuncs.c: JsValue field = {0};
src/backend/utils/adt/jsonfuncs.c: JsValue jsv = {0};
src/backend/utils/adt/numeric.c:static const NumericDigit const_zero_data[1] = {0};
src/bin/pg_dump/pg_dump.c: "CASE WHEN pol.polroles = '{0}' THEN NULL ELSE "
src/bin/psql/describe.c: " || CASE WHEN polroles <> '{0}' THEN\n"
src/bin/psql/describe.c: " || CASE WHEN polroles <> '{0}' THEN\n"
src/bin/psql/describe.c: " CASE WHEN pol.polroles = '{0}' THEN NULL ELSE pg_catalog.array_to_string(array(select rolname from pg_catalog.pg_roles where oid = any (pol.polroles) order by 1),',') END,\n"
src/interfaces/ecpg/ecpglib/prepare.c:static stmtCacheEntry stmtCacheEntries[16384] = {{0, {0}, 0, 0, 0}};
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, andrew@dunslane.net, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Cache by-reference missing values in a long lived context
In-Reply-To: <20230826162541.4cny4fb6z2cvpy4j@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox