Summary:
- Remove Form*_pg_tablegroup from typedefs.list: this should have been
done by 48dc70a0775eed9d598a4c2a6ccd9ef3b965695d.
- Remove LLVMOrcLookupStateRef from typedefs.list: this should have been
done during pg15 merge according to upstream PG
def5b065ff22a16a80084587613599fe15627213. This type does come back to
the list in a future version, but remove it for now to reduce
unnecessary code changes.
- Add YB type names to yb_typedefs.list (moving a few from
typedefs.list), third-party type names to yb_thirdparty_typedefs.list,
some patterns to yb_exclude_file_patterns, and create a wrapper
yb_pgindent around pgindent that incorporates those new files. Detail
this at the top of pgindent/README. Further, add a new lint rule
file_not_unique_sorted to ensure the typedefs files are sorted.
- pgindent:
- Add -nfcb to avoid touching the word wrapping of block comments,
especially PG comments that have been indented under
!IsYugaByteEnabled. In case of single-line comments that are
indented, this unfortunately does not prevent rewrapping of those
lines.
- Allow yb_pgindent to pass file descriptors as arguments to pgindent.
- Adjust code to avoid errors when running pgindent:
- src/postgres/src/include/ybgate/: Add lint rule
bad_opening_brace_extern because violation of this rule causes
pgindent to fail on those files. Fix three violations of this.
- guc.c: Rename yb_pg_batch_detection_mechanism_options to
yb_batch_detection_mechanism_options because, for some strange
reason, pgindent gets "Statement nesting error" otherwise. Trying
all sorts of other names also makes the issue go away. Trying to
change other factors doesn't seem to make any difference. Not sure
why. While at it, discover enum name
yb_pg_batch_detection_mechanism_options doesn't make sense (it's not
an option), so change it to YbPgBatchDetection.
- yb_ysql_conn_mgr_helper.c: Create YbYsqlConnMgrShmemHeader before
function call rather than within function call.
- yb_inheritscache.h: Use #pragma once. Otherwise, pgindent deletes
the ending #endif, which causes compilation failure afterwards.
- Resolve an #ifdef NEIL in proclang.c: the functions there are not
needed. The only contentious one is DropProceduralLanguageById
because that was changed by YB master
954a64b513f7a5713709c664093cb56848bb6369 to have CatalogTupleDelete
second argument be tup. Upstream PG
b1d32d3e3230f00b5baba08f75b4f665c7d6dac6 moved this code into
DropObjectById, and the YB pg15 initial merge properly translates the
CatalogTupleDelete there to have the same transformation of second
argument to tup, so there are no problems. That's the only commit
besides upstream PG merges/imports that affects this file.
The motivation to do this now is to get rid of a usage of PLTemplate,
a type which no longer exists. So we can avoid dealing with
PLTemplate in typedefs.list.
Note:
- Avoid using third-party-extensions/hypopg typedefs.list: it has types
such as RmgrIds and xl_commit_ts_set that legitimately should be in
typedefs.list but for some reason aren't, and they aren't in
REL_17_STABLE either. Having these in typedefs files would cause YB
code to diverge with upstream PG code.
This is part of a series of commits to run pgindent. The previous
commit is 6a56ce7bcdeb0478c791efaa322b58c61007fd39.
Jira: DB-14923
Test Plan:
On Almalinux 8, ~/code/postgres containing upstream postgres code at
REL_15_2,
#!/usr/bin/env bash
set -eu
shopt -s globstar
diff src/postgres/src/tools/pgindent/typedefs.list ~/code/postgres/src/tools/pgindent/typedefs.list
arc lint src/postgres/src/tools/pgindent/yb*typedefs.list
set +e
if arc lint src/postgres/**/*.h | grep bad_opening_brace_extern; then
exit 1
fi
Close: #25663
Jenkins: compile only
Reviewers: patnaik.balivada
Reviewed By: patnaik.balivada
Subscribers: patnaik.balivada, yql
Differential Revision: https://phorge.dev.yugabyte.com/D41274