mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
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.
This commit is contained in:
@ -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, '$');
|
||||
/*
|
||||
* 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);
|
||||
appendBinaryStringInfo(&buf, dq.data, dq.len);
|
||||
appendStringInfoString(&buf, prosrc);
|
||||
appendBinaryStringInfo(&buf, dq.data, dq.len);
|
||||
}
|
||||
|
||||
appendStringInfoChar(&buf, '\n');
|
||||
|
Reference in New Issue
Block a user