From c49d926833fa6a987e3f9a66027f4a01d7a008be Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 16 Dec 2021 12:01:59 -0500 Subject: Clean up some more freshly-dead code in pg_dump and pg_upgrade. I missed a few things in 30e7c175b and e469f0aaf, as noted by Justin Pryzby. Discussion: https://postgr.es/m/2923349.1634942313@sss.pgh.pa.us --- src/bin/pg_dump/pg_dump.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'src/bin/pg_dump/pg_dump.c') diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 15dae8bd88..784771c2d7 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -11444,19 +11444,17 @@ dumpFunc(Archive *fout, const FuncInfo *finfo) /* * See backend/commands/functioncmds.c for details of how the 'AS' clause - * is used. In 8.4 and up, an unused probin is NULL (here ""); previous - * versions would set it to "-". There are no known cases in which prosrc - * is unused, so the tests below for "-" are probably useless. + * is used. */ if (prosqlbody) { appendPQExpBufferStr(asPart, prosqlbody); } - else if (probin[0] != '\0' && strcmp(probin, "-") != 0) + else if (probin[0] != '\0') { appendPQExpBufferStr(asPart, "AS "); appendStringLiteralAH(asPart, probin, fout); - if (strcmp(prosrc, "-") != 0) + if (prosrc[0] != '\0') { appendPQExpBufferStr(asPart, ", "); @@ -11473,15 +11471,12 @@ dumpFunc(Archive *fout, const FuncInfo *finfo) } else { - if (strcmp(prosrc, "-") != 0) - { - appendPQExpBufferStr(asPart, "AS "); - /* with no bin, dollar quote src unconditionally if allowed */ - if (dopt->disable_dollar_quoting) - appendStringLiteralAH(asPart, prosrc, fout); - else - appendStringLiteralDQ(asPart, prosrc, NULL); - } + appendPQExpBufferStr(asPart, "AS "); + /* with no bin, dollar quote src unconditionally if allowed */ + if (dopt->disable_dollar_quoting) + appendStringLiteralAH(asPart, prosrc, fout); + else + appendStringLiteralDQ(asPart, prosrc, NULL); } nallargs = finfo->nargs; /* unless we learn different from allargs */ -- cgit v1.2.1