diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2021-05-12 13:14:10 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2021-05-12 13:14:10 -0400 |
commit | def5b065ff22a16a80084587613599fe15627213 (patch) | |
tree | 13f424449b7fb90c85659071b6adf4e27ae6d272 /src/backend/utils/adt/ruleutils.c | |
parent | e6ccd1ce1644d1b40b7981f8bc172394de524f99 (diff) | |
download | postgresql-def5b065ff22a16a80084587613599fe15627213.tar.gz postgresql-def5b065ff22a16a80084587613599fe15627213.zip |
Initial pgindent and pgperltidy run for v14.
Also "make reformat-dat-files".
The only change worthy of note is that pgindent messed up the formatting
of launcher.c's struct LogicalRepWorkerId, which led me to notice that
that struct wasn't used at all anymore, so I just took it out.
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 881e8ec03d2..84ad62caea3 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -2980,37 +2980,38 @@ pg_get_functiondef(PG_FUNCTION_ARGS) } else { - appendStringInfoString(&buf, "AS "); + appendStringInfoString(&buf, "AS "); - tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_probin, &isnull); - if (!isnull) - { - simple_quote_literal(&buf, TextDatumGetCString(tmp)); - appendStringInfoString(&buf, ", "); /* assume prosrc isn't null */ - } + tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_probin, &isnull); + if (!isnull) + { + simple_quote_literal(&buf, TextDatumGetCString(tmp)); + appendStringInfoString(&buf, ", "); /* assume prosrc isn't null */ + } - tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_prosrc, &isnull); - if (isnull) - elog(ERROR, "null prosrc"); - prosrc = TextDatumGetCString(tmp); + tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_prosrc, &isnull); + if (isnull) + elog(ERROR, "null prosrc"); + prosrc = TextDatumGetCString(tmp); - /* - * We always use dollar quoting. Figure out a suitable delimiter. - * - * Since the user is likely to be editing the function body string, we - * shouldn't use a short delimiter that he might easily create a conflict - * with. Hence prefer "$function$"/"$procedure$", but extend if needed. - */ - initStringInfo(&dq); - appendStringInfoChar(&dq, '$'); - appendStringInfoString(&dq, (isfunction ? "function" : "procedure")); - while (strstr(prosrc, dq.data) != NULL) - appendStringInfoChar(&dq, 'x'); - appendStringInfoChar(&dq, '$'); - - appendBinaryStringInfo(&buf, dq.data, dq.len); - appendStringInfoString(&buf, prosrc); - appendBinaryStringInfo(&buf, dq.data, dq.len); + /* + * We always use dollar quoting. Figure out a suitable delimiter. + * + * Since the user is likely to be editing the function body string, we + * shouldn't use a short delimiter that he might easily create a + * conflict with. Hence prefer "$function$"/"$procedure$", but extend + * if needed. + */ + initStringInfo(&dq); + appendStringInfoChar(&dq, '$'); + appendStringInfoString(&dq, (isfunction ? "function" : "procedure")); + while (strstr(prosrc, dq.data) != NULL) + appendStringInfoChar(&dq, 'x'); + appendStringInfoChar(&dq, '$'); + + appendBinaryStringInfo(&buf, dq.data, dq.len); + appendStringInfoString(&buf, prosrc); + appendBinaryStringInfo(&buf, dq.data, dq.len); } appendStringInfoChar(&buf, '\n'); |