diff options
author | Bruce Momjian <bruce@momjian.us> | 2017-05-17 16:31:56 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2017-05-17 16:31:56 -0400 |
commit | a6fd7b7a5f7bf3a8aa3f3d076cf09d922c1c6dd2 (patch) | |
tree | d10454411c05d459abe06df161ab3c1156c5f477 /contrib | |
parent | 8a943324780259757c77c56cfc597347d1150cdb (diff) | |
download | postgresql-a6fd7b7a5f7bf3a8aa3f3d076cf09d922c1c6dd2.tar.gz postgresql-a6fd7b7a5f7bf3a8aa3f3d076cf09d922c1c6dd2.zip |
Post-PG 10 beta1 pgindent run
perltidy run not included.
Diffstat (limited to 'contrib')
35 files changed, 145 insertions, 135 deletions
diff --git a/contrib/bloom/blinsert.c b/contrib/bloom/blinsert.c index 913f1f8a518..0d506e3c1ad 100644 --- a/contrib/bloom/blinsert.c +++ b/contrib/bloom/blinsert.c @@ -165,11 +165,11 @@ blbuildempty(Relation index) BloomFillMetapage(index, metapage); /* - * Write the page and log it. It might seem that an immediate sync - * would be sufficient to guarantee that the file exists on disk, but - * recovery itself might remove it while replaying, for example, an - * XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record. Therefore, we - * need this even when wal_level=minimal. + * Write the page and log it. It might seem that an immediate sync would + * be sufficient to guarantee that the file exists on disk, but recovery + * itself might remove it while replaying, for example, an + * XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record. Therefore, we need + * this even when wal_level=minimal. */ PageSetChecksumInplace(metapage, BLOOM_METAPAGE_BLKNO); smgrwrite(index->rd_smgr, INIT_FORKNUM, BLOOM_METAPAGE_BLKNO, diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c index f2eda67e0ae..00a65875b03 100644 --- a/contrib/bloom/blutils.c +++ b/contrib/bloom/blutils.c @@ -75,7 +75,7 @@ _PG_init(void) bl_relopt_tab[i + 1].optname = MemoryContextStrdup(TopMemoryContext, buf); bl_relopt_tab[i + 1].opttype = RELOPT_TYPE_INT; - bl_relopt_tab[i + 1].offset = offsetof(BloomOptions, bitSize[0]) + sizeof(int) * i; + bl_relopt_tab[i + 1].offset = offsetof(BloomOptions, bitSize[0]) +sizeof(int) * i; } } diff --git a/contrib/btree_gin/btree_gin.c b/contrib/btree_gin/btree_gin.c index 7191fbf54f7..6f0c752b2e8 100644 --- a/contrib/btree_gin/btree_gin.c +++ b/contrib/btree_gin/btree_gin.c @@ -112,13 +112,13 @@ gin_btree_compare_prefix(FunctionCallInfo fcinfo) cmp; cmp = DatumGetInt32(CallerFInfoFunctionCall2( - data->typecmp, - fcinfo->flinfo, - PG_GET_COLLATION(), - (data->strategy == BTLessStrategyNumber || - data->strategy == BTLessEqualStrategyNumber) - ? data->datum : a, - b)); + data->typecmp, + fcinfo->flinfo, + PG_GET_COLLATION(), + (data->strategy == BTLessStrategyNumber || + data->strategy == BTLessEqualStrategyNumber) + ? data->datum : a, + b)); switch (data->strategy) { @@ -438,16 +438,16 @@ GIN_SUPPORT(numeric, true, leftmostvalue_numeric, gin_numeric_cmp) */ -#define ENUM_IS_LEFTMOST(x) ((x) == InvalidOid) +#define ENUM_IS_LEFTMOST(x) ((x) == InvalidOid) PG_FUNCTION_INFO_V1(gin_enum_cmp); Datum gin_enum_cmp(PG_FUNCTION_ARGS) { - Oid a = PG_GETARG_OID(0); - Oid b = PG_GETARG_OID(1); - int res = 0; + Oid a = PG_GETARG_OID(0); + Oid b = PG_GETARG_OID(1); + int res = 0; if (ENUM_IS_LEFTMOST(a)) { @@ -460,11 +460,11 @@ gin_enum_cmp(PG_FUNCTION_ARGS) else { res = DatumGetInt32(CallerFInfoFunctionCall2( - enum_cmp, - fcinfo->flinfo, - PG_GET_COLLATION(), - ObjectIdGetDatum(a), - ObjectIdGetDatum(b))); + enum_cmp, + fcinfo->flinfo, + PG_GET_COLLATION(), + ObjectIdGetDatum(a), + ObjectIdGetDatum(b))); } PG_RETURN_INT32(res); diff --git a/contrib/btree_gist/btree_cash.c b/contrib/btree_gist/btree_cash.c index ca0c86b5d82..1116ca084f3 100644 --- a/contrib/btree_gist/btree_cash.c +++ b/contrib/btree_gist/btree_cash.c @@ -170,7 +170,7 @@ gbt_cash_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c index c9daf340976..28c7c2ac861 100644 --- a/contrib/btree_gist/btree_date.c +++ b/contrib/btree_gist/btree_date.c @@ -182,7 +182,7 @@ gbt_date_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_enum.c b/contrib/btree_gist/btree_enum.c index 5e46e782bef..8bbadfe860c 100644 --- a/contrib/btree_gist/btree_enum.c +++ b/contrib/btree_gist/btree_enum.c @@ -32,14 +32,14 @@ static bool gbt_enumgt(const void *a, const void *b, FmgrInfo *flinfo) { return DatumGetBool( - CallerFInfoFunctionCall2(enum_gt, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b))) + CallerFInfoFunctionCall2(enum_gt, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b))) ); } static bool gbt_enumge(const void *a, const void *b, FmgrInfo *flinfo) { return DatumGetBool( - CallerFInfoFunctionCall2(enum_ge, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b))) + CallerFInfoFunctionCall2(enum_ge, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b))) ); } static bool @@ -74,12 +74,12 @@ gbt_enumkey_cmp(const void *a, const void *b, FmgrInfo *flinfo) return 0; return DatumGetInt32( - CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->upper), ObjectIdGetDatum(ib->upper)) + CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->upper), ObjectIdGetDatum(ib->upper)) ); } return DatumGetInt32( - CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->lower), ObjectIdGetDatum(ib->lower)) + CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->lower), ObjectIdGetDatum(ib->lower)) ); } @@ -94,7 +94,7 @@ static const gbtree_ninfo tinfo = gbt_enumle, gbt_enumlt, gbt_enumkey_cmp, - NULL /* no KNN support at least for now */ + NULL /* no KNN support at least for now */ }; diff --git a/contrib/btree_gist/btree_float4.c b/contrib/btree_gist/btree_float4.c index 46b3edbab3b..fe6993c226c 100644 --- a/contrib/btree_gist/btree_float4.c +++ b/contrib/btree_gist/btree_float4.c @@ -163,7 +163,7 @@ gbt_float4_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_float8.c b/contrib/btree_gist/btree_float8.c index 7d653075c57..13153d811fd 100644 --- a/contrib/btree_gist/btree_float8.c +++ b/contrib/btree_gist/btree_float8.c @@ -170,7 +170,7 @@ gbt_float8_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c index 7c95ee68145..e1561b37b73 100644 --- a/contrib/btree_gist/btree_inet.c +++ b/contrib/btree_gist/btree_inet.c @@ -133,7 +133,7 @@ gbt_inet_consistent(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, - &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); + &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c index 3dae5e7c61d..0a4498a693a 100644 --- a/contrib/btree_gist/btree_int2.c +++ b/contrib/btree_gist/btree_int2.c @@ -170,7 +170,7 @@ gbt_int2_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c index 213bfa3323f..b29cbc81a3e 100644 --- a/contrib/btree_gist/btree_int4.c +++ b/contrib/btree_gist/btree_int4.c @@ -171,7 +171,7 @@ gbt_int4_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_int8.c b/contrib/btree_gist/btree_int8.c index 62b079bba69..df1f5338c84 100644 --- a/contrib/btree_gist/btree_int8.c +++ b/contrib/btree_gist/btree_int8.c @@ -171,7 +171,7 @@ gbt_int8_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c index f41f471bf6e..e4dd9e4238a 100644 --- a/contrib/btree_gist/btree_interval.c +++ b/contrib/btree_gist/btree_interval.c @@ -245,7 +245,7 @@ gbt_intv_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c index e588faa15a3..e0d6f2adf18 100644 --- a/contrib/btree_gist/btree_oid.c +++ b/contrib/btree_gist/btree_oid.c @@ -171,7 +171,7 @@ gbt_oid_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c index a4a1ad5aebc..5eec8323f55 100644 --- a/contrib/btree_gist/btree_time.c +++ b/contrib/btree_gist/btree_time.c @@ -235,7 +235,7 @@ gbt_time_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c index 13bc39424b2..592466c948a 100644 --- a/contrib/btree_gist/btree_ts.c +++ b/contrib/btree_gist/btree_ts.c @@ -283,7 +283,7 @@ gbt_ts_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk->upper; PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } @@ -328,7 +328,7 @@ gbt_tstz_distance(PG_FUNCTION_ARGS) qqq = tstz_to_ts_gmt(query); PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/btree_gist/btree_utils_num.h b/contrib/btree_gist/btree_utils_num.h index 17561fa9e4e..8aab19396c4 100644 --- a/contrib/btree_gist/btree_utils_num.h +++ b/contrib/btree_gist/btree_utils_num.h @@ -42,13 +42,13 @@ typedef struct /* Methods */ - bool (*f_gt) (const void *, const void *, FmgrInfo *); /* greater than */ - bool (*f_ge) (const void *, const void *, FmgrInfo *); /* greater or equal */ - bool (*f_eq) (const void *, const void *, FmgrInfo *); /* equal */ - bool (*f_le) (const void *, const void *, FmgrInfo *); /* less or equal */ - bool (*f_lt) (const void *, const void *, FmgrInfo *); /* less than */ - int (*f_cmp) (const void *, const void *, FmgrInfo *); /* key compare function */ - float8 (*f_dist) (const void *, const void *, FmgrInfo *); /* key distance function */ + bool (*f_gt) (const void *, const void *, FmgrInfo *); /* greater than */ + bool (*f_ge) (const void *, const void *, FmgrInfo *); /* greater or equal */ + bool (*f_eq) (const void *, const void *, FmgrInfo *); /* equal */ + bool (*f_le) (const void *, const void *, FmgrInfo *); /* less or equal */ + bool (*f_lt) (const void *, const void *, FmgrInfo *); /* less than */ + int (*f_cmp) (const void *, const void *, FmgrInfo *); /* key compare function */ + float8 (*f_dist) (const void *, const void *, FmgrInfo *); /* key distance function */ } gbtree_ninfo; diff --git a/contrib/btree_gist/btree_utils_var.c b/contrib/btree_gist/btree_utils_var.c index e0b4b377796..3648adccef7 100644 --- a/contrib/btree_gist/btree_utils_var.c +++ b/contrib/btree_gist/btree_utils_var.c @@ -25,7 +25,7 @@ typedef struct { const gbtree_vinfo *tinfo; Oid collation; - FmgrInfo *flinfo; + FmgrInfo *flinfo; } gbt_vsrt_arg; @@ -402,8 +402,8 @@ gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n, *res = 0.0; else if (!(((*tinfo->f_cmp) (nk.lower, ok.lower, collation, flinfo) >= 0 || gbt_bytea_pf_match(ok.lower, nk.lower, tinfo)) && - ((*tinfo->f_cmp) (nk.upper, ok.upper, collation, flinfo) <= 0 || - gbt_bytea_pf_match(ok.upper, nk.upper, tinfo)))) + ((*tinfo->f_cmp) (nk.upper, ok.upper, collation, flinfo) <= 0 || + gbt_bytea_pf_match(ok.upper, nk.upper, tinfo)))) { Datum d = PointerGetDatum(0); double dres; diff --git a/contrib/btree_gist/btree_utils_var.h b/contrib/btree_gist/btree_utils_var.h index fbc76ce7385..04a356276bf 100644 --- a/contrib/btree_gist/btree_utils_var.h +++ b/contrib/btree_gist/btree_utils_var.h @@ -34,12 +34,12 @@ typedef struct /* Methods */ - bool (*f_gt) (const void *, const void *, Oid, FmgrInfo *); /* greater than */ - bool (*f_ge) (const void *, const void *, Oid, FmgrInfo *); /* greater equal */ - bool (*f_eq) (const void *, const void *, Oid, FmgrInfo *); /* equal */ - bool (*f_le) (const void *, const void *, Oid, FmgrInfo *); /* less equal */ - bool (*f_lt) (const void *, const void *, Oid, FmgrInfo *); /* less than */ - int32 (*f_cmp) (const void *, const void *, Oid, FmgrInfo *); /* compare */ + bool (*f_gt) (const void *, const void *, Oid, FmgrInfo *); /* greater than */ + bool (*f_ge) (const void *, const void *, Oid, FmgrInfo *); /* greater equal */ + bool (*f_eq) (const void *, const void *, Oid, FmgrInfo *); /* equal */ + bool (*f_le) (const void *, const void *, Oid, FmgrInfo *); /* less equal */ + bool (*f_lt) (const void *, const void *, Oid, FmgrInfo *); /* less than */ + int32 (*f_cmp) (const void *, const void *, Oid, FmgrInfo *); /* compare */ GBT_VARKEY *(*f_l2n) (GBT_VARKEY *, FmgrInfo *flinfo); /* convert leaf to node */ } gbtree_vinfo; diff --git a/contrib/btree_gist/btree_uuid.c b/contrib/btree_gist/btree_uuid.c index 5ed80925d3e..e67b8cc9898 100644 --- a/contrib/btree_gist/btree_uuid.c +++ b/contrib/btree_gist/btree_uuid.c @@ -150,7 +150,7 @@ gbt_uuid_consistent(PG_FUNCTION_ARGS) PG_RETURN_BOOL( gbt_num_consistent(&key, (void *) query, &strategy, - GIST_LEAF(entry), &tinfo, fcinfo->flinfo) + GIST_LEAF(entry), &tinfo, fcinfo->flinfo) ); } diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index 44b67daedba..a6a3c09ff8e 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -113,7 +113,7 @@ static char *generate_relation_name(Relation rel); static void dblink_connstr_check(const char *connstr); static void dblink_security_check(PGconn *conn, remoteConn *rconn); static void dblink_res_error(PGconn *conn, const char *conname, PGresult *res, - const char *dblink_context_msg, bool fail); + const char *dblink_context_msg, bool fail); static char *get_connect_string(const char *servername); static char *escape_param_str(const char *from); static void validate_pkattnums(Relation rel, @@ -152,16 +152,19 @@ xpstrdup(const char *in) return pstrdup(in); } -static void pg_attribute_noreturn() +static void +pg_attribute_noreturn() dblink_res_internalerror(PGconn *conn, PGresult *res, const char *p2) { char *msg = pchomp(PQerrorMessage(conn)); + if (res) PQclear(res); elog(ERROR, "%s: %s", p2, msg); } -static void pg_attribute_noreturn() +static void +pg_attribute_noreturn() dblink_conn_not_avail(const char *conname) { if (conname) @@ -176,7 +179,7 @@ dblink_conn_not_avail(const char *conname) static void dblink_get_conn(char *conname_or_str, - PGconn * volatile *conn_p, char **conname_p, volatile bool *freeconn_p) + PGconn *volatile * conn_p, char **conname_p, volatile bool *freeconn_p) { remoteConn *rconn = getConnectionByName(conname_or_str); PGconn *conn; @@ -201,11 +204,12 @@ dblink_get_conn(char *conname_or_str, if (PQstatus(conn) == CONNECTION_BAD) { char *msg = pchomp(PQerrorMessage(conn)); + PQfinish(conn); ereport(ERROR, - (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION), - errmsg("could not establish connection"), - errdetail_internal("%s", msg))); + (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION), + errmsg("could not establish connection"), + errdetail_internal("%s", msg))); } dblink_security_check(conn, rconn); if (PQclientEncoding(conn) != GetDatabaseEncoding()) @@ -223,11 +227,12 @@ static PGconn * dblink_get_named_conn(const char *conname) { remoteConn *rconn = getConnectionByName(conname); + if (rconn) return rconn->conn; dblink_conn_not_avail(conname); - return NULL; /* keep compiler quiet */ + return NULL; /* keep compiler quiet */ } static void @@ -2699,9 +2704,9 @@ dblink_res_error(PGconn *conn, const char *conname, PGresult *res, message_context = xpstrdup(pg_diag_context); /* - * If we don't get a message from the PGresult, try the PGconn. This - * is needed because for connection-level failures, PQexec may just - * return NULL, not a PGresult at all. + * If we don't get a message from the PGresult, try the PGconn. This is + * needed because for connection-level failures, PQexec may just return + * NULL, not a PGresult at all. */ if (message_primary == NULL) message_primary = pchomp(PQerrorMessage(conn)); @@ -2732,7 +2737,7 @@ get_connect_string(const char *servername) ForeignServer *foreign_server = NULL; UserMapping *user_mapping; ListCell *cell; - StringInfoData buf; + StringInfoData buf; ForeignDataWrapper *fdw; AclResult aclresult; char *srvname; @@ -2820,7 +2825,7 @@ static char * escape_param_str(const char *str) { const char *cp; - StringInfoData buf; + StringInfoData buf; initStringInfo(&buf); diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c index ec93e4b8d0a..aab71aed2fa 100644 --- a/contrib/oid2name/oid2name.c +++ b/contrib/oid2name/oid2name.c @@ -507,7 +507,7 @@ sql_exec_searchtables(PGconn *conn, struct options * opts) todo = psprintf( "SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s\n" "FROM pg_catalog.pg_class c\n" - " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n" + " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n" " LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database(),\n" " pg_catalog.pg_tablespace t\n" "WHERE relkind IN (" CppAsString2(RELKIND_RELATION) "," diff --git a/contrib/pageinspect/brinfuncs.c b/contrib/pageinspect/brinfuncs.c index dc9cc2d09aa..d52807dcdd6 100644 --- a/contrib/pageinspect/brinfuncs.c +++ b/contrib/pageinspect/brinfuncs.c @@ -226,8 +226,8 @@ brin_page_items(PG_FUNCTION_ARGS) if (ItemIdIsUsed(itemId)) { dtup = brin_deform_tuple(bdesc, - (BrinTuple *) PageGetItem(page, itemId), - NULL); + (BrinTuple *) PageGetItem(page, itemId), + NULL); attno = 1; unusedItem = false; } diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c index 6e52969fd34..228a147c9e8 100644 --- a/contrib/pageinspect/hashfuncs.c +++ b/contrib/pageinspect/hashfuncs.c @@ -34,10 +34,10 @@ PG_FUNCTION_INFO_V1(hash_metapage_info); */ typedef struct HashPageStat { - int live_items; - int dead_items; - int page_size; - int free_size; + int live_items; + int dead_items; + int page_size; + int free_size; /* opaque data */ BlockNumber hasho_prevblkno; @@ -45,7 +45,7 @@ typedef struct HashPageStat Bucket hasho_bucket; uint16 hasho_flag; uint16 hasho_page_id; -} HashPageStat; +} HashPageStat; /* @@ -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), @@ -107,7 +107,7 @@ verify_hash_page(bytea *raw_page, int flags) default: elog(ERROR, "hash page of type %08x not in mask %08x", - pagetype, flags); + pagetype, flags); } } @@ -143,7 +143,7 @@ verify_hash_page(bytea *raw_page, int flags) * ------------------------------------------------- */ static void -GetHashPageStatistics(Page page, HashPageStat * stat) +GetHashPageStatistics(Page page, HashPageStat *stat) { OffsetNumber maxoff = PageGetMaxOffsetNumber(page); HashPageOpaque opaque = (HashPageOpaque) PageGetSpecialPointer(page); @@ -515,8 +515,8 @@ hash_metapage_info(PG_FUNCTION_ARGS) j; Datum values[16]; bool nulls[16]; - Datum spares[HASH_MAX_SPLITPOINTS]; - Datum mapp[HASH_MAX_BITMAPS]; + Datum spares[HASH_MAX_SPLITPOINTS]; + Datum mapp[HASH_MAX_BITMAPS]; if (!superuser()) ereport(ERROR, diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c index 631e435a939..f273dfa7cb2 100644 --- a/contrib/pageinspect/rawpage.c +++ b/contrib/pageinspect/rawpage.c @@ -311,9 +311,9 @@ 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); - PG_RETURN_INT16(pg_checksum_page((char *)page, blkno)); + PG_RETURN_INT16(pg_checksum_page((char *) page, blkno)); } diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c index 57030323979..c37eaa395da 100644 --- a/contrib/pg_standby/pg_standby.c +++ b/contrib/pg_standby/pg_standby.c @@ -57,7 +57,7 @@ char *xlogFilePath; /* where we are going to restore to */ char *nextWALFileName; /* the file we need to get from archive */ char *restartWALFileName; /* the file from which we can restart restore */ char *priorWALFileName; /* the file we need to get from archive */ -char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */ +char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */ char restoreCommand[MAXPGPATH]; /* run this to restore */ char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to * get from archive */ diff --git a/contrib/pg_visibility/pg_visibility.c b/contrib/pg_visibility/pg_visibility.c index ee3936e09a9..480f917d087 100644 --- a/contrib/pg_visibility/pg_visibility.c +++ b/contrib/pg_visibility/pg_visibility.c @@ -774,6 +774,6 @@ check_relation_relkind(Relation rel) rel->rd_rel->relkind != RELKIND_TOASTVALUE) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("\"%s\" is not a table, materialized view, or TOAST table", - RelationGetRelationName(rel)))); + errmsg("\"%s\" is not a table, materialized view, or TOAST table", + RelationGetRelationName(rel)))); } diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c index 8063f342270..f71a933407d 100644 --- a/contrib/pgcrypto/openssl.c +++ b/contrib/pgcrypto/openssl.c @@ -238,7 +238,7 @@ px_find_digest(const char *name, PX_MD **res) * prototype for the EVP functions that return an algorithm, e.g. * EVP_aes_128_cbc(). */ -typedef const EVP_CIPHER *(*ossl_EVP_cipher_func)(void); +typedef const EVP_CIPHER *(*ossl_EVP_cipher_func) (void); /* * ossl_cipher contains the static information about each cipher. @@ -706,13 +706,15 @@ static const struct ossl_cipher ossl_cast_cbc = { static const struct ossl_cipher ossl_aes_ecb = { ossl_aes_ecb_init, - NULL, /* EVP_aes_XXX_ecb(), determined in init function */ + NULL, /* EVP_aes_XXX_ecb(), determined in init + * function */ 128 / 8, 256 / 8 }; static const struct ossl_cipher ossl_aes_cbc = { ossl_aes_cbc_init, - NULL, /* EVP_aes_XXX_cbc(), determined in init function */ + NULL, /* EVP_aes_XXX_cbc(), determined in init + * function */ 128 / 8, 256 / 8 }; diff --git a/contrib/pgcrypto/pgcrypto.c b/contrib/pgcrypto/pgcrypto.c index ccfdc20ed72..4e3516a86ad 100644 --- a/contrib/pgcrypto/pgcrypto.c +++ b/contrib/pgcrypto/pgcrypto.c @@ -454,8 +454,8 @@ pg_random_uuid(PG_FUNCTION_ARGS) uint8 *buf = (uint8 *) palloc(UUID_LEN); /* - * Generate random bits. pg_backend_random() will do here, we don't - * promis UUIDs to be cryptographically random, when built with + * Generate random bits. pg_backend_random() will do here, we don't promis + * UUIDs to be cryptographically random, when built with * --disable-strong-random. */ if (!pg_backend_random((char *) buf, UUID_LEN)) diff --git a/contrib/pgrowlocks/pgrowlocks.c b/contrib/pgrowlocks/pgrowlocks.c index 8dd561c02ad..00e2015c5c9 100644 --- a/contrib/pgrowlocks/pgrowlocks.c +++ b/contrib/pgrowlocks/pgrowlocks.c @@ -99,7 +99,10 @@ pgrowlocks(PG_FUNCTION_ARGS) relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = heap_openrv(relrv, AccessShareLock); - /* check permissions: must have SELECT on table or be in pg_stat_scan_tables */ + /* + * check permissions: must have SELECT on table or be in + * pg_stat_scan_tables + */ aclresult = pg_class_aclcheck(RelationGetRelid(rel), GetUserId(), ACL_SELECT); if (aclresult != ACLCHECK_OK) diff --git a/contrib/pgstattuple/pgstatapprox.c b/contrib/pgstattuple/pgstatapprox.c index 46c167a96a5..9facf651378 100644 --- a/contrib/pgstattuple/pgstatapprox.c +++ b/contrib/pgstattuple/pgstatapprox.c @@ -31,7 +31,7 @@ PG_FUNCTION_INFO_V1(pgstattuple_approx); PG_FUNCTION_INFO_V1(pgstattuple_approx_v1_5); -Datum pgstattuple_approx_internal(Oid relid, FunctionCallInfo fcinfo); +Datum pgstattuple_approx_internal(Oid relid, FunctionCallInfo fcinfo); typedef struct output_type { diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c index 15aedec1bfd..03b387f6b6b 100644 --- a/contrib/pgstattuple/pgstatindex.c +++ b/contrib/pgstattuple/pgstatindex.c @@ -64,7 +64,7 @@ PG_FUNCTION_INFO_V1(pg_relpages_v1_5); PG_FUNCTION_INFO_V1(pg_relpagesbyid_v1_5); PG_FUNCTION_INFO_V1(pgstatginindex_v1_5); -Datum pgstatginindex_internal(Oid relid, FunctionCallInfo fcinfo); +Datum pgstatginindex_internal(Oid relid, FunctionCallInfo fcinfo); #define IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX) #define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID) @@ -113,17 +113,17 @@ typedef struct GinIndexStat */ typedef struct HashIndexStat { - int32 version; - int32 space_per_page; + int32 version; + int32 space_per_page; - BlockNumber bucket_pages; + BlockNumber bucket_pages; BlockNumber overflow_pages; BlockNumber bitmap_pages; BlockNumber unused_pages; - int64 live_items; - int64 dead_items; - uint64 free_space; + int64 live_items; + int64 dead_items; + uint64 free_space; } HashIndexStat; static Datum pgstatindex_impl(Relation rel, FunctionCallInfo fcinfo); @@ -581,8 +581,8 @@ Datum pgstathashindex(PG_FUNCTION_ARGS) { Oid relid = PG_GETARG_OID(0); - BlockNumber nblocks; - BlockNumber blkno; + BlockNumber nblocks; + BlockNumber blkno; Relation rel; HashIndexStat stats; BufferAccessStrategy bstrategy; @@ -591,7 +591,7 @@ pgstathashindex(PG_FUNCTION_ARGS) Datum values[8]; bool nulls[8]; Buffer metabuf; - HashMetaPage metap; + HashMetaPage metap; float8 free_percent; uint64 total_space; @@ -648,13 +648,13 @@ pgstathashindex(PG_FUNCTION_ARGS) MAXALIGN(sizeof(HashPageOpaqueData))) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), - errmsg("index \"%s\" contains corrupted page at block %u", - RelationGetRelationName(rel), - BufferGetBlockNumber(buf)))); + errmsg("index \"%s\" contains corrupted page at block %u", + RelationGetRelationName(rel), + BufferGetBlockNumber(buf)))); else { - HashPageOpaque opaque; - int pagetype; + HashPageOpaque opaque; + int pagetype; opaque = (HashPageOpaque) PageGetSpecialPointer(page); pagetype = opaque->hasho_flag & LH_PAGE_TYPE; @@ -676,9 +676,9 @@ pgstathashindex(PG_FUNCTION_ARGS) else ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), - errmsg("unexpected page type 0x%04X in HASH index \"%s\" block %u", + errmsg("unexpected page type 0x%04X in HASH index \"%s\" block %u", opaque->hasho_flag, RelationGetRelationName(rel), - BufferGetBlockNumber(buf)))); + BufferGetBlockNumber(buf)))); } UnlockReleaseBuffer(buf); } @@ -735,12 +735,12 @@ static void GetHashPageStats(Page page, HashIndexStat *stats) { OffsetNumber maxoff = PageGetMaxOffsetNumber(page); - int off; + int off; /* count live and dead tuples, and free space */ for (off = FirstOffsetNumber; off <= maxoff; off++) { - ItemId id = PageGetItemId(page, off); + ItemId id = PageGetItemId(page, off); if (!ItemIdIsDead(id)) stats->live_items++; diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index 1d5aa837635..482a3dd3016 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -171,8 +171,8 @@ static void deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *joinrel, bool use_alias, List **params_list); static void deparseFromExpr(List *quals, deparse_expr_cxt *context); static void deparseRangeTblRef(StringInfo buf, PlannerInfo *root, - RelOptInfo *foreignrel, bool make_subquery, - List **params_list); + RelOptInfo *foreignrel, bool make_subquery, + List **params_list); static void deparseAggref(Aggref *node, deparse_expr_cxt *context); static void appendGroupByClause(List *tlist, deparse_expr_cxt *context); static void appendAggOrderBy(List *orderList, List *targetList, @@ -185,9 +185,9 @@ static Node *deparseSortGroupClause(Index ref, List *tlist, * Helper functions */ static bool is_subquery_var(Var *node, RelOptInfo *foreignrel, - int *relno, int *colno); + int *relno, int *colno); static void get_relation_column_alias_ids(Var *node, RelOptInfo *foreignrel, - int *relno, int *colno); + int *relno, int *colno); /* @@ -1017,8 +1017,8 @@ deparseSelectSql(List *tlist, bool is_subquery, List **retrieved_attrs, { /* * For a relation that is deparsed as a subquery, emit expressions - * specified in the relation's reltarget. Note that since this is - * for the subquery, no need to care about *retrieved_attrs. + * specified in the relation's reltarget. Note that since this is for + * the subquery, no need to care about *retrieved_attrs. */ deparseSubqueryTargetList(context); } @@ -2189,8 +2189,8 @@ deparseVar(Var *node, deparse_expr_cxt *context) /* * If the Var belongs to the foreign relation that is deparsed as a - * subquery, use the relation and column alias to the Var provided - * by the subquery, instead of the remote name. + * subquery, use the relation and column alias to the Var provided by the + * subquery, instead of the remote name. */ if (is_subquery_var(node, context->scanrel, &relno, &colno)) { diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 18b4b01cfa4..080cb0a0742 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -417,8 +417,8 @@ static void add_foreign_grouping_paths(PlannerInfo *root, static void apply_server_options(PgFdwRelationInfo *fpinfo); static void apply_table_options(PgFdwRelationInfo *fpinfo); static void merge_fdw_options(PgFdwRelationInfo *fpinfo, - const PgFdwRelationInfo *fpinfo_o, - const PgFdwRelationInfo *fpinfo_i); + const PgFdwRelationInfo *fpinfo_o, + const PgFdwRelationInfo *fpinfo_i); /* @@ -4170,8 +4170,8 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, fpinfo->jointype = jointype; /* - * By default, both the input relations are not required to be deparsed - * as subqueries, but there might be some relations covered by the input + * By default, both the input relations are not required to be deparsed as + * subqueries, but there might be some relations covered by the input * relations that are required to be deparsed as subqueries, so save the * relids of those relations for later use by the deparser. */ @@ -4227,8 +4227,8 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, case JOIN_FULL: /* - * In this case, if any of the input relations has conditions, - * we need to deparse that relation as a subquery so that the + * In this case, if any of the input relations has conditions, we + * need to deparse that relation as a subquery so that the * conditions can be evaluated before the join. Remember it in * the fpinfo of this relation so that the deparser can take * appropriate action. Also, save the relids of base relations @@ -4305,7 +4305,7 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, * Note that since this joinrel is at the end of the join_rel_list list * when we are called, we can get the position by list_length. */ - Assert(fpinfo->relation_index == 0); /* shouldn't be set yet */ + Assert(fpinfo->relation_index == 0); /* shouldn't be set yet */ fpinfo->relation_index = list_length(root->parse->rtable) + list_length(root->join_rel_list); @@ -4354,7 +4354,7 @@ add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel, static void apply_server_options(PgFdwRelationInfo *fpinfo) { - ListCell *lc; + ListCell *lc; foreach(lc, fpinfo->server->options) { @@ -4382,7 +4382,7 @@ apply_server_options(PgFdwRelationInfo *fpinfo) static void apply_table_options(PgFdwRelationInfo *fpinfo) { - ListCell *lc; + ListCell *lc; foreach(lc, fpinfo->table->options) { @@ -4439,7 +4439,7 @@ merge_fdw_options(PgFdwRelationInfo *fpinfo, * best. */ fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate || - fpinfo_i->use_remote_estimate; + fpinfo_i->use_remote_estimate; /* * Set fetch size to maximum of the joining sides, since we are @@ -4869,7 +4869,7 @@ add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel, fpinfo->table = ifpinfo->table; fpinfo->server = ifpinfo->server; fpinfo->user = ifpinfo->user; - merge_fdw_options(fpinfo, ifpinfo , NULL); + merge_fdw_options(fpinfo, ifpinfo, NULL); /* Assess if it is safe to push down aggregation and grouping. */ if (!foreign_grouping_ok(root, grouped_rel)) diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h index 2bae799ccfe..25c950dd768 100644 --- a/contrib/postgres_fdw/postgres_fdw.h +++ b/contrib/postgres_fdw/postgres_fdw.h @@ -96,9 +96,9 @@ typedef struct PgFdwRelationInfo List *grouped_tlist; /* Subquery information */ - bool make_outerrel_subquery; /* do we deparse outerrel as a + bool make_outerrel_subquery; /* do we deparse outerrel as a * subquery? */ - bool make_innerrel_subquery; /* do we deparse innerrel as a + bool make_innerrel_subquery; /* do we deparse innerrel as a * subquery? */ Relids lower_subquery_rels; /* all relids appearing in lower * subqueries */ |