mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
@@ -572,7 +572,7 @@ RestoreArchive(Archive *AHX)
|
||||
char *mark;
|
||||
|
||||
if (strcmp(te->desc, "CONSTRAINT") == 0 ||
|
||||
strcmp(te->desc, "CHECK CONSTRAINT") == 0 ||
|
||||
strcmp(te->desc, "CHECK CONSTRAINT") == 0 ||
|
||||
strcmp(te->desc, "FK CONSTRAINT") == 0)
|
||||
strcpy(buffer, "DROP CONSTRAINT");
|
||||
else
|
||||
@@ -1650,13 +1650,13 @@ dump_lo_buf(ArchiveHandle *AH)
|
||||
|
||||
res = lo_write(AH->connection, AH->loFd, AH->lo_buf, AH->lo_buf_used);
|
||||
ahlog(AH, 5, ngettext("wrote %lu byte of large object data (result = %lu)\n",
|
||||
"wrote %lu bytes of large object data (result = %lu)\n",
|
||||
"wrote %lu bytes of large object data (result = %lu)\n",
|
||||
AH->lo_buf_used),
|
||||
(unsigned long) AH->lo_buf_used, (unsigned long) res);
|
||||
if (res != AH->lo_buf_used)
|
||||
exit_horribly(modulename,
|
||||
"could not write to large object (result: %lu, expected: %lu)\n",
|
||||
(unsigned long) res, (unsigned long) AH->lo_buf_used);
|
||||
"could not write to large object (result: %lu, expected: %lu)\n",
|
||||
(unsigned long) res, (unsigned long) AH->lo_buf_used);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1765,8 +1765,8 @@ warn_or_exit_horribly(ArchiveHandle *AH,
|
||||
{
|
||||
write_msg(modulename, "Error from TOC entry %d; %u %u %s %s %s\n",
|
||||
AH->currentTE->dumpId,
|
||||
AH->currentTE->catalogId.tableoid, AH->currentTE->catalogId.oid,
|
||||
AH->currentTE->desc, AH->currentTE->tag, AH->currentTE->owner);
|
||||
AH->currentTE->catalogId.tableoid, AH->currentTE->catalogId.oid,
|
||||
AH->currentTE->desc, AH->currentTE->tag, AH->currentTE->owner);
|
||||
}
|
||||
AH->lastErrorStage = AH->stage;
|
||||
AH->lastErrorTE = AH->currentTE;
|
||||
@@ -2559,7 +2559,7 @@ ReadToc(ArchiveHandle *AH)
|
||||
/* Sanity check */
|
||||
if (te->dumpId <= 0)
|
||||
exit_horribly(modulename,
|
||||
"entry ID %d out of range -- perhaps a corrupt TOC\n",
|
||||
"entry ID %d out of range -- perhaps a corrupt TOC\n",
|
||||
te->dumpId);
|
||||
|
||||
te->hadDumper = ReadInt(AH);
|
||||
@@ -2924,7 +2924,7 @@ _tocEntryRequired(TocEntry *te, teSection curSection, RestoreOptions *ropt)
|
||||
*/
|
||||
if (!(ropt->sequence_data && strcmp(te->desc, "SEQUENCE SET") == 0) &&
|
||||
!(ropt->binary_upgrade && strcmp(te->desc, "BLOB") == 0) &&
|
||||
!(ropt->binary_upgrade && strncmp(te->tag, "LARGE OBJECT ", 13) == 0))
|
||||
!(ropt->binary_upgrade && strncmp(te->tag, "LARGE OBJECT ", 13) == 0))
|
||||
res = res & REQ_SCHEMA;
|
||||
}
|
||||
|
||||
@@ -3270,8 +3270,8 @@ _selectTablespace(ArchiveHandle *AH, const char *tablespace)
|
||||
|
||||
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||
warn_or_exit_horribly(AH, modulename,
|
||||
"could not set default_tablespace to %s: %s",
|
||||
fmtId(want), PQerrorMessage(AH->connection));
|
||||
"could not set default_tablespace to %s: %s",
|
||||
fmtId(want), PQerrorMessage(AH->connection));
|
||||
|
||||
PQclear(res);
|
||||
}
|
||||
|
Reference in New Issue
Block a user