mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files. This set of diffs is a bit larger than typical. We've updated to pg_bsd_indent 2.1.2, which properly indents variable declarations that have multi-line initialization expressions (the continuation lines are now indented one tab stop). We've also updated to perltidy version 20230309 and changed some of its settings, which reduces its desire to add whitespace to lines to make assignments etc. line up. Going forward, that should make for fewer random-seeming changes to existing code. Discussion: https://postgr.es/m/20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql
This commit is contained in:
12
src/backend/utils/cache/lsyscache.c
vendored
12
src/backend/utils/cache/lsyscache.c
vendored
@@ -3603,7 +3603,7 @@ char *
|
||||
get_publication_name(Oid pubid, bool missing_ok)
|
||||
{
|
||||
HeapTuple tup;
|
||||
char *pubname;
|
||||
char *pubname;
|
||||
Form_pg_publication pubform;
|
||||
|
||||
tup = SearchSysCache1(PUBLICATIONOID, ObjectIdGetDatum(pubid));
|
||||
@@ -3630,16 +3630,16 @@ get_publication_name(Oid pubid, bool missing_ok)
|
||||
* return InvalidOid.
|
||||
*/
|
||||
Oid
|
||||
get_subscription_oid(const char* subname, bool missing_ok)
|
||||
get_subscription_oid(const char *subname, bool missing_ok)
|
||||
{
|
||||
Oid oid;
|
||||
|
||||
oid = GetSysCacheOid2(SUBSCRIPTIONNAME, Anum_pg_subscription_oid,
|
||||
MyDatabaseId, CStringGetDatum(subname));
|
||||
MyDatabaseId, CStringGetDatum(subname));
|
||||
if (!OidIsValid(oid) && !missing_ok)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("subscription \"%s\" does not exist", subname)));
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("subscription \"%s\" does not exist", subname)));
|
||||
return oid;
|
||||
}
|
||||
|
||||
@@ -3653,7 +3653,7 @@ char *
|
||||
get_subscription_name(Oid subid, bool missing_ok)
|
||||
{
|
||||
HeapTuple tup;
|
||||
char* subname;
|
||||
char *subname;
|
||||
Form_pg_subscription subform;
|
||||
|
||||
tup = SearchSysCache1(SUBSCRIPTIONOID, ObjectIdGetDatum(subid));
|
||||
|
||||
22
src/backend/utils/cache/relcache.c
vendored
22
src/backend/utils/cache/relcache.c
vendored
@@ -3084,10 +3084,10 @@ static void
|
||||
AssertPendingSyncConsistency(Relation relation)
|
||||
{
|
||||
bool relcache_verdict =
|
||||
RelationIsPermanent(relation) &&
|
||||
((relation->rd_createSubid != InvalidSubTransactionId &&
|
||||
RELKIND_HAS_STORAGE(relation->rd_rel->relkind)) ||
|
||||
relation->rd_firstRelfilelocatorSubid != InvalidSubTransactionId);
|
||||
RelationIsPermanent(relation) &&
|
||||
((relation->rd_createSubid != InvalidSubTransactionId &&
|
||||
RELKIND_HAS_STORAGE(relation->rd_rel->relkind)) ||
|
||||
relation->rd_firstRelfilelocatorSubid != InvalidSubTransactionId);
|
||||
|
||||
Assert(relcache_verdict == RelFileLocatorSkippingWAL(relation->rd_locator));
|
||||
|
||||
@@ -3765,12 +3765,12 @@ RelationSetNewRelfilenumber(Relation relation, char persistence)
|
||||
*/
|
||||
if (IsBinaryUpgrade)
|
||||
{
|
||||
SMgrRelation srel;
|
||||
SMgrRelation srel;
|
||||
|
||||
/*
|
||||
* During a binary upgrade, we use this code path to ensure that
|
||||
* pg_largeobject and its index have the same relfilenumbers as in
|
||||
* the old cluster. This is necessary because pg_upgrade treats
|
||||
* pg_largeobject and its index have the same relfilenumbers as in the
|
||||
* old cluster. This is necessary because pg_upgrade treats
|
||||
* pg_largeobject like a user table, not a system table. It is however
|
||||
* possible that a table or index may need to end up with the same
|
||||
* relfilenumber in the new cluster as what it had in the old cluster.
|
||||
@@ -5171,8 +5171,8 @@ RelationGetIndexAttrBitmap(Relation relation, IndexAttrBitmapKind attrKind)
|
||||
Bitmapset *uindexattrs; /* columns in unique indexes */
|
||||
Bitmapset *pkindexattrs; /* columns in the primary index */
|
||||
Bitmapset *idindexattrs; /* columns in the replica identity */
|
||||
Bitmapset *hotblockingattrs; /* columns with HOT blocking indexes */
|
||||
Bitmapset *summarizedattrs; /* columns with summarizing indexes */
|
||||
Bitmapset *hotblockingattrs; /* columns with HOT blocking indexes */
|
||||
Bitmapset *summarizedattrs; /* columns with summarizing indexes */
|
||||
List *indexoidlist;
|
||||
List *newindexoidlist;
|
||||
Oid relpkindex;
|
||||
@@ -5314,8 +5314,8 @@ restart:
|
||||
* when the column value changes, thus require a separate
|
||||
* attribute bitmapset.
|
||||
*
|
||||
* Obviously, non-key columns couldn't be referenced by
|
||||
* foreign key or identity key. Hence we do not include them into
|
||||
* Obviously, non-key columns couldn't be referenced by foreign
|
||||
* key or identity key. Hence we do not include them into
|
||||
* uindexattrs, pkindexattrs and idindexattrs bitmaps.
|
||||
*/
|
||||
if (attrnum != 0)
|
||||
|
||||
10
src/backend/utils/cache/relmapper.c
vendored
10
src/backend/utils/cache/relmapper.c
vendored
@@ -801,11 +801,11 @@ read_relmap_file(RelMapFile *map, char *dbpath, bool lock_held, int elevel)
|
||||
/*
|
||||
* Open the target file.
|
||||
*
|
||||
* Because Windows isn't happy about the idea of renaming over a file
|
||||
* that someone has open, we only open this file after acquiring the lock,
|
||||
* and for the same reason, we close it before releasing the lock. That
|
||||
* way, by the time write_relmap_file() acquires an exclusive lock, no
|
||||
* one else will have it open.
|
||||
* Because Windows isn't happy about the idea of renaming over a file that
|
||||
* someone has open, we only open this file after acquiring the lock, and
|
||||
* for the same reason, we close it before releasing the lock. That way,
|
||||
* by the time write_relmap_file() acquires an exclusive lock, no one else
|
||||
* will have it open.
|
||||
*/
|
||||
snprintf(mapfilename, sizeof(mapfilename), "%s/%s", dbpath,
|
||||
RELMAPPER_FILENAME);
|
||||
|
||||
Reference in New Issue
Block a user