mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +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:
@ -226,7 +226,7 @@ brin_page_items(PG_FUNCTION_ARGS)
|
||||
if (ItemIdIsUsed(itemId))
|
||||
{
|
||||
dtup = brin_deform_tuple(bdesc,
|
||||
(BrinTuple *) PageGetItem(page, itemId),
|
||||
(BrinTuple *) PageGetItem(page, itemId),
|
||||
NULL);
|
||||
attno = 1;
|
||||
unusedItem = false;
|
||||
|
@ -346,7 +346,7 @@ bt_page_items(PG_FUNCTION_ARGS)
|
||||
if (RELATION_IS_OTHER_TEMP(rel))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("cannot access temporary tables of other sessions")));
|
||||
errmsg("cannot access temporary tables of other sessions")));
|
||||
|
||||
if (blkno == 0)
|
||||
elog(ERROR, "block 0 is a meta page");
|
||||
@ -442,7 +442,7 @@ bt_page_items_bytea(PG_FUNCTION_ARGS)
|
||||
if (raw_page_size < SizeOfPageHeaderData)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("input page too small (%d bytes)", raw_page_size)));
|
||||
errmsg("input page too small (%d bytes)", raw_page_size)));
|
||||
|
||||
fctx = SRF_FIRSTCALL_INIT();
|
||||
mctx = MemoryContextSwitchTo(fctx->multi_call_memory_ctx);
|
||||
|
@ -196,7 +196,7 @@ gin_leafpage_items(PG_FUNCTION_ARGS)
|
||||
if (opaq->flags != (GIN_DATA | GIN_LEAF | GIN_COMPRESSED))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("input page is not a compressed GIN data leaf page"),
|
||||
errmsg("input page is not a compressed GIN data leaf page"),
|
||||
errdetail("Flags %04X, expected %04X",
|
||||
opaq->flags,
|
||||
(GIN_DATA | GIN_LEAF | GIN_COMPRESSED))));
|
||||
|
@ -99,7 +99,7 @@ verify_hash_page(bytea *raw_page, int flags)
|
||||
case LH_BUCKET_PAGE | LH_OVERFLOW_PAGE:
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("page is not a hash bucket or overflow page")));
|
||||
errmsg("page is not a hash bucket or overflow page")));
|
||||
case LH_OVERFLOW_PAGE:
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
|
@ -84,7 +84,7 @@ text_to_bits(char *str, int len)
|
||||
else
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATA_CORRUPTED),
|
||||
errmsg("illegal character '%c' in t_bits string", str[off])));
|
||||
errmsg("illegal character '%c' in t_bits string", str[off])));
|
||||
|
||||
if (off % 8 == 7)
|
||||
bits[off / 8] = byte;
|
||||
@ -132,7 +132,7 @@ heap_page_items(PG_FUNCTION_ARGS)
|
||||
if (raw_page_size < SizeOfPageHeaderData)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("input page too small (%d bytes)", raw_page_size)));
|
||||
errmsg("input page too small (%d bytes)", raw_page_size)));
|
||||
|
||||
fctx = SRF_FIRSTCALL_INIT();
|
||||
mctx = MemoryContextSwitchTo(fctx->multi_call_memory_ctx);
|
||||
@ -236,7 +236,7 @@ heap_page_items(PG_FUNCTION_ARGS)
|
||||
bits_len =
|
||||
((tuphdr->t_infomask2 & HEAP_NATTS_MASK) / 8 + 1) * 8;
|
||||
values[11] = CStringGetTextDatum(
|
||||
bits_to_text(tuphdr->t_bits, bits_len));
|
||||
bits_to_text(tuphdr->t_bits, bits_len));
|
||||
}
|
||||
else
|
||||
nulls[11] = true;
|
||||
@ -384,7 +384,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
|
||||
if (tupdata_len != off)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATA_CORRUPTED),
|
||||
errmsg("end of tuple reached without looking at all its data")));
|
||||
errmsg("end of tuple reached without looking at all its data")));
|
||||
|
||||
return makeArrayResult(raw_attrs, CurrentMemoryContext);
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ page_checksum(PG_FUNCTION_ARGS)
|
||||
if (raw_page_size != BLCKSZ)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("incorrect size of input page (%d bytes)", raw_page_size)));
|
||||
errmsg("incorrect size of input page (%d bytes)", raw_page_size)));
|
||||
|
||||
page = (PageHeader) VARDATA(raw_page);
|
||||
|
||||
|
Reference in New Issue
Block a user