diff options
author | Pavan Deolasee | 2017-06-27 11:23:19 +0000 |
---|---|---|
committer | Pavan Deolasee | 2017-06-27 11:23:19 +0000 |
commit | e3e1c61e5ee9facf3b0a9bd6a0ce79da7011f9f2 (patch) | |
tree | cad4a0509c9ac54e260ba922b90b086804bad2d4 | |
parent | 668079ca5792a23fc0e220750bff51bb0558b4a5 (diff) | |
parent | 2710ccd782d0308a3fa1ab193531183148e9b626 (diff) |
Merge PG10 master branch into xl10devel
This commit merges PG10 branch upto commit
2710ccd782d0308a3fa1ab193531183148e9b626. Regression tests show no noteworthy
additional failures. This merge includes major pgindent work done with the
newer version of pgindent
1486 files changed, 11837 insertions, 11612 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 5ca902b6a2..0e95ed4b4d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,6 @@ dnl aclocal.m4 m4_include([config/ac_func_accept_argtypes.m4]) +m4_include([config/ax_prog_perl_modules.m4]) m4_include([config/ax_pthread.m4]) m4_include([config/c-compiler.m4]) m4_include([config/c-library.m4]) diff --git a/config/ax_prog_perl_modules.m4 b/config/ax_prog_perl_modules.m4 new file mode 100644 index 0000000000..70b3230ebd --- /dev/null +++ b/config/ax_prog_perl_modules.m4 @@ -0,0 +1,77 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_prog_perl_modules.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# Checks to see if the given perl modules are available. If true the shell +# commands in ACTION-IF-TRUE are executed. If not the shell commands in +# ACTION-IF-FALSE are run. Note if $PERL is not set (for example by +# calling AC_CHECK_PROG, or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl) +# will be run. +# +# MODULES is a space separated list of module names. To check for a +# minimum version of a module, append the version number to the module +# name, separated by an equals sign. +# +# Example: +# +# AX_PROG_PERL_MODULES( Text::Wrap Net::LDAP=1.0.3, , +# AC_MSG_WARN(Need some Perl modules) +# +# LICENSE +# +# Copyright (c) 2009 Dean Povey <povey@wedgetail.com> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 8 + +AU_ALIAS([AC_PROG_PERL_MODULES], [AX_PROG_PERL_MODULES]) +AC_DEFUN([AX_PROG_PERL_MODULES],[dnl + +m4_define([ax_perl_modules]) +m4_foreach([ax_perl_module], m4_split(m4_normalize([$1])), + [ + m4_append([ax_perl_modules], + [']m4_bpatsubst(ax_perl_module,=,[ ])[' ]) + ]) + +# Make sure we have perl +if test -z "$PERL"; then +AC_CHECK_PROG(PERL,perl,perl) +fi + +if test "x$PERL" != x; then + ax_perl_modules_failed=0 + for ax_perl_module in ax_perl_modules; do + AC_MSG_CHECKING(for perl module $ax_perl_module) + + # Would be nice to log result here, but can't rely on autoconf internals + $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 + if test $? -ne 0; then + AC_MSG_RESULT(no); + ax_perl_modules_failed=1 + else + AC_MSG_RESULT(ok); + fi + done + + # Run optional shell commands + if test "$ax_perl_modules_failed" = 0; then + : + $2 + else + : + $3 + fi +else + AC_MSG_WARN(could not find perl) +fi])dnl @@ -16288,6 +16288,84 @@ done if test -z "$PERL"; then as_fn_error $? "Perl not found" "$LINENO" 5 fi + # Check for necessary modules + + + + + + +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ax_perl_modules_failed=0 + for ax_perl_module in 'IPC::Run' ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5 +$as_echo_n "checking for perl module $ax_perl_module... " >&6; } + + # Would be nice to log result here, but can't rely on autoconf internals + $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ax_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ax_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "Perl module IPC::Run is required to run TAP tests" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi fi # Thread testing diff --git a/configure.in b/configure.in index e1b1780a5f..ab71577598 100644 --- a/configure.in +++ b/configure.in @@ -2142,6 +2142,9 @@ if test "$enable_tap_tests" = yes; then if test -z "$PERL"; then AC_MSG_ERROR([Perl not found]) fi + # Check for necessary modules + AX_PROG_PERL_MODULES(IPC::Run, , + AC_MSG_ERROR([Perl module IPC::Run is required to run TAP tests])) fi # Thread testing diff --git a/contrib/adminpack/adminpack.c b/contrib/adminpack/adminpack.c index 10338f951f..f3f8e7f1e4 100644 --- a/contrib/adminpack/adminpack.c +++ b/contrib/adminpack/adminpack.c @@ -74,7 +74,7 @@ convert_and_check_filename(text *arg, bool logAllowed) if (path_contains_parent_reference(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("reference to parent directory (\"..\") not allowed")))); + (errmsg("reference to parent directory (\"..\") not allowed")))); /* * Allow absolute paths if within DataDir or Log_directory, even @@ -105,7 +105,7 @@ requireSuperuser(void) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("only superuser may access generic file functions")))); + (errmsg("only superuser may access generic file functions")))); } diff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c index c134e5f3b0..9ae83dc839 100644 --- a/contrib/amcheck/verify_nbtree.c +++ b/contrib/amcheck/verify_nbtree.c @@ -240,8 +240,8 @@ btree_index_checkable(Relation rel) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot access temporary tables of other sessions"), - errdetail("Index \"%s\" is associated with temporary relation.", - RelationGetRelationName(rel)))); + errdetail("Index \"%s\" is associated with temporary relation.", + RelationGetRelationName(rel)))); if (!IndexIsValid(rel->rd_index)) ereport(ERROR, @@ -411,12 +411,12 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), errmsg("block %u fell off the end of index \"%s\"", - current, RelationGetRelationName(state->rel)))); + current, RelationGetRelationName(state->rel)))); else ereport(DEBUG1, (errcode(ERRCODE_NO_DATA), errmsg("block %u of index \"%s\" ignored", - current, RelationGetRelationName(state->rel)))); + current, RelationGetRelationName(state->rel)))); goto nextpage; } else if (nextleveldown.leftmost == InvalidBlockNumber) @@ -433,14 +433,14 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level) if (!P_LEFTMOST(opaque)) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), - errmsg("block %u is not leftmost in index \"%s\"", - current, RelationGetRelationName(state->rel)))); + errmsg("block %u is not leftmost in index \"%s\"", + current, RelationGetRelationName(state->rel)))); if (level.istruerootlevel && !P_ISROOT(opaque)) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), - errmsg("block %u is not true root in index \"%s\"", - current, RelationGetRelationName(state->rel)))); + errmsg("block %u is not true root in index \"%s\"", + current, RelationGetRelationName(state->rel)))); } /* @@ -488,7 +488,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level) errmsg("left link/right link pair in index \"%s\" not in agreement", RelationGetRelationName(state->rel)), errdetail_internal("Block=%u left block=%u left link from block=%u.", - current, leftcurrent, opaque->btpo_prev))); + current, leftcurrent, opaque->btpo_prev))); /* Check level, which must be valid for non-ignorable page */ if (level.level != opaque->btpo.level) @@ -497,7 +497,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level) errmsg("leftmost down link for level points to block in index \"%s\" whose level is not one level down", RelationGetRelationName(state->rel)), errdetail_internal("Block pointed to=%u expected level=%u level in pointed to block=%u.", - current, level.level, opaque->btpo.level))); + current, level.level, opaque->btpo.level))); /* Verify invariants for page -- all important checks occur here */ bt_target_page_check(state); @@ -508,8 +508,8 @@ nextpage: if (current == leftcurrent || current == opaque->btpo_prev) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), - errmsg("circular link chain found in block %u of index \"%s\"", - current, RelationGetRelationName(state->rel)))); + errmsg("circular link chain found in block %u of index \"%s\"", + current, RelationGetRelationName(state->rel)))); leftcurrent = current; current = opaque->btpo_next; @@ -665,17 +665,17 @@ bt_target_page_check(BtreeCheckState *state) (errcode(ERRCODE_INDEX_CORRUPTED), errmsg("item order invariant violated for index \"%s\"", RelationGetRelationName(state->rel)), - errdetail_internal("Lower index tid=%s (points to %s tid=%s) " - "higher index tid=%s (points to %s tid=%s) " - "page lsn=%X/%X.", - itid, - P_ISLEAF(topaque) ? "heap" : "index", - htid, - nitid, - P_ISLEAF(topaque) ? "heap" : "index", - nhtid, - (uint32) (state->targetlsn >> 32), - (uint32) state->targetlsn))); + errdetail_internal("Lower index tid=%s (points to %s tid=%s) " + "higher index tid=%s (points to %s tid=%s) " + "page lsn=%X/%X.", + itid, + P_ISLEAF(topaque) ? "heap" : "index", + htid, + nitid, + P_ISLEAF(topaque) ? "heap" : "index", + nhtid, + (uint32) (state->targetlsn >> 32), + (uint32) state->targetlsn))); } /* @@ -824,7 +824,7 @@ bt_right_page_check_scankey(BtreeCheckState *state) ereport(DEBUG1, (errcode(ERRCODE_NO_DATA), errmsg("level %u leftmost page of index \"%s\" was found deleted or half dead", - opaque->btpo.level, RelationGetRelationName(state->rel)), + opaque->btpo.level, RelationGetRelationName(state->rel)), errdetail_internal("Deleted page found when building scankey from right sibling."))); /* Be slightly more pro-active in freeing this memory, just in case */ @@ -1053,7 +1053,7 @@ bt_downlink_check(BtreeCheckState *state, BlockNumber childblock, errmsg("down-link lower bound invariant violated for index \"%s\"", RelationGetRelationName(state->rel)), errdetail_internal("Parent block=%u child index tid=(%u,%u) parent page lsn=%X/%X.", - state->targetblock, childblock, offset, + state->targetblock, childblock, offset, (uint32) (state->targetlsn >> 32), (uint32) state->targetlsn))); } @@ -1228,21 +1228,21 @@ palloc_btree_page(BtreeCheckState *state, BlockNumber blocknum) if (P_ISLEAF(opaque) && !P_ISDELETED(opaque) && opaque->btpo.level != 0) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), - errmsg("invalid leaf page level %u for block %u in index \"%s\"", - opaque->btpo.level, blocknum, RelationGetRelationName(state->rel)))); + errmsg("invalid leaf page level %u for block %u in index \"%s\"", + opaque->btpo.level, blocknum, RelationGetRelationName(state->rel)))); if (blocknum != BTREE_METAPAGE && !P_ISLEAF(opaque) && !P_ISDELETED(opaque) && opaque->btpo.level == 0) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), - errmsg("invalid internal page level 0 for block %u in index \"%s\"", - opaque->btpo.level, RelationGetRelationName(state->rel)))); + errmsg("invalid internal page level 0 for block %u in index \"%s\"", + opaque->btpo.level, RelationGetRelationName(state->rel)))); if (!P_ISLEAF(opaque) && P_HAS_GARBAGE(opaque)) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), - errmsg("internal page block %u in index \"%s\" has garbage items", - blocknum, RelationGetRelationName(state->rel)))); + errmsg("internal page block %u in index \"%s\" has garbage items", + blocknum, RelationGetRelationName(state->rel)))); return page; } diff --git a/contrib/auth_delay/auth_delay.c b/contrib/auth_delay/auth_delay.c index e0604fb808..cd12a86b99 100644 --- a/contrib/auth_delay/auth_delay.c +++ b/contrib/auth_delay/auth_delay.c @@ -57,7 +57,7 @@ _PG_init(void) { /* Define custom GUC variables */ DefineCustomIntVariable("auth_delay.milliseconds", - "Milliseconds to delay before reporting authentication failure", + "Milliseconds to delay before reporting authentication failure", NULL, &auth_delay_milliseconds, 0, diff --git a/contrib/auto_explain/auto_explain.c b/contrib/auto_explain/auto_explain.c index 9213ffb6a4..edcb91542a 100644 --- a/contrib/auto_explain/auto_explain.c +++ b/contrib/auto_explain/auto_explain.c @@ -74,8 +74,8 @@ _PG_init(void) { /* Define custom GUC variables. */ DefineCustomIntVariable("auto_explain.log_min_duration", - "Sets the minimum execution time above which plans will be logged.", - "Zero prints all plans. -1 turns this feature off.", + "Sets the minimum execution time above which plans will be logged.", + "Zero prints all plans. -1 turns this feature off.", &auto_explain_log_min_duration, -1, -1, INT_MAX / 1000, @@ -120,7 +120,7 @@ _PG_init(void) DefineCustomBoolVariable("auto_explain.log_triggers", "Include trigger statistics in plans.", - "This has no effect unless log_analyze is also set.", + "This has no effect unless log_analyze is also set.", &auto_explain_log_triggers, false, PGC_SUSET, diff --git a/contrib/bloom/bloom.h b/contrib/bloom/bloom.h index 0cfe49aad8..f3df1af781 100644 --- a/contrib/bloom/bloom.h +++ b/contrib/bloom/bloom.h @@ -75,7 +75,7 @@ typedef BloomPageOpaqueData *BloomPageOpaque; /* Preserved page numbers */ #define BLOOM_METAPAGE_BLKNO (0) -#define BLOOM_HEAD_BLKNO (1) /* first data page */ +#define BLOOM_HEAD_BLKNO (1) /* first data page */ /* * We store Bloom signatures as arrays of uint16 words. @@ -101,8 +101,8 @@ typedef struct BloomOptions { int32 vl_len_; /* varlena header (do not touch directly!) */ int bloomLength; /* length of signature in words (not bits!) */ - int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for - * each index key */ + int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for each + * index key */ } BloomOptions; /* @@ -111,8 +111,8 @@ typedef struct BloomOptions */ typedef BlockNumber FreeBlockNumberArray[ MAXALIGN_DOWN( - BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(BloomPageOpaqueData)) - - MAXALIGN(sizeof(uint16) * 2 + sizeof(uint32) + sizeof(BloomOptions)) + BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(BloomPageOpaqueData)) + - MAXALIGN(sizeof(uint16) * 2 + sizeof(uint32) + sizeof(BloomOptions)) ) / sizeof(BlockNumber) ]; diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c index 00a65875b0..f2eda67e0a 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/bloom/blvacuum.c b/contrib/bloom/blvacuum.c index 04abd0f6b6..2e060871b6 100644 --- a/contrib/bloom/blvacuum.c +++ b/contrib/bloom/blvacuum.c @@ -84,7 +84,7 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, */ itup = itupPtr = BloomPageGetTuple(&state, page, FirstOffsetNumber); itupEnd = BloomPageGetTuple(&state, page, - OffsetNumberNext(BloomPageGetMaxOffset(page))); + OffsetNumberNext(BloomPageGetMaxOffset(page))); while (itup < itupEnd) { /* Do we have to delete this tuple? */ @@ -108,7 +108,7 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, /* Assert that we counted correctly */ Assert(itupPtr == BloomPageGetTuple(&state, page, - OffsetNumberNext(BloomPageGetMaxOffset(page)))); + OffsetNumberNext(BloomPageGetMaxOffset(page)))); /* * Add page to new notFullPage list if we will not mark page as diff --git a/contrib/btree_gin/btree_gin.c b/contrib/btree_gin/btree_gin.c index 6f0c752b2e..2473f79ca1 100644 --- a/contrib/btree_gin/btree_gin.c +++ b/contrib/btree_gin/btree_gin.c @@ -115,8 +115,8 @@ gin_btree_compare_prefix(FunctionCallInfo fcinfo) data->typecmp, fcinfo->flinfo, PG_GET_COLLATION(), - (data->strategy == BTLessStrategyNumber || - data->strategy == BTLessEqualStrategyNumber) + (data->strategy == BTLessStrategyNumber || + data->strategy == BTLessEqualStrategyNumber) ? data->datum : a, b)); diff --git a/contrib/btree_gist/btree_cash.c b/contrib/btree_gist/btree_cash.c index 1116ca084f..81131af4dc 100644 --- a/contrib/btree_gist/btree_cash.c +++ b/contrib/btree_gist/btree_cash.c @@ -203,8 +203,8 @@ Datum gbt_cash_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c index 28c7c2ac86..992ce57507 100644 --- a/contrib/btree_gist/btree_date.c +++ b/contrib/btree_gist/btree_date.c @@ -87,8 +87,8 @@ gdb_date_dist(const void *a, const void *b, FmgrInfo *flinfo) { /* we assume the difference can't overflow */ Datum diff = DirectFunctionCall2(date_mi, - DateADTGetDatum(*((const DateADT *) a)), - DateADTGetDatum(*((const DateADT *) b))); + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b))); return (float8) Abs(DatumGetInt32(diff)); } @@ -210,14 +210,14 @@ gbt_date_penalty(PG_FUNCTION_ARGS) diff = DatumGetInt32(DirectFunctionCall2( date_mi, DateADTGetDatum(newentry->upper), - DateADTGetDatum(origentry->upper))); + DateADTGetDatum(origentry->upper))); res = Max(diff, 0); diff = DatumGetInt32(DirectFunctionCall2( date_mi, - DateADTGetDatum(origentry->lower), - DateADTGetDatum(newentry->lower))); + DateADTGetDatum(origentry->lower), + DateADTGetDatum(newentry->lower))); res += Max(diff, 0); @@ -227,8 +227,8 @@ gbt_date_penalty(PG_FUNCTION_ARGS) { diff = DatumGetInt32(DirectFunctionCall2( date_mi, - DateADTGetDatum(origentry->upper), - DateADTGetDatum(origentry->lower))); + DateADTGetDatum(origentry->upper), + DateADTGetDatum(origentry->lower))); *result += FLT_MIN; *result += (float) (res / ((double) (res + diff))); *result *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1)); @@ -242,8 +242,8 @@ Datum gbt_date_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_enum.c b/contrib/btree_gist/btree_enum.c index 8bbadfe860..0ec7d8bf88 100644 --- a/contrib/btree_gist/btree_enum.c +++ b/contrib/btree_gist/btree_enum.c @@ -169,8 +169,8 @@ Datum gbt_enum_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_float4.c b/contrib/btree_gist/btree_float4.c index fe6993c226..6b20f44a48 100644 --- a/contrib/btree_gist/btree_float4.c +++ b/contrib/btree_gist/btree_float4.c @@ -196,8 +196,8 @@ Datum gbt_float4_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_float8.c b/contrib/btree_gist/btree_float8.c index 13153d811f..ee114cbe42 100644 --- a/contrib/btree_gist/btree_float8.c +++ b/contrib/btree_gist/btree_float8.c @@ -203,8 +203,8 @@ Datum gbt_float8_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c index e1561b37b7..b5b593f77f 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)); } @@ -165,8 +165,8 @@ Datum gbt_inet_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c index 0a4498a693..f343b8615f 100644 --- a/contrib/btree_gist/btree_int2.c +++ b/contrib/btree_gist/btree_int2.c @@ -202,8 +202,8 @@ Datum gbt_int2_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c index b29cbc81a3..35bb442437 100644 --- a/contrib/btree_gist/btree_int4.c +++ b/contrib/btree_gist/btree_int4.c @@ -203,8 +203,8 @@ Datum gbt_int4_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_int8.c b/contrib/btree_gist/btree_int8.c index df1f5338c8..91f2d032d1 100644 --- a/contrib/btree_gist/btree_int8.c +++ b/contrib/btree_gist/btree_int8.c @@ -203,8 +203,8 @@ Datum gbt_int8_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c index e4dd9e4238..61ab478c42 100644 --- a/contrib/btree_gist/btree_interval.c +++ b/contrib/btree_gist/btree_interval.c @@ -285,8 +285,8 @@ Datum gbt_intv_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_macaddr.c b/contrib/btree_gist/btree_macaddr.c index d530b4e878..0486c35730 100644 --- a/contrib/btree_gist/btree_macaddr.c +++ b/contrib/btree_gist/btree_macaddr.c @@ -182,8 +182,8 @@ Datum gbt_macad_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_macaddr8.c b/contrib/btree_gist/btree_macaddr8.c index 96afbcdead..30a1391d73 100644 --- a/contrib/btree_gist/btree_macaddr8.c +++ b/contrib/btree_gist/btree_macaddr8.c @@ -182,8 +182,8 @@ Datum gbt_macad8_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c index e0d6f2adf1..00e701903f 100644 --- a/contrib/btree_gist/btree_oid.c +++ b/contrib/btree_gist/btree_oid.c @@ -203,8 +203,8 @@ Datum gbt_oid_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c index 5eec8323f5..bb239d4986 100644 --- a/contrib/btree_gist/btree_time.c +++ b/contrib/btree_gist/btree_time.c @@ -289,15 +289,15 @@ gbt_time_penalty(PG_FUNCTION_ARGS) intr = DatumGetIntervalP(DirectFunctionCall2( time_mi_time, - TimeADTGetDatumFast(newentry->upper), - TimeADTGetDatumFast(origentry->upper))); + TimeADTGetDatumFast(newentry->upper), + TimeADTGetDatumFast(origentry->upper))); res = INTERVAL_TO_SEC(intr); res = Max(res, 0); intr = DatumGetIntervalP(DirectFunctionCall2( time_mi_time, - TimeADTGetDatumFast(origentry->lower), - TimeADTGetDatumFast(newentry->lower))); + TimeADTGetDatumFast(origentry->lower), + TimeADTGetDatumFast(newentry->lower))); res2 = INTERVAL_TO_SEC(intr); res2 = Max(res2, 0); @@ -309,8 +309,8 @@ gbt_time_penalty(PG_FUNCTION_ARGS) { intr = DatumGetIntervalP(DirectFunctionCall2( time_mi_time, - TimeADTGetDatumFast(origentry->upper), - TimeADTGetDatumFast(origentry->lower))); + TimeADTGetDatumFast(origentry->upper), + TimeADTGetDatumFast(origentry->lower))); *result += FLT_MIN; *result += (float) (res / (res + INTERVAL_TO_SEC(intr))); *result *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1)); @@ -324,8 +324,8 @@ Datum gbt_time_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c index 592466c948..1582cff102 100644 --- a/contrib/btree_gist/btree_ts.c +++ b/contrib/btree_gist/btree_ts.c @@ -387,8 +387,8 @@ Datum gbt_ts_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/btree_gist/btree_utils_num.h b/contrib/btree_gist/btree_utils_num.h index 8aab19396c..17561fa9e4 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 3648adccef..2c636ad2fa 100644 --- a/contrib/btree_gist/btree_utils_var.c +++ b/contrib/btree_gist/btree_utils_var.c @@ -72,7 +72,7 @@ gbt_var_key_readable(const GBT_VARKEY *k) * Create a leaf-entry to store in the index, from a single Datum. */ static GBT_VARKEY * -gbt_var_key_from_datum(const struct varlena * u) +gbt_var_key_from_datum(const struct varlena *u) { int32 lowersize = VARSIZE(u); GBT_VARKEY *r; @@ -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; @@ -488,7 +488,7 @@ gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, cur = (char *) DatumGetPointer(entryvec->vector[i].key); ro = gbt_var_key_readable((GBT_VARKEY *) cur); - if (ro.lower == ro.upper) /* leaf */ + if (ro.lower == ro.upper) /* leaf */ { sv[svcntr] = gbt_var_leaf2node((GBT_VARKEY *) cur, tinfo, flinfo); arr[i].t = sv[svcntr]; diff --git a/contrib/btree_gist/btree_utils_var.h b/contrib/btree_gist/btree_utils_var.h index 04a356276b..15d847c139 100644 --- a/contrib/btree_gist/btree_utils_var.h +++ b/contrib/btree_gist/btree_utils_var.h @@ -40,7 +40,7 @@ typedef struct 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 */ + 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 e67b8cc989..ecf357d662 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) ); } @@ -171,7 +171,7 @@ static double uuid_2_double(const pg_uuid_t *u) { uint64 uu[2]; - const double two64 = 18446744073709551616.0; /* 2^64 */ + const double two64 = 18446744073709551616.0; /* 2^64 */ /* Source data may not be suitably aligned, so copy */ memcpy(uu, u->data, UUID_LEN); @@ -220,8 +220,8 @@ Datum gbt_uuid_picksplit(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), - (GIST_SPLITVEC *) PG_GETARG_POINTER(1), + (GistEntryVector *) PG_GETARG_POINTER(0), + (GIST_SPLITVEC *) PG_GETARG_POINTER(1), &tinfo, fcinfo->flinfo )); } diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c index 2bb2ed029d..149558c763 100644 --- a/contrib/cube/cube.c +++ b/contrib/cube/cube.c @@ -483,7 +483,7 @@ g_cube_picksplit(PG_FUNCTION_ARGS) union_d = cube_union_v0(datum_alpha, datum_beta); rt_cube_size(union_d, &size_union); inter_d = DatumGetNDBOX(DirectFunctionCall2(cube_inter, - entryvec->vector[i].key, entryvec->vector[j].key)); + entryvec->vector[i].key, entryvec->vector[j].key)); rt_cube_size(inter_d, &size_inter); size_waste = size_union - size_inter; @@ -1354,15 +1354,15 @@ g_cube_distance(PG_FUNCTION_ARGS) { case CubeKNNDistanceTaxicab: retval = DatumGetFloat8(DirectFunctionCall2(distance_taxicab, - PointerGetDatum(cube), PointerGetDatum(query))); + PointerGetDatum(cube), PointerGetDatum(query))); break; case CubeKNNDistanceEuclid: retval = DatumGetFloat8(DirectFunctionCall2(cube_distance, - PointerGetDatum(cube), PointerGetDatum(query))); + PointerGetDatum(cube), PointerGetDatum(query))); break; case CubeKNNDistanceChebyshev: retval = DatumGetFloat8(DirectFunctionCall2(distance_chebyshev, - PointerGetDatum(cube), PointerGetDatum(query))); + PointerGetDatum(cube), PointerGetDatum(query))); break; default: elog(ERROR, "unrecognized cube strategy number: %d", strategy); diff --git a/contrib/cube/cubedata.h b/contrib/cube/cubedata.h index af02464178..6e6ddfd3d7 100644 --- a/contrib/cube/cubedata.h +++ b/contrib/cube/cubedata.h @@ -54,10 +54,10 @@ typedef struct NDBOX #define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x) /* GiST operator strategy numbers */ -#define CubeKNNDistanceCoord 15 /* ~> */ -#define CubeKNNDistanceTaxicab 16 /* <#> */ -#define CubeKNNDistanceEuclid 17 /* <-> */ -#define CubeKNNDistanceChebyshev 18 /* <=> */ +#define CubeKNNDistanceCoord 15 /* ~> */ +#define CubeKNNDistanceTaxicab 16 /* <#> */ +#define CubeKNNDistanceEuclid 17 /* <-> */ +#define CubeKNNDistanceChebyshev 18 /* <=> */ /* in cubescan.l */ extern int cube_yylex(void); diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index a6a3c09ff8..81136b131c 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -67,7 +67,7 @@ typedef struct remoteConn { PGconn *conn; /* Hold the remote connection */ int openCursorCount; /* The number of open cursors */ - bool newXactForCursor; /* Opened a transaction for a cursor */ + bool newXactForCursor; /* Opened a transaction for a cursor */ } remoteConn; typedef struct storeInfo @@ -179,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; @@ -207,9 +207,9 @@ dblink_get_conn(char *conname_or_str, 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()) @@ -723,7 +723,7 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async) /* shouldn't happen */ elog(ERROR, "wrong number of arguments"); } - else /* is_async */ + else /* is_async */ { /* get async result */ conname = text_to_cstring(PG_GETARG_TEXT_PP(0)); @@ -869,8 +869,8 @@ materializeResult(FunctionCallInfo fcinfo, PGconn *conn, PGresult *res) /* failed to determine actual type of RECORD */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("function returning record called in context " - "that cannot accept type record"))); + errmsg("function returning record called in context " + "that cannot accept type record"))); break; default: /* result type isn't composite */ @@ -909,7 +909,7 @@ materializeResult(FunctionCallInfo fcinfo, PGconn *conn, PGresult *res) nestlevel = applyRemoteGucs(conn); oldcontext = MemoryContextSwitchTo( - rsinfo->econtext->ecxt_per_query_memory); + rsinfo->econtext->ecxt_per_query_memory); tupstore = tuplestore_begin_heap(true, false, work_mem); rsinfo->setResult = tupstore; rsinfo->setDesc = tupdesc; @@ -1036,7 +1036,7 @@ materializeQueryResult(FunctionCallInfo fcinfo, attinmeta = TupleDescGetAttInMetadata(tupdesc); oldcontext = MemoryContextSwitchTo( - rsinfo->econtext->ecxt_per_query_memory); + rsinfo->econtext->ecxt_per_query_memory); tupstore = tuplestore_begin_heap(true, false, work_mem); rsinfo->setResult = tupstore; rsinfo->setDesc = tupdesc; @@ -1098,7 +1098,7 @@ storeQueryResult(volatile storeInfo *sinfo, PGconn *conn, const char *sql) if (!PQsendQuery(conn, sql)) elog(ERROR, "could not send query: %s", pchomp(PQerrorMessage(conn))); - if (!PQsetSingleRowMode(conn)) /* shouldn't fail */ + if (!PQsetSingleRowMode(conn)) /* shouldn't fail */ elog(ERROR, "failed to set single-row mode for dblink query"); for (;;) @@ -1460,8 +1460,8 @@ dblink_exec(PG_FUNCTION_ARGS) { PQclear(res); ereport(ERROR, - (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), - errmsg("statement returning results not allowed"))); + (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), + errmsg("statement returning results not allowed"))); } } PG_CATCH(); @@ -1980,7 +1980,7 @@ dblink_fdw_validator(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_FDW_OUT_OF_MEMORY), errmsg("out of memory"), - errdetail("could not get libpq's default connection options"))); + errdetail("could not get libpq's default connection options"))); } /* Validate each supplied option. */ @@ -2179,7 +2179,7 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals appendStringInfoChar(&buf, ','); appendStringInfoString(&buf, - quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname))); + quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname))); needComma = true; } @@ -2242,7 +2242,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals appendStringInfoString(&buf, " AND "); appendStringInfoString(&buf, - quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); + quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); if (tgt_pkattvals[i] != NULL) appendStringInfo(&buf, " = %s", @@ -2296,7 +2296,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals appendStringInfoString(&buf, ", "); appendStringInfo(&buf, "%s = ", - quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname))); + quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname))); key = get_attnum_pk_pos(pkattnums, pknumatts, i); @@ -2325,7 +2325,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals appendStringInfoString(&buf, " AND "); appendStringInfoString(&buf, - quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); + quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); val = tgt_pkattvals[i]; @@ -2351,7 +2351,7 @@ quote_ident_cstr(char *rawstr) rawstr_text = cstring_to_text(rawstr); result_text = DatumGetTextPP(DirectFunctionCall1(quote_ident, - PointerGetDatum(rawstr_text))); + PointerGetDatum(rawstr_text))); result = text_to_cstring(result_text); return result; @@ -2416,7 +2416,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk appendStringInfoString(&buf, "NULL"); else appendStringInfoString(&buf, - quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname))); + quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname))); } appendStringInfo(&buf, " FROM %s WHERE ", relname); @@ -2429,7 +2429,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk appendStringInfoString(&buf, " AND "); appendStringInfoString(&buf, - quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); + quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); if (src_pkattvals[i] != NULL) appendStringInfo(&buf, " = %s", @@ -2619,10 +2619,10 @@ dblink_security_check(PGconn *conn, remoteConn *rconn) pfree(rconn); ereport(ERROR, - (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), - errmsg("password is required"), - errdetail("Non-superuser cannot connect if the server does not request a password."), - errhint("Target server's authentication method must be changed."))); + (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), + errmsg("password is required"), + errdetail("Non-superuser cannot connect if the server does not request a password."), + errhint("Target server's authentication method must be changed."))); } } } @@ -2661,9 +2661,9 @@ dblink_connstr_check(const char *connstr) if (!connstr_gives_password) ereport(ERROR, - (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), - errmsg("password is required"), - errdetail("Non-superusers must provide a password in the connection string."))); + (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), + errmsg("password is required"), + errdetail("Non-superusers must provide a password in the connection string."))); } } @@ -2724,8 +2724,8 @@ dblink_res_error(PGconn *conn, const char *conname, PGresult *res, message_detail ? errdetail_internal("%s", message_detail) : 0, message_hint ? errhint("%s", message_hint) : 0, message_context ? errcontext("%s", message_context) : 0, - errcontext("Error occurred on dblink connection named \"%s\": %s.", - dblink_context_conname, dblink_context_msg))); + errcontext("Error occurred on dblink connection named \"%s\": %s.", + dblink_context_conname, dblink_context_msg))); } /* @@ -2760,7 +2760,7 @@ get_connect_string(const char *servername) ereport(ERROR, (errcode(ERRCODE_FDW_OUT_OF_MEMORY), errmsg("out of memory"), - errdetail("could not get libpq's default connection options"))); + errdetail("could not get libpq's default connection options"))); } /* first gather the server connstr options */ diff --git a/contrib/earthdistance/earthdistance.c b/contrib/earthdistance/earthdistance.c index 6ad6d87ce8..e6ebfd11ad 100644 --- a/contrib/earthdistance/earthdistance.c +++ b/contrib/earthdistance/earthdistance.c @@ -69,7 +69,7 @@ geo_distance_internal(Point *pt1, Point *pt2) longdiff = TWO_PI - longdiff; sino = sqrt(sin(fabs(lat1 - lat2) / 2.) * sin(fabs(lat1 - lat2) / 2.) + - cos(lat1) * cos(lat2) * sin(longdiff / 2.) * sin(longdiff / 2.)); + cos(lat1) * cos(lat2) * sin(longdiff / 2.) * sin(longdiff / 2.)); if (sino > 1.) sino = 1.; diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c index 277639f6e9..2396bd442f 100644 --- a/contrib/file_fdw/file_fdw.c +++ b/contrib/file_fdw/file_fdw.c @@ -250,7 +250,7 @@ file_fdw_validator(PG_FUNCTION_ARGS) buf.len > 0 ? errhint("Valid options in this context are: %s", buf.data) - : errhint("There are no valid options in this context."))); + : errhint("There are no valid options in this context."))); } /* @@ -544,13 +544,13 @@ fileGetForeignPaths(PlannerInfo *root, */ add_path(baserel, (Path *) create_foreignscan_path(root, baserel, - NULL, /* default pathtarget */ + NULL, /* default pathtarget */ baserel->rows, startup_cost, total_cost, - NIL, /* no pathkeys */ - NULL, /* no outer rel either */ - NULL, /* no extra plan */ + NIL, /* no pathkeys */ + NULL, /* no outer rel either */ + NULL, /* no extra plan */ coptions)); /* diff --git a/contrib/fuzzystrmatch/dmetaphone.c b/contrib/fuzzystrmatch/dmetaphone.c index 4e89983afd..918ee0d90e 100644 --- a/contrib/fuzzystrmatch/dmetaphone.c +++ b/contrib/fuzzystrmatch/dmetaphone.c @@ -111,7 +111,7 @@ The remaining code is authored by Andrew Dunstan <amdunstan@ncshp.org> and #include <string.h> #include <stdarg.h> -#endif /* DMETAPHONE_MAIN */ +#endif /* DMETAPHONE_MAIN */ #include <assert.h> #include <ctype.h> @@ -197,7 +197,7 @@ dmetaphone_alt(PG_FUNCTION_ARGS) * in a case like this. */ -#define META_FREE(x) ((void)true) /* pfree((x)) */ +#define META_FREE(x) ((void)true) /* pfree((x)) */ #else /* not defined DMETAPHONE_MAIN */ /* use the standard malloc library when not running in PostgreSQL */ @@ -209,7 +209,7 @@ dmetaphone_alt(PG_FUNCTION_ARGS) (v = (t*)realloc((v),((n)*sizeof(t)))) #define META_FREE(x) free((x)) -#endif /* defined DMETAPHONE_MAIN */ +#endif /* defined DMETAPHONE_MAIN */ @@ -977,7 +977,7 @@ DoubleMetaphone(char *str, char **codes) } } - if (GetAt(original, current + 1) == 'J') /* it could happen! */ + if (GetAt(original, current + 1) == 'J') /* it could happen! */ current += 2; else current += 1; diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.c b/contrib/fuzzystrmatch/fuzzystrmatch.c index f1bb7bca73..ce58a6a7fc 100644 --- a/contrib/fuzzystrmatch/fuzzystrmatch.c +++ b/contrib/fuzzystrmatch/fuzzystrmatch.c @@ -389,7 +389,7 @@ _metaphone(char *word, /* IN */ /*-- Allocate memory for our phoned_phrase --*/ if (max_phonemes == 0) { /* Assume largest possible */ - *phoned_word = palloc(sizeof(char) * strlen(word) +1); + *phoned_word = palloc(sizeof(char) * strlen(word) + 1); } else { @@ -722,7 +722,7 @@ _metaphone(char *word, /* IN */ End_Phoned_Word; return (META_SUCCESS); -} /* END metaphone */ +} /* END metaphone */ /* diff --git a/contrib/hstore/hstore.h b/contrib/hstore/hstore.h index 6bab08b7de..c4862a82e1 100644 --- a/contrib/hstore/hstore.h +++ b/contrib/hstore/hstore.h @@ -181,7 +181,7 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs); #define HStoreExistsStrategyNumber 9 #define HStoreExistsAnyStrategyNumber 10 #define HStoreExistsAllStrategyNumber 11 -#define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */ +#define HStoreOldContainsStrategyNumber 13 /* backwards compatibility */ /* * defining HSTORE_POLLUTE_NAMESPACE=0 will prevent use of old function names; @@ -202,4 +202,4 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs); extern int no_such_variable #endif -#endif /* __HSTORE_H__ */ +#endif /* __HSTORE_H__ */ diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c index 191fc48c7a..b25eb23df5 100644 --- a/contrib/hstore/hstore_io.c +++ b/contrib/hstore/hstore_io.c @@ -443,8 +443,8 @@ hstore_recv(PG_FUNCTION_ARGS) if (pcount < 0 || pcount > MaxAllocSize / sizeof(Pairs)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("number of pairs (%d) exceeds the maximum allowed (%d)", - pcount, (int) (MaxAllocSize / sizeof(Pairs))))); + errmsg("number of pairs (%d) exceeds the maximum allowed (%d)", + pcount, (int) (MaxAllocSize / sizeof(Pairs))))); pairs = palloc(pcount * sizeof(Pairs)); for (i = 0; i < pcount; ++i) @@ -562,8 +562,8 @@ hstore_from_arrays(PG_FUNCTION_ARGS) if (key_count > MaxAllocSize / sizeof(Pairs)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("number of pairs (%d) exceeds the maximum allowed (%d)", - key_count, (int) (MaxAllocSize / sizeof(Pairs))))); + errmsg("number of pairs (%d) exceeds the maximum allowed (%d)", + key_count, (int) (MaxAllocSize / sizeof(Pairs))))); /* value_array might be NULL */ @@ -693,8 +693,8 @@ hstore_from_array(PG_FUNCTION_ARGS) if (count > MaxAllocSize / sizeof(Pairs)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("number of pairs (%d) exceeds the maximum allowed (%d)", - count, (int) (MaxAllocSize / sizeof(Pairs))))); + errmsg("number of pairs (%d) exceeds the maximum allowed (%d)", + count, (int) (MaxAllocSize / sizeof(Pairs))))); pairs = palloc(count * sizeof(Pairs)); @@ -829,7 +829,7 @@ hstore_from_record(PG_FUNCTION_ARGS) my_extra->ncolumns = ncolumns; } - Assert(ncolumns <= MaxTupleAttributeNumber); /* thus, no overflow */ + Assert(ncolumns <= MaxTupleAttributeNumber); /* thus, no overflow */ pairs = palloc(ncolumns * sizeof(Pairs)); if (rec) @@ -1441,8 +1441,8 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS) { val.type = jbvNumeric; val.val.numeric = DatumGetNumeric( - DirectFunctionCall3(numeric_in, - CStringGetDatum(tmp.data), 0, -1)); + DirectFunctionCall3(numeric_in, + CStringGetDatum(tmp.data), 0, -1)); } else { diff --git a/contrib/hstore/hstore_op.c b/contrib/hstore/hstore_op.c index 1e2dc881c1..612be23a74 100644 --- a/contrib/hstore/hstore_op.c +++ b/contrib/hstore/hstore_op.c @@ -101,8 +101,8 @@ hstoreArrayToPairs(ArrayType *a, int *npairs) if (key_count > MaxAllocSize / sizeof(Pairs)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("number of pairs (%d) exceeds the maximum allowed (%d)", - key_count, (int) (MaxAllocSize / sizeof(Pairs))))); + errmsg("number of pairs (%d) exceeds the maximum allowed (%d)", + key_count, (int) (MaxAllocSize / sizeof(Pairs))))); key_pairs = palloc(sizeof(Pairs) * key_count); @@ -181,7 +181,7 @@ hstore_exists_any(PG_FUNCTION_ARGS) for (i = 0; i < nkeys; i++) { int idx = hstoreFindKey(hs, &lowbound, - key_pairs[i].key, key_pairs[i].keylen); + key_pairs[i].key, key_pairs[i].keylen); if (idx >= 0) { @@ -215,7 +215,7 @@ hstore_exists_all(PG_FUNCTION_ARGS) for (i = 0; i < nkeys; i++) { int idx = hstoreFindKey(hs, &lowbound, - key_pairs[i].key, key_pairs[i].keylen); + key_pairs[i].key, key_pairs[i].keylen); if (idx < 0) { @@ -546,8 +546,8 @@ hstore_concat(PG_FUNCTION_ARGS) if (difference >= 0) { HS_COPYITEM(ed, bufd, pd, - HSTORE_KEY(es2, ps2, s2idx), HSTORE_KEYLEN(es2, s2idx), - HSTORE_VALLEN(es2, s2idx), HSTORE_VALISNULL(es2, s2idx)); + HSTORE_KEY(es2, ps2, s2idx), HSTORE_KEYLEN(es2, s2idx), + HSTORE_VALLEN(es2, s2idx), HSTORE_VALISNULL(es2, s2idx)); ++s2idx; if (difference == 0) ++s1idx; @@ -555,8 +555,8 @@ hstore_concat(PG_FUNCTION_ARGS) else { HS_COPYITEM(ed, bufd, pd, - HSTORE_KEY(es1, ps1, s1idx), HSTORE_KEYLEN(es1, s1idx), - HSTORE_VALLEN(es1, s1idx), HSTORE_VALISNULL(es1, s1idx)); + HSTORE_KEY(es1, ps1, s1idx), HSTORE_KEYLEN(es1, s1idx), + HSTORE_VALLEN(es1, s1idx), HSTORE_VALISNULL(es1, s1idx)); ++s1idx; } } @@ -614,8 +614,8 @@ hstore_slice_to_array(PG_FUNCTION_ARGS) else { out_datums[i] = PointerGetDatum( - cstring_to_text_with_len(HSTORE_VAL(entries, ptr, idx), - HSTORE_VALLEN(entries, idx))); + cstring_to_text_with_len(HSTORE_VAL(entries, ptr, idx), + HSTORE_VALLEN(entries, idx))); out_nulls[i] = false; } } @@ -667,7 +667,7 @@ hstore_slice_to_hstore(PG_FUNCTION_ARGS) for (i = 0; i < nkeys; ++i) { int idx = hstoreFindKey(hs, &lastidx, - key_pairs[i].key, key_pairs[i].keylen); + key_pairs[i].key, key_pairs[i].keylen); if (idx >= 0) { @@ -760,7 +760,7 @@ hstore_avals(PG_FUNCTION_ARGS) else { text *item = cstring_to_text_with_len(HSTORE_VAL(entries, base, i), - HSTORE_VALLEN(entries, i)); + HSTORE_VALLEN(entries, i)); d[i] = PointerGetDatum(item); nulls[i] = false; @@ -811,7 +811,7 @@ hstore_to_array_internal(HStore *hs, int ndims) else { text *item = cstring_to_text_with_len(HSTORE_VAL(entries, base, i), - HSTORE_VALLEN(entries, i)); + HSTORE_VALLEN(entries, i)); out_datums[i * 2 + 1] = PointerGetDatum(item); out_nulls[i * 2 + 1] = false; diff --git a/contrib/intarray/_int.h b/contrib/intarray/_int.h index d524f0fed5..b689eb7ded 100644 --- a/contrib/intarray/_int.h +++ b/contrib/intarray/_int.h @@ -173,4 +173,4 @@ int compDESC(const void *a, const void *b); (direction) ? compASC : compDESC ); \ } while(0) -#endif /* ___INT_H__ */ +#endif /* ___INT_H__ */ diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c index 5d9e676660..a18c645606 100644 --- a/contrib/intarray/_int_bool.c +++ b/contrib/intarray/_int_bool.c @@ -506,8 +506,8 @@ bqarr_in(PG_FUNCTION_ARGS) if (state.num > QUERYTYPEMAXITEMS) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("number of query items (%d) exceeds the maximum allowed (%d)", - state.num, (int) QUERYTYPEMAXITEMS))); + errmsg("number of query items (%d) exceeds the maximum allowed (%d)", + state.num, (int) QUERYTYPEMAXITEMS))); commonlen = COMPUTESIZE(state.num); query = (QUERYTYPE *) palloc(commonlen); diff --git a/contrib/intarray/_int_gin.c b/contrib/intarray/_int_gin.c index fb16b66edb..73628bea11 100644 --- a/contrib/intarray/_int_gin.c +++ b/contrib/intarray/_int_gin.c @@ -93,7 +93,7 @@ ginint4_queryextract(PG_FUNCTION_ARGS) case RTOldContainsStrategyNumber: if (*nentries > 0) *searchMode = GIN_SEARCH_MODE_DEFAULT; - else /* everything contains the empty set */ + else /* everything contains the empty set */ *searchMode = GIN_SEARCH_MODE_ALL; break; default: diff --git a/contrib/intarray/_int_gist.c b/contrib/intarray/_int_gist.c index 888c277e60..79521b29b0 100644 --- a/contrib/intarray/_int_gist.c +++ b/contrib/intarray/_int_gist.c @@ -83,7 +83,7 @@ g_int_consistent(PG_FUNCTION_ARGS) case RTOldContainedByStrategyNumber: if (GIST_LEAF(entry)) retval = inner_int_contains(query, - (ArrayType *) DatumGetPointer(entry->key)); + (ArrayType *) DatumGetPointer(entry->key)); else retval = inner_int_overlap((ArrayType *) DatumGetPointer(entry->key), query); diff --git a/contrib/intarray/_int_op.c b/contrib/intarray/_int_op.c index c30d3c8269..3637c4564c 100644 --- a/contrib/intarray/_int_op.c +++ b/contrib/intarray/_int_op.c @@ -49,8 +49,8 @@ _int_different(PG_FUNCTION_ARGS) PG_RETURN_BOOL(!DatumGetBool( DirectFunctionCall2( _int_same, - PointerGetDatum(PG_GETARG_POINTER(0)), - PointerGetDatum(PG_GETARG_POINTER(1)) + PointerGetDatum(PG_GETARG_POINTER(0)), + PointerGetDatum(PG_GETARG_POINTER(1)) ) )); } diff --git a/contrib/intarray/_int_selfuncs.c b/contrib/intarray/_int_selfuncs.c index 3d92025ba5..acb87d10f0 100644 --- a/contrib/intarray/_int_selfuncs.c +++ b/contrib/intarray/_int_selfuncs.c @@ -57,7 +57,7 @@ _int_overlap_sel(PG_FUNCTION_ARGS) { PG_RETURN_DATUM(DirectFunctionCall4(arraycontsel, PG_GETARG_DATUM(0), - ObjectIdGetDatum(OID_ARRAY_OVERLAP_OP), + ObjectIdGetDatum(OID_ARRAY_OVERLAP_OP), PG_GETARG_DATUM(2), PG_GETARG_DATUM(3))); } @@ -67,7 +67,7 @@ _int_contains_sel(PG_FUNCTION_ARGS) { PG_RETURN_DATUM(DirectFunctionCall4(arraycontsel, PG_GETARG_DATUM(0), - ObjectIdGetDatum(OID_ARRAY_CONTAINS_OP), + ObjectIdGetDatum(OID_ARRAY_CONTAINS_OP), PG_GETARG_DATUM(2), PG_GETARG_DATUM(3))); } @@ -77,7 +77,7 @@ _int_contained_sel(PG_FUNCTION_ARGS) { PG_RETURN_DATUM(DirectFunctionCall4(arraycontsel, PG_GETARG_DATUM(0), - ObjectIdGetDatum(OID_ARRAY_CONTAINED_OP), + ObjectIdGetDatum(OID_ARRAY_CONTAINED_OP), PG_GETARG_DATUM(2), PG_GETARG_DATUM(3))); } @@ -87,7 +87,7 @@ _int_overlap_joinsel(PG_FUNCTION_ARGS) { PG_RETURN_DATUM(DirectFunctionCall5(arraycontjoinsel, PG_GETARG_DATUM(0), - ObjectIdGetDatum(OID_ARRAY_OVERLAP_OP), + ObjectIdGetDatum(OID_ARRAY_OVERLAP_OP), PG_GETARG_DATUM(2), PG_GETARG_DATUM(3), PG_GETARG_DATUM(4))); @@ -98,7 +98,7 @@ _int_contains_joinsel(PG_FUNCTION_ARGS) { PG_RETURN_DATUM(DirectFunctionCall5(arraycontjoinsel, PG_GETARG_DATUM(0), - ObjectIdGetDatum(OID_ARRAY_CONTAINS_OP), + ObjectIdGetDatum(OID_ARRAY_CONTAINS_OP), PG_GETARG_DATUM(2), PG_GETARG_DATUM(3), PG_GETARG_DATUM(4))); @@ -109,7 +109,7 @@ _int_contained_joinsel(PG_FUNCTION_ARGS) { PG_RETURN_DATUM(DirectFunctionCall5(arraycontjoinsel, PG_GETARG_DATUM(0), - ObjectIdGetDatum(OID_ARRAY_CONTAINED_OP), + ObjectIdGetDatum(OID_ARRAY_CONTAINED_OP), PG_GETARG_DATUM(2), PG_GETARG_DATUM(3), PG_GETARG_DATUM(4))); diff --git a/contrib/intarray/_int_tool.c b/contrib/intarray/_int_tool.c index 3c52912bbf..2fdfd2ec63 100644 --- a/contrib/intarray/_int_tool.c +++ b/contrib/intarray/_int_tool.c @@ -282,7 +282,7 @@ internal_size(int *a, int len) for (i = 0; i < len; i += 2) { - if (!i || a[i] != a[i - 1]) /* do not count repeated range */ + if (!i || a[i] != a[i - 1]) /* do not count repeated range */ size += a[i + 1] - a[i] + 1; } diff --git a/contrib/isn/isn.c b/contrib/isn/isn.c index c3c10e14bc..4d845b716f 100644 --- a/contrib/isn/isn.c +++ b/contrib/isn/isn.c @@ -131,7 +131,7 @@ invalidindex: elog(DEBUG1, "index %d is invalid", j); return false; } -#endif /* ISN_DEBUG */ +#endif /* ISN_DEBUG */ /*---------------------------------------------------------- * Formatting and conversion routines. @@ -699,11 +699,11 @@ string2ean(const char *str, bool errorOK, ean13 *result, /* recognize and validate the number: */ while (*aux2 && length <= 13) { - last = (*(aux2 + 1) == '!' || *(aux2 + 1) == '\0'); /* is the last character */ + last = (*(aux2 + 1) == '!' || *(aux2 + 1) == '\0'); /* is the last character */ digit = (isdigit((unsigned char) *aux2) != 0); /* is current character * a digit? */ - if (*aux2 == '?' && last) /* automagically calculate check digit - * if it's '?' */ + if (*aux2 == '?' && last) /* automagically calculate check digit if + * it's '?' */ magic = digit = true; if (length == 0 && (*aux2 == 'M' || *aux2 == 'm')) { @@ -832,8 +832,8 @@ string2ean(const char *str, bool errorOK, ean13 *result, goto eanwrongtype; break; case ISMN: - memcpy(buf, "9790", 4); /* this isn't for sure yet, for now - * ISMN it's only 9790 */ + memcpy(buf, "9790", 4); /* this isn't for sure yet, for now ISMN + * it's only 9790 */ valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic)); break; case ISBN: @@ -887,8 +887,8 @@ eanbadcheck: { ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("invalid check digit for %s number: \"%s\", should be %c", - isn_names[accept], str, (rcheck == 10) ? ('X') : (rcheck + '0')))); + errmsg("invalid check digit for %s number: \"%s\", should be %c", + isn_names[accept], str, (rcheck == 10) ? ('X') : (rcheck + '0')))); } } return false; @@ -1123,7 +1123,7 @@ accept_weak_input(PG_FUNCTION_ARGS) g_weak = PG_GETARG_BOOL(0); #else /* function has no effect */ -#endif /* ISN_WEAK_MODE */ +#endif /* ISN_WEAK_MODE */ PG_RETURN_BOOL(g_weak); } diff --git a/contrib/isn/isn.h b/contrib/isn/isn.h index 09dc7c6575..e2c8a26234 100644 --- a/contrib/isn/isn.h +++ b/contrib/isn/isn.h @@ -32,4 +32,4 @@ typedef uint64 ean13; extern void initialize(void); -#endif /* ISN_H */ +#endif /* ISN_H */ diff --git a/contrib/lo/lo.c b/contrib/lo/lo.c index 6bd2430931..4585923ee2 100644 --- a/contrib/lo/lo.c +++ b/contrib/lo/lo.c @@ -32,11 +32,11 @@ lo_manage(PG_FUNCTION_ARGS) HeapTuple newtuple; /* The new value for tuple */ HeapTuple trigtuple; /* The original value of tuple */ - if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */ + if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */ elog(ERROR, "%s: not fired by trigger manager", trigdata->tg_trigger->tgname); - if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ + if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ elog(ERROR, "%s: must be fired for row", trigdata->tg_trigger->tgname); diff --git a/contrib/ltree/_ltree_op.c b/contrib/ltree/_ltree_op.c index c0c56a40d4..fdf6ebb43b 100644 --- a/contrib/ltree/_ltree_op.c +++ b/contrib/ltree/_ltree_op.c @@ -53,7 +53,7 @@ array_iterator(ArrayType *la, PGCALL2 callback, void *param, ltree **found) while (num > 0) { if (DatumGetBool(DirectFunctionCall2(callback, - PointerGetDatum(item), PointerGetDatum(param)))) + PointerGetDatum(item), PointerGetDatum(param)))) { if (found) diff --git a/contrib/ltree/lquery_op.c b/contrib/ltree/lquery_op.c index 31d150db40..229ddd0ae3 100644 --- a/contrib/ltree/lquery_op.c +++ b/contrib/ltree/lquery_op.c @@ -147,7 +147,7 @@ static struct { bool muse; uint32 high_pos; -} SomeStack = +} SomeStack = { false, 0, @@ -356,7 +356,7 @@ lt_q_regex(PG_FUNCTION_ARGS) while (num > 0) { if (DatumGetBool(DirectFunctionCall2(ltq_regex, - PointerGetDatum(tree), PointerGetDatum(query)))) + PointerGetDatum(tree), PointerGetDatum(query)))) { res = true; diff --git a/contrib/ltree/ltree.h b/contrib/ltree/ltree.h index c604357dbf..fd86323ffe 100644 --- a/contrib/ltree/ltree.h +++ b/contrib/ltree/ltree.h @@ -125,7 +125,7 @@ typedef struct #define OPR 3 #define OPEN 4 #define CLOSE 5 -#define VALTRUE 6 /* for stop words */ +#define VALTRUE 6 /* for stop words */ #define VALFALSE 7 @@ -161,7 +161,7 @@ bool ltree_execute(ITEM *curitem, void *checkval, int ltree_compare(const ltree *a, const ltree *b); bool inner_isparent(const ltree *c, const ltree *p); bool compare_subnode(ltree_level *t, char *q, int len, - int (*cmpptr) (const char *, const char *, size_t), bool anyend); + int (*cmpptr) (const char *, const char *, size_t), bool anyend); ltree *lca_inner(ltree **a, int len); int ltree_strncasecmp(const char *a, const char *b, size_t s); diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c index 033a477c61..70e78a672a 100644 --- a/contrib/ltree/ltree_gist.c +++ b/contrib/ltree/ltree_gist.c @@ -302,7 +302,7 @@ ltree_picksplit(PG_FUNCTION_ARGS) for (j = FirstOffsetNumber; j <= maxoff; j = OffsetNumberNext(j)) { array[j].index = j; - lu = GETENTRY(entryvec, j); /* use as tmp val */ + lu = GETENTRY(entryvec, j); /* use as tmp val */ array[j].r = LTG_GETLNODE(lu); } @@ -312,7 +312,7 @@ ltree_picksplit(PG_FUNCTION_ARGS) lu_l = lu_r = ru_l = ru_r = NULL; for (j = FirstOffsetNumber; j <= maxoff; j = OffsetNumberNext(j)) { - lu = GETENTRY(entryvec, array[j].index); /* use as tmp val */ + lu = GETENTRY(entryvec, array[j].index); /* use as tmp val */ if (j <= (maxoff - FirstOffsetNumber + 1) / 2) { v->spl_left[v->spl_nleft] = array[j].index; @@ -672,8 +672,8 @@ ltree_consistent(PG_FUNCTION_ARGS) query = PG_GETARG_LQUERY(1); if (GIST_LEAF(entry)) res = DatumGetBool(DirectFunctionCall2(ltq_regex, - PointerGetDatum(LTG_NODE(key)), - PointerGetDatum((lquery *) query) + PointerGetDatum(LTG_NODE(key)), + PointerGetDatum((lquery *) query) )); else res = (gist_qe(key, (lquery *) query) && gist_between(key, (lquery *) query)); @@ -683,8 +683,8 @@ ltree_consistent(PG_FUNCTION_ARGS) query = PG_GETARG_LQUERY(1); if (GIST_LEAF(entry)) res = DatumGetBool(DirectFunctionCall2(ltxtq_exec, - PointerGetDatum(LTG_NODE(key)), - PointerGetDatum((lquery *) query) + PointerGetDatum(LTG_NODE(key)), + PointerGetDatum((lquery *) query) )); else res = gist_qtxt(key, (ltxtquery *) query); @@ -694,8 +694,8 @@ ltree_consistent(PG_FUNCTION_ARGS) query = DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(1))); if (GIST_LEAF(entry)) res = DatumGetBool(DirectFunctionCall2(lt_q_regex, - PointerGetDatum(LTG_NODE(key)), - PointerGetDatum((ArrayType *) query) + PointerGetDatum(LTG_NODE(key)), + PointerGetDatum((ArrayType *) query) )); else res = arrq_cons(key, (ArrayType *) query); diff --git a/contrib/ltree/ltree_io.c b/contrib/ltree/ltree_io.c index a1d4a0d38f..34ca597a48 100644 --- a/contrib/ltree/ltree_io.c +++ b/contrib/ltree/ltree_io.c @@ -61,8 +61,8 @@ ltree_in(PG_FUNCTION_ARGS) if (num + 1 > MaxAllocSize / sizeof(nodeitem)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("number of levels (%d) exceeds the maximum allowed (%d)", - num + 1, (int) (MaxAllocSize / sizeof(nodeitem))))); + errmsg("number of levels (%d) exceeds the maximum allowed (%d)", + num + 1, (int) (MaxAllocSize / sizeof(nodeitem))))); list = lptr = (nodeitem *) palloc(sizeof(nodeitem) * (num + 1)); ptr = buf; while (*ptr) @@ -230,8 +230,8 @@ lquery_in(PG_FUNCTION_ARGS) if (num > MaxAllocSize / ITEMSIZE) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("number of levels (%d) exceeds the maximum allowed (%d)", - num, (int) (MaxAllocSize / ITEMSIZE)))); + errmsg("number of levels (%d) exceeds the maximum allowed (%d)", + num, (int) (MaxAllocSize / ITEMSIZE)))); curqlevel = tmpql = (lquery_level *) palloc0(ITEMSIZE * num); ptr = buf; while (*ptr) diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c index aab71aed2f..8af99decad 100644 --- a/contrib/oid2name/oid2name.c +++ b/contrib/oid2name/oid2name.c @@ -57,7 +57,7 @@ void sql_exec_dumpalltbspc(PGconn *, struct options *); /* function to parse command line options and check for some usage errors. */ void -get_opts(int argc, char **argv, struct options * my_opts) +get_opts(int argc, char **argv, struct options *my_opts) { int c; const char *progname; @@ -211,7 +211,7 @@ add_one_elt(char *eltname, eary *eary) { eary ->alloc *= 2; eary ->array = (char **) pg_realloc(eary->array, - eary->alloc * sizeof(char *)); + eary->alloc * sizeof(char *)); } eary ->array[eary->num] = pg_strdup(eltname); @@ -260,7 +260,7 @@ get_comma_elts(eary *eary) /* establish connection with database. */ PGconn * -sql_conn(struct options * my_opts) +sql_conn(struct options *my_opts) { PGconn *conn; bool have_password = false; @@ -411,7 +411,7 @@ sql_exec(PGconn *conn, const char *todo, bool quiet) * Dump all databases. There are no system objects to worry about. */ void -sql_exec_dumpalldbs(PGconn *conn, struct options * opts) +sql_exec_dumpalldbs(PGconn *conn, struct options *opts) { char todo[1024]; @@ -428,7 +428,7 @@ sql_exec_dumpalldbs(PGconn *conn, struct options * opts) * Dump all tables, indexes and sequences in the current database. */ void -sql_exec_dumpalltables(PGconn *conn, struct options * opts) +sql_exec_dumpalltables(PGconn *conn, struct options *opts) { char todo[1024]; char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" "; @@ -436,7 +436,7 @@ sql_exec_dumpalltables(PGconn *conn, struct options * opts) snprintf(todo, sizeof(todo), "SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s " "FROM pg_catalog.pg_class c " - " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " " LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database()," " pg_catalog.pg_tablespace t " "WHERE relkind IN (" CppAsString2(RELKIND_RELATION) "," @@ -460,7 +460,7 @@ sql_exec_dumpalltables(PGconn *conn, struct options * opts) * given objects in the current database. */ void -sql_exec_searchtables(PGconn *conn, struct options * opts) +sql_exec_searchtables(PGconn *conn, struct options *opts) { char *todo; char *qualifiers, @@ -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) "," @@ -516,7 +516,7 @@ sql_exec_searchtables(PGconn *conn, struct options * opts) CppAsString2(RELKIND_SEQUENCE) "," CppAsString2(RELKIND_TOASTVALUE) ") AND\n" " t.oid = CASE\n" - " WHEN reltablespace <> 0 THEN reltablespace\n" + " WHEN reltablespace <> 0 THEN reltablespace\n" " ELSE dattablespace\n" " END AND\n" " (%s)\n" @@ -530,7 +530,7 @@ sql_exec_searchtables(PGconn *conn, struct options * opts) } void -sql_exec_dumpalltbspc(PGconn *conn, struct options * opts) +sql_exec_dumpalltbspc(PGconn *conn, struct options *opts) { char todo[1024]; diff --git a/contrib/pageinspect/brinfuncs.c b/contrib/pageinspect/brinfuncs.c index d52807dcdd..13da7616e7 100644 --- a/contrib/pageinspect/brinfuncs.c +++ b/contrib/pageinspect/brinfuncs.c @@ -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; diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c index 02440eca47..4f834676ea 100644 --- a/contrib/pageinspect/btreefuncs.c +++ b/contrib/pageinspect/btreefuncs.c @@ -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); diff --git a/contrib/pageinspect/ginfuncs.c b/contrib/pageinspect/ginfuncs.c index 993fc2d9ae..f774495b6f 100644 --- a/contrib/pageinspect/ginfuncs.c +++ b/contrib/pageinspect/ginfuncs.c @@ -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)))); diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c index 228a147c9e..dbe3b6ab04 100644 --- a/contrib/pageinspect/hashfuncs.c +++ b/contrib/pageinspect/hashfuncs.c @@ -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), diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c index 1448effb50..72d1776a4a 100644 --- a/contrib/pageinspect/heapfuncs.c +++ b/contrib/pageinspect/heapfuncs.c @@ -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); } diff --git a/contrib/pageinspect/pageinspect.h b/contrib/pageinspect/pageinspect.h index 55ca68fab3..f49cf9e892 100644 --- a/contrib/pageinspect/pageinspect.h +++ b/contrib/pageinspect/pageinspect.h @@ -18,4 +18,4 @@ /* in rawpage.c */ extern Page get_page_from_raw(bytea *raw_page); -#endif /* _PAGEINSPECT_H_ */ +#endif /* _PAGEINSPECT_H_ */ diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c index f273dfa7cb..e9d3131bda 100644 --- a/contrib/pageinspect/rawpage.c +++ b/contrib/pageinspect/rawpage.c @@ -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); diff --git a/contrib/passwordcheck/passwordcheck.c b/contrib/passwordcheck/passwordcheck.c index 59f73a1e6b..b80fd458ad 100644 --- a/contrib/passwordcheck/passwordcheck.c +++ b/contrib/passwordcheck/passwordcheck.c @@ -112,7 +112,7 @@ check_password(const char *username, if (!pwd_has_letter || !pwd_has_nonletter) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("password must contain both letters and nonletters"))); + errmsg("password must contain both letters and nonletters"))); #ifdef USE_CRACKLIB /* call cracklib to check password */ diff --git a/contrib/pg_buffercache/pg_buffercache_pages.c b/contrib/pg_buffercache/pg_buffercache_pages.c index 8bebf2384d..b410aafa5a 100644 --- a/contrib/pg_buffercache/pg_buffercache_pages.c +++ b/contrib/pg_buffercache/pg_buffercache_pages.c @@ -66,7 +66,7 @@ pg_buffercache_pages(PG_FUNCTION_ARGS) FuncCallContext *funcctx; Datum result; MemoryContext oldcontext; - BufferCachePagesContext *fctx; /* User function context. */ + BufferCachePagesContext *fctx; /* User function context. */ TupleDesc tupledesc; TupleDesc expected_tupledesc; HeapTuple tuple; diff --git a/contrib/pg_prewarm/pg_prewarm.c b/contrib/pg_prewarm/pg_prewarm.c index 78d71ab078..fec62b1a54 100644 --- a/contrib/pg_prewarm/pg_prewarm.c +++ b/contrib/pg_prewarm/pg_prewarm.c @@ -138,8 +138,8 @@ pg_prewarm(PG_FUNCTION_ARGS) if (last_block < 0 || last_block >= nblocks) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("ending block number must be between 0 and " INT64_FORMAT, - nblocks - 1))); + errmsg("ending block number must be between 0 and " INT64_FORMAT, + nblocks - 1))); } /* Now we're ready to do the real work. */ diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c index c37eaa395d..d7fa2a80c6 100644 --- a/contrib/pg_standby/pg_standby.c +++ b/contrib/pg_standby/pg_standby.c @@ -44,8 +44,8 @@ int maxwaittime = 0; /* how long are we prepared to wait for? */ int keepfiles = 0; /* number of WAL files to keep, 0 keep all */ int maxretries = 3; /* number of retries on restore command */ bool debug = false; /* are we debugging? */ -bool need_cleanup = false; /* do we need to remove files from - * archive? */ +bool need_cleanup = false; /* do we need to remove files from + * archive? */ #ifndef WIN32 static volatile sig_atomic_t signaled = false; @@ -59,8 +59,8 @@ 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 restoreCommand[MAXPGPATH]; /* run this to restore */ -char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to - * get from archive */ +char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to get + * from archive */ /* * Two types of failover are supported (smart and fast failover). @@ -256,7 +256,7 @@ CustomizableCleanupPriorWALFiles(void) * in case this worries you. */ if (IsXLogFileName(xlde->d_name) && - strcmp(xlde->d_name + 8, exclusiveCleanupFileName + 8) < 0) + strcmp(xlde->d_name + 8, exclusiveCleanupFileName + 8) < 0) { #ifdef WIN32 snprintf(WALFilePath, sizeof(WALFilePath), "%s\\%s", archiveLocation, xlde->d_name); @@ -523,7 +523,7 @@ usage(void) "Main intended use as restore_command in recovery.conf:\n" " restore_command = 'pg_standby [OPTION]... ARCHIVELOCATION %%f %%p %%r'\n" "e.g.\n" - " restore_command = 'pg_standby /mnt/server/archiverdir %%f %%p %%r'\n"); + " restore_command = 'pg_standby /mnt/server/archiverdir %%f %%p %%r'\n"); printf("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"); } @@ -582,7 +582,7 @@ main(int argc, char **argv) * There's no way to trigger failover via signal on Windows. */ (void) pqsignal(SIGUSR1, sighandler); - (void) pqsignal(SIGINT, sighandler); /* deprecated, use SIGUSR1 */ + (void) pqsignal(SIGINT, sighandler); /* deprecated, use SIGUSR1 */ (void) pqsignal(SIGQUIT, sigquit_handler); #endif diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index 3c35604b5d..5e6e726ed2 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -107,7 +107,7 @@ static const uint32 PGSS_PG_MAJOR_VERSION = PG_VERSION_NUM / 100; #define ASSUMED_LENGTH_INIT 1024 /* initial assumed mean query length */ #define USAGE_DECREASE_FACTOR (0.99) /* decreased every entry_dealloc */ #define STICKY_DECREASE_FACTOR (0.50) /* factor for sticky entries */ -#define USAGE_DEALLOC_PERCENT 5 /* free this % of entries at once */ +#define USAGE_DEALLOC_PERCENT 5 /* free this % of entries at once */ #define JUMBLE_SIZE 1024 /* query serialization buffer size */ @@ -146,15 +146,15 @@ typedef struct Counters double sum_var_time; /* sum of variances in execution time in msec */ int64 rows; /* total # of retrieved or affected rows */ int64 shared_blks_hit; /* # of shared buffer hits */ - int64 shared_blks_read; /* # of shared disk blocks read */ + int64 shared_blks_read; /* # of shared disk blocks read */ int64 shared_blks_dirtied; /* # of shared disk blocks dirtied */ int64 shared_blks_written; /* # of shared disk blocks written */ int64 local_blks_hit; /* # of local buffer hits */ int64 local_blks_read; /* # of local disk blocks read */ - int64 local_blks_dirtied; /* # of local disk blocks dirtied */ - int64 local_blks_written; /* # of local disk blocks written */ + int64 local_blks_dirtied; /* # of local disk blocks dirtied */ + int64 local_blks_written; /* # of local disk blocks written */ int64 temp_blks_read; /* # of temp blocks read */ - int64 temp_blks_written; /* # of temp blocks written */ + int64 temp_blks_written; /* # of temp blocks written */ double blk_read_time; /* time spent reading, in msec */ double blk_write_time; /* time spent writing, in msec */ double usage; /* usage factor */ @@ -183,7 +183,7 @@ typedef struct pgssEntry typedef struct pgssSharedState { LWLock *lock; /* protects hashtable search/modification */ - double cur_median_usage; /* current median usage in hashtable */ + double cur_median_usage; /* current median usage in hashtable */ Size mean_query_len; /* current mean entry text length */ slock_t mutex; /* protects following fields only: */ Size extent; /* current extent of query file */ @@ -250,7 +250,7 @@ typedef enum PGSS_TRACK_NONE, /* track no statements */ PGSS_TRACK_TOP, /* only top level statements */ PGSS_TRACK_ALL /* all statements, including nested ones */ -} PGSSTrackLevel; +} PGSSTrackLevel; static const struct config_enum_entry track_options[] = { @@ -362,7 +362,7 @@ _PG_init(void) * Define (or redefine) custom GUC variables. */ DefineCustomIntVariable("pg_stat_statements.max", - "Sets the maximum number of statements tracked by pg_stat_statements.", + "Sets the maximum number of statements tracked by pg_stat_statements.", NULL, &pgss_max, 5000, @@ -375,7 +375,7 @@ _PG_init(void) NULL); DefineCustomEnumVariable("pg_stat_statements.track", - "Selects which statements are tracked by pg_stat_statements.", + "Selects which statements are tracked by pg_stat_statements.", NULL, &pgss_track, PGSS_TRACK_TOP, @@ -387,7 +387,7 @@ _PG_init(void) NULL); DefineCustomBoolVariable("pg_stat_statements.track_utility", - "Selects whether utility commands are tracked by pg_stat_statements.", + "Selects whether utility commands are tracked by pg_stat_statements.", NULL, &pgss_track_utility, true, @@ -398,7 +398,7 @@ _PG_init(void) NULL); DefineCustomBoolVariable("pg_stat_statements.save", - "Save pg_stat_statements statistics across server shutdowns.", + "Save pg_stat_statements statistics across server shutdowns.", NULL, &pgss_save, true, @@ -944,7 +944,7 @@ pgss_ExecutorEnd(QueryDesc *queryDesc) queryId, queryDesc->plannedstmt->stmt_location, queryDesc->plannedstmt->stmt_len, - queryDesc->totaltime->total * 1000.0, /* convert to msec */ + queryDesc->totaltime->total * 1000.0, /* convert to msec */ queryDesc->estate->es_processed, &queryDesc->totaltime->bufusage, NULL); @@ -1353,7 +1353,7 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS) #define PG_STAT_STATEMENTS_COLS_V1_1 18 #define PG_STAT_STATEMENTS_COLS_V1_2 19 #define PG_STAT_STATEMENTS_COLS_V1_3 23 -#define PG_STAT_STATEMENTS_COLS 23 /* maximum of above */ +#define PG_STAT_STATEMENTS_COLS 23 /* maximum of above */ /* * Retrieve statement statistics. @@ -1956,8 +1956,8 @@ qtext_load_file(Size *buffer_size) if (errno != ENOENT) ereport(LOG, (errcode_for_file_access(), - errmsg("could not read pg_stat_statement file \"%s\": %m", - PGSS_TEXT_FILE))); + errmsg("could not read pg_stat_statement file \"%s\": %m", + PGSS_TEXT_FILE))); return NULL; } @@ -2001,8 +2001,8 @@ qtext_load_file(Size *buffer_size) if (errno) ereport(LOG, (errcode_for_file_access(), - errmsg("could not read pg_stat_statement file \"%s\": %m", - PGSS_TEXT_FILE))); + errmsg("could not read pg_stat_statement file \"%s\": %m", + PGSS_TEXT_FILE))); free(buf); CloseTransientFile(fd); return NULL; @@ -2161,8 +2161,8 @@ gc_qtexts(void) { ereport(LOG, (errcode_for_file_access(), - errmsg("could not write pg_stat_statement file \"%s\": %m", - PGSS_TEXT_FILE))); + errmsg("could not write pg_stat_statement file \"%s\": %m", + PGSS_TEXT_FILE))); hash_seq_term(&hash_seq); goto gc_fail; } @@ -2179,8 +2179,8 @@ gc_qtexts(void) if (ftruncate(fileno(qfile), extent) != 0) ereport(LOG, (errcode_for_file_access(), - errmsg("could not truncate pg_stat_statement file \"%s\": %m", - PGSS_TEXT_FILE))); + errmsg("could not truncate pg_stat_statement file \"%s\": %m", + PGSS_TEXT_FILE))); if (FreeFile(qfile)) { @@ -2246,8 +2246,8 @@ gc_fail: if (qfile == NULL) ereport(LOG, (errcode_for_file_access(), - errmsg("could not write new pg_stat_statement file \"%s\": %m", - PGSS_TEXT_FILE))); + errmsg("could not write new pg_stat_statement file \"%s\": %m", + PGSS_TEXT_FILE))); else FreeFile(qfile); @@ -2307,8 +2307,8 @@ entry_reset(void) if (ftruncate(fileno(qfile), 0) != 0) ereport(LOG, (errcode_for_file_access(), - errmsg("could not truncate pg_stat_statement file \"%s\": %m", - PGSS_TEXT_FILE))); + errmsg("could not truncate pg_stat_statement file \"%s\": %m", + PGSS_TEXT_FILE))); FreeFile(qfile); @@ -2983,12 +2983,12 @@ generate_normalized_query(pgssJumbleState *jstate, const char *query, char *norm_query; int query_len = *query_len_p; int i, - norm_query_buflen, /* Space allowed for norm_query */ + norm_query_buflen, /* Space allowed for norm_query */ len_to_wrt, /* Length (in bytes) to write */ quer_loc = 0, /* Source query byte location */ n_quer_loc = 0, /* Normalized query byte location */ last_off = 0, /* Offset from start for previous tok */ - last_tok_len = 0; /* Length (in bytes) of that tok */ + last_tok_len = 0; /* Length (in bytes) of that tok */ /* * Get constants' lengths (core system only gives us locations). Note diff --git a/contrib/pg_trgm/trgm.h b/contrib/pg_trgm/trgm.h index 8cd88e763c..45df91875a 100644 --- a/contrib/pg_trgm/trgm.h +++ b/contrib/pg_trgm/trgm.h @@ -132,4 +132,4 @@ extern TRGM *createTrgmNFA(text *text_re, Oid collation, TrgmPackedGraph **graph, MemoryContext rcontext); extern bool trigramsMatchGraph(TrgmPackedGraph *graph, bool *check); -#endif /* __TRGM_H__ */ +#endif /* __TRGM_H__ */ diff --git a/contrib/pg_trgm/trgm_op.c b/contrib/pg_trgm/trgm_op.c index e9a713113e..f7e96acc53 100644 --- a/contrib/pg_trgm/trgm_op.c +++ b/contrib/pg_trgm/trgm_op.c @@ -325,7 +325,7 @@ generate_trgm(char *str, int slen) protect_out_of_mem(slen); - trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) *3); + trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) * 3); trg->flag = ARRKEY; len = generate_trgm_only(GETARR(trg), str, slen); @@ -572,8 +572,8 @@ calc_word_similarity(char *str1, int slen1, char *str2, int slen2, protect_out_of_mem(slen1 + slen2); /* Make positional trigrams */ - trg1 = (trgm *) palloc(sizeof(trgm) * (slen1 / 2 + 1) *3); - trg2 = (trgm *) palloc(sizeof(trgm) * (slen2 / 2 + 1) *3); + trg1 = (trgm *) palloc(sizeof(trgm) * (slen1 / 2 + 1) * 3); + trg2 = (trgm *) palloc(sizeof(trgm) * (slen2 / 2 + 1) * 3); len1 = generate_trgm_only(trg1, str1, slen1); len2 = generate_trgm_only(trg2, str2, slen2); @@ -806,7 +806,7 @@ generate_wildcard_trgm(const char *str, int slen) protect_out_of_mem(slen); - trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) *3); + trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) * 3); trg->flag = ARRKEY; SET_VARSIZE(trg, TRGMHDRSIZE); diff --git a/contrib/pg_trgm/trgm_regexp.c b/contrib/pg_trgm/trgm_regexp.c index 6ab2e49eb9..1d474e2aac 100644 --- a/contrib/pg_trgm/trgm_regexp.c +++ b/contrib/pg_trgm/trgm_regexp.c @@ -450,7 +450,7 @@ struct TrgmPackedGraph * by color trigram number. */ int colorTrigramsCount; - int *colorTrigramGroups; /* array of size colorTrigramsCount */ + int *colorTrigramGroups; /* array of size colorTrigramsCount */ /* * The states of the simplified NFA. State number 0 is always initial @@ -2350,4 +2350,4 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams) pfree(buf.data); } -#endif /* TRGM_REGEXP_DEBUG */ +#endif /* TRGM_REGEXP_DEBUG */ diff --git a/contrib/pg_visibility/pg_visibility.c b/contrib/pg_visibility/pg_visibility.c index 480f917d08..2cc9575d9f 100644 --- a/contrib/pg_visibility/pg_visibility.c +++ b/contrib/pg_visibility/pg_visibility.c @@ -481,7 +481,7 @@ collect_visibility_data(Oid relid, bool include_pd) check_relation_relkind(rel); nblocks = RelationGetNumberOfBlocks(rel); - info = palloc0(offsetof(vbits, bits) +nblocks); + info = palloc0(offsetof(vbits, bits) + nblocks); info->next = 0; info->count = nblocks; @@ -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/crypt-blowfish.c b/contrib/pgcrypto/crypt-blowfish.c index 6feaefcf7b..ed69c0c6bb 100644 --- a/contrib/pgcrypto/crypt-blowfish.c +++ b/contrib/pgcrypto/crypt-blowfish.c @@ -737,7 +737,7 @@ _crypt_blowfish_rn(const char *key, const char *setting, memcpy(output, setting, 7 + 22 - 1); output[7 + 22 - 1] = BF_itoa64[(int) - BF_atoi64[(int) setting[7 + 22 - 1] - 0x20] & 0x30]; + BF_atoi64[(int) setting[7 + 22 - 1] - 0x20] & 0x30]; /* This has to be bug-compatible with the original implementation, so * only encode 23 of the 24 bytes. :-) */ diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c index 44a5731dde..60bdbb0c91 100644 --- a/contrib/pgcrypto/crypt-des.c +++ b/contrib/pgcrypto/crypt-des.c @@ -734,7 +734,7 @@ px_crypt_des(const char *key, const char *setting) p = output + strlen(output); } else -#endif /* !DISABLE_XDES */ +#endif /* !DISABLE_XDES */ { /* * "old"-style: setting - 2 bytes of salt key - only up to the first 8 diff --git a/contrib/pgcrypto/crypt-gensalt.c b/contrib/pgcrypto/crypt-gensalt.c index 6dc7cbdb3a..740f361253 100644 --- a/contrib/pgcrypto/crypt-gensalt.c +++ b/contrib/pgcrypto/crypt-gensalt.c @@ -23,7 +23,7 @@ static unsigned char _crypt_itoa64[64 + 1] = char * _crypt_gensalt_traditional_rn(unsigned long count, - const char *input, int size, char *output, int output_size) + const char *input, int size, char *output, int output_size) { if (size < 2 || output_size < 2 + 1 || (count && count != 25)) { @@ -41,7 +41,7 @@ _crypt_gensalt_traditional_rn(unsigned long count, char * _crypt_gensalt_extended_rn(unsigned long count, - const char *input, int size, char *output, int output_size) + const char *input, int size, char *output, int output_size) { unsigned long value; @@ -77,7 +77,7 @@ _crypt_gensalt_extended_rn(unsigned long count, char * _crypt_gensalt_md5_rn(unsigned long count, - const char *input, int size, char *output, int output_size) + const char *input, int size, char *output, int output_size) { unsigned long value; @@ -159,7 +159,7 @@ BF_encode(char *dst, const BF_word *src, int size) char * _crypt_gensalt_blowfish_rn(unsigned long count, - const char *input, int size, char *output, int output_size) + const char *input, int size, char *output, int output_size) { if (size < 16 || output_size < 7 + 22 + 1 || (count && (count < 4 || count > 31))) diff --git a/contrib/pgcrypto/imath.c b/contrib/pgcrypto/imath.c index 61a01e2b71..cd528bfd83 100644 --- a/contrib/pgcrypto/imath.c +++ b/contrib/pgcrypto/imath.c @@ -908,7 +908,7 @@ mp_int_sqr(mp_int a, mp_int c) CHECK(a != NULL && c != NULL); /* Get a temporary buffer big enough to hold the result */ - osize = (mp_size) 4 *((MP_USED(a) + 1) / 2); + osize = (mp_size) 4 * ((MP_USED(a) + 1) / 2); if (a == c) { @@ -1613,8 +1613,8 @@ mp_int_gcd(mp_int a, mp_int b, mp_int c) CLEANUP: mp_int_clear(&v); -V: mp_int_clear(&u); -U: mp_int_clear(&t); +V: mp_int_clear(&u); +U: mp_int_clear(&t); return res; } @@ -1975,7 +1975,7 @@ mp_int_string_len(mp_int z, mp_size radix) if (radix < MP_MIN_RADIX || radix > MP_MAX_RADIX) return MP_RANGE; - len = s_outlen(z, radix) + 1; /* for terminator */ + len = s_outlen(z, radix) + 1; /* for terminator */ /* Allow for sign marker on negatives */ if (MP_SIGN(z) == MP_NEG) @@ -2512,7 +2512,7 @@ s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, /* Subtract corresponding digits and propagate borrow */ for (pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc) { - w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */ + w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */ (mp_word) *da) - w - (mp_word) *db; *dc = LOWER_HALF(w); @@ -2522,7 +2522,7 @@ s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, /* Finish the subtraction for remaining upper digits of da */ for ( /* */ ; pos < size_a; ++pos, ++da, ++dc) { - w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */ + w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */ (mp_word) *da) - w; *dc = LOWER_HALF(w); @@ -2594,10 +2594,10 @@ s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, * t1 and t2 are initially used as temporaries to compute the inner * product (a1 + a0)(b1 + b0) = a1b1 + a1b0 + a0b1 + a0b0 */ - carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */ + carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */ t1[bot_size] = carry; - carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */ + carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */ t2[bot_size] = carry; (void) s_kmul(t1, t2, t3, bot_size + 1, bot_size + 1); /* t3 = t1 * t2 */ @@ -2609,7 +2609,7 @@ s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, ZERO(t1, buf_size); ZERO(t2, buf_size); (void) s_kmul(da, db, t1, bot_size, bot_size); /* t1 = a0 * b0 */ - (void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */ + (void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */ /* Subtract out t1 and t2 to get the inner product */ s_usub(t3, t1, t3, buf_size + 2, buf_size); @@ -2692,10 +2692,10 @@ s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a) t3 = t2 + buf_size; ZERO(t1, 4 * buf_size); - (void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */ - (void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */ + (void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */ + (void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */ - (void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */ + (void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */ /* Quick multiply t3 by 2, shifting left (can't overflow) */ { @@ -2782,7 +2782,7 @@ s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a) w = UPPER_HALF(w); if (ov) { - w += MP_DIGIT_MAX; /* MP_RADIX */ + w += MP_DIGIT_MAX; /* MP_RADIX */ ++w; } } @@ -3512,7 +3512,7 @@ s_outlen(mp_int z, mp_size r) double raw; bits = mp_int_count_bits(z); - raw = (double) bits *s_log2[r]; + raw = (double) bits * s_log2[r]; return (int) (raw + 0.999999); } diff --git a/contrib/pgcrypto/imath.h b/contrib/pgcrypto/imath.h index 0a4f0f713f..2d7a5268e5 100644 --- a/contrib/pgcrypto/imath.h +++ b/contrib/pgcrypto/imath.h @@ -61,6 +61,7 @@ typedef struct mpz mp_size used; mp_sign sign; } mpz_t , + *mp_int; #define MP_DIGITS(Z) ((Z)->digits) @@ -105,9 +106,9 @@ void mp_int_free(mp_int z); mp_result mp_int_copy(mp_int a, mp_int c); /* c = a */ void mp_int_swap(mp_int a, mp_int c); /* swap a, c */ -void mp_int_zero(mp_int z); /* z = 0 */ -mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */ -mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */ +void mp_int_zero(mp_int z); /* z = 0 */ +mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */ +mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */ mp_result mp_int_add(mp_int a, mp_int b, mp_int c); /* c = a + b */ mp_result mp_int_add_value(mp_int a, int value, mp_int c); mp_result mp_int_sub(mp_int a, mp_int b, mp_int c); /* c = a - b */ @@ -115,23 +116,23 @@ mp_result mp_int_sub_value(mp_int a, int value, mp_int c); mp_result mp_int_mul(mp_int a, mp_int b, mp_int c); /* c = a * b */ mp_result mp_int_mul_value(mp_int a, int value, mp_int c); mp_result mp_int_mul_pow2(mp_int a, int p2, mp_int c); -mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */ +mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */ -mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */ +mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */ mp_int q, mp_int r); /* r = a % b */ -mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */ - mp_int q, int *r); /* r = a % value */ +mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */ + mp_int q, int *r); /* r = a % value */ mp_result mp_int_div_pow2(mp_int a, int p2, /* q = a / 2^p2 */ mp_int q, mp_int r); /* r = q % 2^p2 */ mp_result mp_int_mod(mp_int a, mp_int m, mp_int c); /* c = a % m */ #define mp_int_mod_value(A, V, R) mp_int_div_value((A), (V), 0, (R)) -mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */ +mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */ mp_result mp_int_expt_value(int a, int b, mp_int c); /* c = a^b */ int mp_int_compare(mp_int a, mp_int b); /* a <=> b */ -int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */ -int mp_int_compare_zero(mp_int z); /* a <=> 0 */ +int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */ +int mp_int_compare_zero(mp_int z); /* a <=> 0 */ int mp_int_compare_value(mp_int z, int value); /* a <=> v */ /* Returns true if v|a, false otherwise (including errors) */ @@ -143,15 +144,15 @@ int mp_int_is_pow2(mp_int z); mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m, mp_int c); /* c = a^b (mod m) */ mp_result mp_int_exptmod_evalue(mp_int a, int value, - mp_int m, mp_int c); /* c = a^v (mod m) */ + mp_int m, mp_int c); /* c = a^v (mod m) */ mp_result mp_int_exptmod_bvalue(int value, mp_int b, - mp_int m, mp_int c); /* c = v^b (mod m) */ + mp_int m, mp_int c); /* c = v^b (mod m) */ mp_result mp_int_exptmod_known(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c); /* c = a^b (mod m) */ mp_result mp_int_redux_const(mp_int m, mp_int c); -mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */ +mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */ mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c); /* c = gcd(a, b) */ @@ -206,4 +207,4 @@ void s_print(char *tag, mp_int z); void s_print_buf(char *tag, mp_digit *buf, mp_size num); #endif -#endif /* end IMATH_H_ */ +#endif /* end IMATH_H_ */ diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c index 2516092ba4..16dfe725ea 100644 --- a/contrib/pgcrypto/internal.c +++ b/contrib/pgcrypto/internal.c @@ -42,11 +42,11 @@ /* * System reseeds should be separated at least this much. */ -#define SYSTEM_RESEED_MIN (20*60) /* 20 min */ +#define SYSTEM_RESEED_MIN (20*60) /* 20 min */ /* * How often to roll dice. */ -#define SYSTEM_RESEED_CHECK_TIME (10*60) /* 10 min */ +#define SYSTEM_RESEED_CHECK_TIME (10*60) /* 10 min */ /* * The chance is x/256 that the reseed happens. */ @@ -318,7 +318,7 @@ rj_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv) } static int -rj_real_init(struct int_ctx * cx, int dir) +rj_real_init(struct int_ctx *cx, int dir) { aes_set_key(&cx->ctx.rj, cx->keybuf, cx->keylen * 8, dir); return 0; diff --git a/contrib/pgcrypto/mbuf.h b/contrib/pgcrypto/mbuf.h index 988293a729..50a989f059 100644 --- a/contrib/pgcrypto/mbuf.h +++ b/contrib/pgcrypto/mbuf.h @@ -51,7 +51,7 @@ struct PushFilterOps * copied (in-place) returns 0 on error */ int (*push) (PushFilter *next, void *priv, - const uint8 *src, int len); + const uint8 *src, int len); int (*flush) (PushFilter *next, void *priv); void (*free) (void *priv); }; @@ -69,7 +69,7 @@ struct PullFilterOps * use buf as work area if NULL in-place copy */ int (*pull) (void *priv, PullFilter *src, int len, - uint8 **data_p, uint8 *buf, int buflen); + uint8 **data_p, uint8 *buf, int buflen); void (*free) (void *priv); }; @@ -121,4 +121,4 @@ int pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf); (dst) = __b; \ } while (0) -#endif /* __PX_MBUF_H */ +#endif /* __PX_MBUF_H */ diff --git a/contrib/pgcrypto/md5.h b/contrib/pgcrypto/md5.h index 07d08c134d..3e6e8da5e7 100644 --- a/contrib/pgcrypto/md5.h +++ b/contrib/pgcrypto/md5.h @@ -76,4 +76,4 @@ do { \ md5_result((x), (y)); \ } while (0) -#endif /* ! _NETINET6_MD5_H_ */ +#endif /* ! _NETINET6_MD5_H_ */ diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c index 9ea60c4c47..7d31e5354b 100644 --- a/contrib/pgcrypto/pgp-decrypt.c +++ b/contrib/pgcrypto/pgp-decrypt.c @@ -460,7 +460,7 @@ mdcbuf_init(void **priv_p, void *arg, PullFilter *src) } static int -mdcbuf_finish(struct MDCBufData * st) +mdcbuf_finish(struct MDCBufData *st) { uint8 hash[20]; int res; @@ -485,7 +485,7 @@ mdcbuf_finish(struct MDCBufData * st) } static void -mdcbuf_load_data(struct MDCBufData * st, uint8 *src, int len) +mdcbuf_load_data(struct MDCBufData *st, uint8 *src, int len) { uint8 *dst = st->pos + st->avail; @@ -495,14 +495,14 @@ mdcbuf_load_data(struct MDCBufData * st, uint8 *src, int len) } static void -mdcbuf_load_mdc(struct MDCBufData * st, uint8 *src, int len) +mdcbuf_load_mdc(struct MDCBufData *st, uint8 *src, int len) { memmove(st->mdc_buf + st->mdc_avail, src, len); st->mdc_avail += len; } static int -mdcbuf_refill(struct MDCBufData * st, PullFilter *src) +mdcbuf_refill(struct MDCBufData *st, PullFilter *src) { uint8 *data; int res; diff --git a/contrib/pgcrypto/pgp-pgsql.c b/contrib/pgcrypto/pgp-pgsql.c index cc5df14725..0984e01a14 100644 --- a/contrib/pgcrypto/pgp-pgsql.c +++ b/contrib/pgcrypto/pgp-pgsql.c @@ -132,7 +132,7 @@ struct debug_expect }; static void -fill_expect(struct debug_expect * ex, int text_mode) +fill_expect(struct debug_expect *ex, int text_mode) { ex->debug = 0; ex->expect = 0; @@ -157,7 +157,7 @@ fill_expect(struct debug_expect * ex, int text_mode) } while (0) static void -check_expect(PGP_Context *ctx, struct debug_expect * ex) +check_expect(PGP_Context *ctx, struct debug_expect *ex) { EX_CHECK(cipher_algo); EX_CHECK(s2k_mode); @@ -179,7 +179,7 @@ show_debug(const char *msg) static int set_arg(PGP_Context *ctx, char *key, char *val, - struct debug_expect * ex) + struct debug_expect *ex) { int res = 0; @@ -317,7 +317,7 @@ downcase_convert(const uint8 *s, int len) static int parse_args(PGP_Context *ctx, uint8 *args, int arg_len, - struct debug_expect * ex) + struct debug_expect *ex) { char *str = downcase_convert(args, arg_len); char *key, @@ -362,7 +362,7 @@ create_mbuf_from_vardata(text *data) static void init_work(PGP_Context **ctx_p, int is_text, - text *args, struct debug_expect * ex) + text *args, struct debug_expect *ex) { int err = pgp_init(ctx_p); @@ -818,7 +818,7 @@ parse_key_value_arrays(ArrayType *key_array, ArrayType *val_array, if (!string_is_ascii(v)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("header key must not contain non-ASCII characters"))); + errmsg("header key must not contain non-ASCII characters"))); if (strstr(v, ": ")) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), @@ -840,7 +840,7 @@ parse_key_value_arrays(ArrayType *key_array, ArrayType *val_array, if (!string_is_ascii(v)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("header value must not contain non-ASCII characters"))); + errmsg("header value must not contain non-ASCII characters"))); if (strchr(v, '\n')) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), diff --git a/contrib/pgcrypto/pgp.h b/contrib/pgcrypto/pgp.h index 804a27018a..1b6ea4c9ea 100644 --- a/contrib/pgcrypto/pgp.h +++ b/contrib/pgcrypto/pgp.h @@ -155,8 +155,8 @@ struct PGP_Context */ int mdc_checked; int corrupt_prefix; /* prefix failed RFC 4880 "quick check" */ - int unsupported_compr; /* has bzip2 compression */ - int unexpected_binary; /* binary data seen in text_mode */ + int unsupported_compr; /* has bzip2 compression */ + int unexpected_binary; /* binary data seen in text_mode */ int in_mdc_pkt; int use_mdcbuf_filter; PX_MD *mdc_ctx; diff --git a/contrib/pgcrypto/px-crypt.c b/contrib/pgcrypto/px-crypt.c index 6c72c4ae83..ee40788fe7 100644 --- a/contrib/pgcrypto/px-crypt.c +++ b/contrib/pgcrypto/px-crypt.c @@ -74,7 +74,7 @@ struct px_crypt_algo char *id; unsigned id_len; char *(*crypt) (const char *psw, const char *salt, - char *buf, unsigned len); + char *buf, unsigned len); }; static const struct px_crypt_algo @@ -115,7 +115,7 @@ struct generator { char *name; char *(*gen) (unsigned long count, const char *input, int size, - char *output, int output_size); + char *output, int output_size); int input_len; int def_rounds; int min_rounds; diff --git a/contrib/pgcrypto/px-crypt.h b/contrib/pgcrypto/px-crypt.h index 24daee743c..696902a17c 100644 --- a/contrib/pgcrypto/px-crypt.h +++ b/contrib/pgcrypto/px-crypt.h @@ -57,13 +57,13 @@ int px_gen_salt(const char *salt_type, char *dst, int rounds); /* crypt-gensalt.c */ char *_crypt_gensalt_traditional_rn(unsigned long count, - const char *input, int size, char *output, int output_size); + const char *input, int size, char *output, int output_size); char *_crypt_gensalt_extended_rn(unsigned long count, - const char *input, int size, char *output, int output_size); + const char *input, int size, char *output, int output_size); char *_crypt_gensalt_md5_rn(unsigned long count, - const char *input, int size, char *output, int output_size); + const char *input, int size, char *output, int output_size); char *_crypt_gensalt_blowfish_rn(unsigned long count, - const char *input, int size, char *output, int output_size); + const char *input, int size, char *output, int output_size); /* disable 'extended DES crypt' */ /* #define DISABLE_XDES */ @@ -79,4 +79,4 @@ char *px_crypt_des(const char *key, const char *setting); char *px_crypt_md5(const char *pw, const char *salt, char *dst, unsigned dstlen); -#endif /* _PX_CRYPT_H */ +#endif /* _PX_CRYPT_H */ diff --git a/contrib/pgcrypto/px.h b/contrib/pgcrypto/px.h index e68a95a058..cef9c4b456 100644 --- a/contrib/pgcrypto/px.h +++ b/contrib/pgcrypto/px.h @@ -154,7 +154,7 @@ struct px_hmac struct px_cipher { unsigned (*block_size) (PX_Cipher *c); - unsigned (*key_size) (PX_Cipher *c); /* max key len */ + unsigned (*key_size) (PX_Cipher *c); /* max key len */ unsigned (*iv_size) (PX_Cipher *c); int (*init) (PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv); @@ -169,11 +169,11 @@ struct px_cipher struct px_combo { int (*init) (PX_Combo *cx, const uint8 *key, unsigned klen, - const uint8 *iv, unsigned ivlen); + const uint8 *iv, unsigned ivlen); int (*encrypt) (PX_Combo *cx, const uint8 *data, unsigned dlen, - uint8 *res, unsigned *rlen); + uint8 *res, unsigned *rlen); int (*decrypt) (PX_Combo *cx, const uint8 *data, unsigned dlen, - uint8 *res, unsigned *rlen); + uint8 *res, unsigned *rlen); unsigned (*encrypt_len) (PX_Combo *cx, unsigned dlen); unsigned (*decrypt_len) (PX_Combo *cx, unsigned dlen); void (*free) (PX_Combo *cx); @@ -239,4 +239,4 @@ void px_debug(const char *fmt,...) pg_attribute_printf(1, 2); (c)->decrypt(c, data, dlen, res, rlen) #define px_combo_free(c) (c)->free(c) -#endif /* __PX_H */ +#endif /* __PX_H */ diff --git a/contrib/pgcrypto/rijndael.c b/contrib/pgcrypto/rijndael.c index 4adbcc1f91..4c074efbc0 100644 --- a/contrib/pgcrypto/rijndael.c +++ b/contrib/pgcrypto/rijndael.c @@ -97,7 +97,7 @@ static u4byte il_tab[4][256]; #endif static u4byte tab_gen = 0; -#endif /* !PRE_CALC_TABLES */ +#endif /* !PRE_CALC_TABLES */ #define ff_mult(a,b) ((a) && (b) ? pow_tab[(log_tab[a] + log_tab[b]) % 255] : 0) @@ -250,7 +250,7 @@ gen_tabs(void) } tab_gen = 1; -#endif /* !PRE_CALC_TABLES */ +#endif /* !PRE_CALC_TABLES */ } diff --git a/contrib/pgcrypto/rijndael.h b/contrib/pgcrypto/rijndael.h index e536c61a6f..bc9ddfaad3 100644 --- a/contrib/pgcrypto/rijndael.h +++ b/contrib/pgcrypto/rijndael.h @@ -44,8 +44,7 @@ typedef struct _rijndael_ctx /* These are all based on 32 bit unsigned values and will therefore */ /* require endian conversions for big-endian architectures */ -rijndael_ctx * - rijndael_set_key(rijndael_ctx *, const u4byte *, const u4byte, int); +rijndael_ctx *rijndael_set_key(rijndael_ctx *, const u4byte *, const u4byte, int); void rijndael_encrypt(rijndael_ctx *, const u4byte *, u4byte *); void rijndael_decrypt(rijndael_ctx *, const u4byte *, u4byte *); @@ -57,4 +56,4 @@ void aes_ecb_decrypt(rijndael_ctx *ctx, uint8 *data, unsigned len); void aes_cbc_encrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len); void aes_cbc_decrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len); -#endif /* _RIJNDAEL_H_ */ +#endif /* _RIJNDAEL_H_ */ diff --git a/contrib/pgcrypto/sha1.c b/contrib/pgcrypto/sha1.c index 0e753ce63a..fb6a57d917 100644 --- a/contrib/pgcrypto/sha1.c +++ b/contrib/pgcrypto/sha1.c @@ -81,7 +81,7 @@ do { \ static void sha1_step(struct sha1_ctxt *); static void -sha1_step(struct sha1_ctxt * ctxt) +sha1_step(struct sha1_ctxt *ctxt) { uint32 a, b, @@ -226,7 +226,7 @@ sha1_step(struct sha1_ctxt * ctxt) /*------------------------------------------------------------*/ void -sha1_init(struct sha1_ctxt * ctxt) +sha1_init(struct sha1_ctxt *ctxt) { memset(ctxt, 0, sizeof(struct sha1_ctxt)); H(0) = 0x67452301; @@ -237,7 +237,7 @@ sha1_init(struct sha1_ctxt * ctxt) } void -sha1_pad(struct sha1_ctxt * ctxt) +sha1_pad(struct sha1_ctxt *ctxt) { size_t padlen; /* pad length in bytes */ size_t padstart; @@ -280,7 +280,7 @@ sha1_pad(struct sha1_ctxt * ctxt) } void -sha1_loop(struct sha1_ctxt * ctxt, const uint8 *input0, size_t len) +sha1_loop(struct sha1_ctxt *ctxt, const uint8 *input0, size_t len) { const uint8 *input; size_t gaplen; @@ -308,7 +308,7 @@ sha1_loop(struct sha1_ctxt * ctxt, const uint8 *input0, size_t len) } void -sha1_result(struct sha1_ctxt * ctxt, uint8 *digest0) +sha1_result(struct sha1_ctxt *ctxt, uint8 *digest0) { uint8 *digest; diff --git a/contrib/pgcrypto/sha1.h b/contrib/pgcrypto/sha1.h index 2f61e454ba..4300694a34 100644 --- a/contrib/pgcrypto/sha1.h +++ b/contrib/pgcrypto/sha1.h @@ -72,4 +72,4 @@ typedef struct sha1_ctxt SHA1_CTX; #define SHA1_RESULTLEN (160/8) -#endif /* _NETINET6_SHA1_H_ */ +#endif /* _NETINET6_SHA1_H_ */ diff --git a/contrib/pgrowlocks/pgrowlocks.c b/contrib/pgrowlocks/pgrowlocks.c index 00e2015c5c..eabca65bd2 100644 --- a/contrib/pgrowlocks/pgrowlocks.c +++ b/contrib/pgrowlocks/pgrowlocks.c @@ -97,7 +97,19 @@ pgrowlocks(PG_FUNCTION_ARGS) relname = PG_GETARG_TEXT_PP(0); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); - rel = heap_openrv(relrv, AccessShareLock); + rel = relation_openrv(relrv, AccessShareLock); + + if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("\"%s\" is a partitioned table", + RelationGetRelationName(rel)), + errdetail("Partitioned tables do not contain rows."))); + else if (rel->rd_rel->relkind != RELKIND_RELATION) + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("\"%s\" is not a table", + RelationGetRelationName(rel)))); /* * check permissions: must have SELECT on table or be in @@ -153,7 +165,7 @@ pgrowlocks(PG_FUNCTION_ARGS) values = (char **) palloc(mydata->ncolumns * sizeof(char *)); values[Atnum_tid] = (char *) DirectFunctionCall1(tidout, - PointerGetDatum(&tuple->t_self)); + PointerGetDatum(&tuple->t_self)); values[Atnum_xmax] = palloc(NCHARS * sizeof(char)); snprintf(values[Atnum_xmax], NCHARS, "%d", xmax); diff --git a/contrib/pgstattuple/pgstatapprox.c b/contrib/pgstattuple/pgstatapprox.c index 9facf65137..5bf06138a5 100644 --- a/contrib/pgstattuple/pgstatapprox.c +++ b/contrib/pgstattuple/pgstatapprox.c @@ -182,10 +182,10 @@ statapprox_heap(Relation rel, output_type *stat) UnlockReleaseBuffer(buf); } - stat->table_len = (uint64) nblocks *BLCKSZ; + stat->table_len = (uint64) nblocks * BLCKSZ; stat->tuple_count = vac_estimate_reltuples(rel, false, nblocks, scanned, - stat->tuple_count + misc_count); + stat->tuple_count + misc_count); /* * Calculate percentages if the relation has one or more pages. diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c index 03b387f6b6..44e322d1f9 100644 --- a/contrib/pgstattuple/pgstatindex.c +++ b/contrib/pgstattuple/pgstatindex.c @@ -333,7 +333,7 @@ pgstatindex_impl(Relation rel, FunctionCallInfo fcinfo) values[j++] = psprintf("%d", indexStat.version); values[j++] = psprintf("%d", indexStat.level); values[j++] = psprintf(INT64_FORMAT, - (1 + /* include the metapage in index_size */ + (1 + /* include the metapage in index_size */ indexStat.leaf_pages + indexStat.internal_pages + indexStat.deleted_pages + @@ -535,7 +535,7 @@ pgstatginindex_internal(Oid relid, FunctionCallInfo fcinfo) if (RELATION_IS_OTHER_TEMP(rel)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot access temporary indexes of other sessions"))); + errmsg("cannot access temporary indexes of other sessions"))); /* * Read metapage @@ -613,7 +613,7 @@ pgstathashindex(PG_FUNCTION_ARGS) if (RELATION_IS_OTHER_TEMP(rel)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot access temporary indexes of other sessions"))); + errmsg("cannot access temporary indexes of other sessions"))); /* Get the information we need from the metapage. */ memset(&stats, 0, sizeof(stats)); @@ -648,9 +648,9 @@ 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; @@ -677,7 +677,7 @@ pgstathashindex(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), errmsg("unexpected page type 0x%04X in HASH index \"%s\" block %u", - opaque->hasho_flag, RelationGetRelationName(rel), + opaque->hasho_flag, RelationGetRelationName(rel), BufferGetBlockNumber(buf)))); } UnlockReleaseBuffer(buf); diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c index eb02ec5b89..7a91cc3468 100644 --- a/contrib/pgstattuple/pgstattuple.c +++ b/contrib/pgstattuple/pgstattuple.c @@ -62,7 +62,7 @@ typedef struct pgstattuple_type } pgstattuple_type; typedef void (*pgstat_page) (pgstattuple_type *, Relation, BlockNumber, - BufferAccessStrategy); + BufferAccessStrategy); static Datum build_pgstattuple_type(pgstattuple_type *stat, FunctionCallInfo fcinfo); @@ -386,7 +386,7 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo) heap_endscan(scan); relation_close(rel, AccessShareLock); - stat.table_len = (uint64) nblocks *BLCKSZ; + stat.table_len = (uint64) nblocks * BLCKSZ; return build_pgstattuple_type(&stat, fcinfo); } @@ -531,7 +531,7 @@ pgstat_index(Relation rel, BlockNumber start, pgstat_page pagefn, /* Quit if we've scanned the whole relation */ if (blkno >= nblocks) { - stat.table_len = (uint64) nblocks *BLCKSZ; + stat.table_len = (uint64) nblocks * BLCKSZ; break; } diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c index 1b691fb05e..8c33dea845 100644 --- a/contrib/postgres_fdw/connection.c +++ b/contrib/postgres_fdw/connection.c @@ -241,10 +241,10 @@ connect_pg_server(ForeignServer *server, UserMapping *user) conn = PQconnectdbParams(keywords, values, false); if (!conn || PQstatus(conn) != CONNECTION_OK) ereport(ERROR, - (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION), - errmsg("could not connect to server \"%s\"", - server->servername), - errdetail_internal("%s", pchomp(PQerrorMessage(conn))))); + (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION), + errmsg("could not connect to server \"%s\"", + server->servername), + errdetail_internal("%s", pchomp(PQerrorMessage(conn))))); /* * Check that non-superuser has used password to establish connection; @@ -253,10 +253,10 @@ connect_pg_server(ForeignServer *server, UserMapping *user) */ if (!superuser() && !PQconnectionUsedPassword(conn)) ereport(ERROR, - (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), - errmsg("password is required"), - errdetail("Non-superuser cannot connect if the server does not request a password."), - errhint("Target server's authentication method must be changed."))); + (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED), + errmsg("password is required"), + errdetail("Non-superuser cannot connect if the server does not request a password."), + errhint("Target server's authentication method must be changed."))); /* Prepare new session for use */ configure_remote_session(conn); @@ -485,7 +485,7 @@ pgfdw_exec_query(PGconn *conn, const char *query) * * This function offers quick responsiveness by checking for any interruptions. * - * This function emulates the PQexec()'s behavior of returning the last result + * This function emulates PQexec()'s behavior of returning the last result * when there are many. * * Caller is responsible for the error handling on the result. @@ -493,40 +493,50 @@ pgfdw_exec_query(PGconn *conn, const char *query) PGresult * pgfdw_get_result(PGconn *conn, const char *query) { - PGresult *last_res = NULL; + PGresult *volatile last_res = NULL; - for (;;) + /* In what follows, do not leak any PGresults on an error. */ + PG_TRY(); { - PGresult *res; - - while (PQisBusy(conn)) + for (;;) { - int wc; + PGresult *res; - /* Sleep until there's something to do */ - wc = WaitLatchOrSocket(MyLatch, - WL_LATCH_SET | WL_SOCKET_READABLE, - PQsocket(conn), - -1L, PG_WAIT_EXTENSION); - ResetLatch(MyLatch); + while (PQisBusy(conn)) + { + int wc; - CHECK_FOR_INTERRUPTS(); + /* Sleep until there's something to do */ + wc = WaitLatchOrSocket(MyLatch, + WL_LATCH_SET | WL_SOCKET_READABLE, + PQsocket(conn), + -1L, PG_WAIT_EXTENSION); + ResetLatch(MyLatch); - /* Data available in socket */ - if (wc & WL_SOCKET_READABLE) - { - if (!PQconsumeInput(conn)) - pgfdw_report_error(ERROR, NULL, conn, false, query); + CHECK_FOR_INTERRUPTS(); + + /* Data available in socket? */ + if (wc & WL_SOCKET_READABLE) + { + if (!PQconsumeInput(conn)) + pgfdw_report_error(ERROR, NULL, conn, false, query); + } } - } - res = PQgetResult(conn); - if (res == NULL) - break; /* query is complete */ + res = PQgetResult(conn); + if (res == NULL) + break; /* query is complete */ + PQclear(last_res); + last_res = res; + } + } + PG_CATCH(); + { PQclear(last_res); - last_res = res; + PG_RE_THROW(); } + PG_END_TRY(); return last_res; } @@ -579,7 +589,7 @@ pgfdw_report_error(int elevel, PGresult *res, PGconn *conn, (errcode(sqlstate), message_primary ? errmsg_internal("%s", message_primary) : errmsg("could not obtain message string for remote error"), - message_detail ? errdetail_internal("%s", message_detail) : 0, + message_detail ? errdetail_internal("%s", message_detail) : 0, message_hint ? errhint("%s", message_hint) : 0, message_context ? errcontext("%s", message_context) : 0, sql ? errcontext("Remote SQL command: %s", sql) : 0)); @@ -1006,6 +1016,7 @@ pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors) pgfdw_report_error(WARNING, result, conn, true, query); return ignore_errors; } + PQclear(result); return true; } @@ -1028,56 +1039,75 @@ pgfdw_exec_cleanup_query(PGconn *conn, const char *query, bool ignore_errors) static bool pgfdw_get_cleanup_result(PGconn *conn, TimestampTz endtime, PGresult **result) { - PGresult *last_res = NULL; + volatile bool timed_out = false; + PGresult *volatile last_res = NULL; - for (;;) + /* In what follows, do not leak any PGresults on an error. */ + PG_TRY(); { - PGresult *res; - - while (PQisBusy(conn)) + for (;;) { - int wc; - TimestampTz now = GetCurrentTimestamp(); - long secs; - int microsecs; - long cur_timeout; - - /* If timeout has expired, give up, else get sleep time. */ - if (now >= endtime) - return true; - TimestampDifference(now, endtime, &secs, µsecs); - - /* To protect against clock skew, limit sleep to one minute. */ - cur_timeout = Min(60000, secs * USECS_PER_SEC + microsecs); - - /* Sleep until there's something to do */ - wc = WaitLatchOrSocket(MyLatch, - WL_LATCH_SET | WL_SOCKET_READABLE | WL_TIMEOUT, - PQsocket(conn), - cur_timeout, PG_WAIT_EXTENSION); - ResetLatch(MyLatch); - - CHECK_FOR_INTERRUPTS(); - - /* Data available in socket */ - if (wc & WL_SOCKET_READABLE) + PGresult *res; + + while (PQisBusy(conn)) { - if (!PQconsumeInput(conn)) + int wc; + TimestampTz now = GetCurrentTimestamp(); + long secs; + int microsecs; + long cur_timeout; + + /* If timeout has expired, give up, else get sleep time. */ + if (now >= endtime) { - *result = NULL; - return false; + timed_out = true; + goto exit; + } + TimestampDifference(now, endtime, &secs, µsecs); + + /* To protect against clock skew, limit sleep to one minute. */ + cur_timeout = Min(60000, secs * USECS_PER_SEC + microsecs); + + /* Sleep until there's something to do */ + wc = WaitLatchOrSocket(MyLatch, + WL_LATCH_SET | WL_SOCKET_READABLE | WL_TIMEOUT, + PQsocket(conn), + cur_timeout, PG_WAIT_EXTENSION); + ResetLatch(MyLatch); + + CHECK_FOR_INTERRUPTS(); + + /* Data available in socket? */ + if (wc & WL_SOCKET_READABLE) + { + if (!PQconsumeInput(conn)) + { + /* connection trouble; treat the same as a timeout */ + timed_out = true; + goto exit; + } } } - } - res = PQgetResult(conn); - if (res == NULL) - break; /* query is complete */ + res = PQgetResult(conn); + if (res == NULL) + break; /* query is complete */ + PQclear(last_res); + last_res = res; + } +exit: ; + } + PG_CATCH(); + { PQclear(last_res); - last_res = res; + PG_RE_THROW(); } + PG_END_TRY(); - *result = last_res; - return false; + if (timed_out) + PQclear(last_res); + else + *result = last_res; + return timed_out; } diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index 482a3dd301..2af8364010 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -168,7 +168,7 @@ static void deparseLockingClause(deparse_expr_cxt *context); static void appendOrderByClause(List *pathkeys, deparse_expr_cxt *context); static void appendConditions(List *exprs, deparse_expr_cxt *context); static void deparseFromExprForRel(StringInfo buf, PlannerInfo *root, - RelOptInfo *joinrel, bool use_alias, List **params_list); + 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, @@ -728,7 +728,7 @@ foreign_expr_walker(Node *node, agg->args); sortcoltype = exprType((Node *) tle->expr); typentry = lookup_type_cache(sortcoltype, - TYPECACHE_LT_OPR | TYPECACHE_GT_OPR); + TYPECACHE_LT_OPR | TYPECACHE_GT_OPR); /* Check shippability of non-default sort operator. */ if (srt->sortop != typentry->lt_opr && srt->sortop != typentry->gt_opr && @@ -883,8 +883,8 @@ build_tlist_to_deparse(RelOptInfo *foreignrel) * required for evaluating the local conditions. */ tlist = add_to_flat_tlist(tlist, - pull_var_clause((Node *) foreignrel->reltarget->exprs, - PVC_RECURSE_PLACEHOLDERS)); + pull_var_clause((Node *) foreignrel->reltarget->exprs, + PVC_RECURSE_PLACEHOLDERS)); foreach(lc, fpinfo->local_conds) { RestrictInfo *rinfo = lfirst_node(RestrictInfo, lc); @@ -1434,7 +1434,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel, * ((outer relation) <join type> (inner relation) ON (joinclauses)) */ appendStringInfo(buf, "(%s %s JOIN %s ON ", join_sql_o.data, - get_jointype_name(fpinfo->jointype), join_sql_i.data); + get_jointype_name(fpinfo->jointype), join_sql_i.data); /* Append join clause; (TRUE) if no join clause */ if (fpinfo->joinclauses) @@ -1596,7 +1596,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root, appendStringInfoString(buf, " ON CONFLICT DO NOTHING"); deparseReturningList(buf, root, rtindex, rel, - rel->trigdesc && rel->trigdesc->trig_insert_after_row, + rel->trigdesc && rel->trigdesc->trig_insert_after_row, returningList, retrieved_attrs); } @@ -1638,7 +1638,7 @@ deparseUpdateSql(StringInfo buf, PlannerInfo *root, appendStringInfoString(buf, " WHERE ctid = $1"); deparseReturningList(buf, root, rtindex, rel, - rel->trigdesc && rel->trigdesc->trig_update_after_row, + rel->trigdesc && rel->trigdesc->trig_update_after_row, returningList, retrieved_attrs); } @@ -1728,7 +1728,7 @@ deparseDeleteSql(StringInfo buf, PlannerInfo *root, appendStringInfoString(buf, " WHERE ctid = $1"); deparseReturningList(buf, root, rtindex, rel, - rel->trigdesc && rel->trigdesc->trig_delete_after_row, + rel->trigdesc && rel->trigdesc->trig_delete_after_row, returningList, retrieved_attrs); } diff --git a/contrib/postgres_fdw/option.c b/contrib/postgres_fdw/option.c index e24db569ea..67e1c59951 100644 --- a/contrib/postgres_fdw/option.c +++ b/contrib/postgres_fdw/option.c @@ -196,7 +196,7 @@ InitPgFdwOptions(void) ereport(ERROR, (errcode(ERRCODE_FDW_OUT_OF_MEMORY), errmsg("out of memory"), - errdetail("could not get libpq's default connection options"))); + errdetail("could not get libpq's default connection options"))); /* Count how many libpq options are available. */ num_libpq_opts = 0; @@ -258,7 +258,7 @@ is_valid_option(const char *keyword, Oid context) { PgFdwOption *opt; - Assert(postgres_fdw_options); /* must be initialized already */ + Assert(postgres_fdw_options); /* must be initialized already */ for (opt = postgres_fdw_options; opt->keyword; opt++) { @@ -277,7 +277,7 @@ is_libpq_option(const char *keyword) { PgFdwOption *opt; - Assert(postgres_fdw_options); /* must be initialized already */ + Assert(postgres_fdw_options); /* must be initialized already */ for (opt = postgres_fdw_options; opt->keyword; opt++) { diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 080cb0a074..7214666e10 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -756,10 +756,10 @@ get_useful_ecs_for_relation(PlannerInfo *root, RelOptInfo *rel) */ if (bms_overlap(relids, restrictinfo->right_ec->ec_relids)) useful_eclass_list = list_append_unique_ptr(useful_eclass_list, - restrictinfo->right_ec); + restrictinfo->right_ec); else if (bms_overlap(relids, restrictinfo->left_ec->ec_relids)) useful_eclass_list = list_append_unique_ptr(useful_eclass_list, - restrictinfo->left_ec); + restrictinfo->left_ec); } return useful_eclass_list; @@ -899,14 +899,14 @@ postgresGetForeignPaths(PlannerInfo *root, * to estimate cost and size of this path. */ path = create_foreignscan_path(root, baserel, - NULL, /* default pathtarget */ + NULL, /* default pathtarget */ fpinfo->rows, fpinfo->startup_cost, fpinfo->total_cost, NIL, /* no pathkeys */ - NULL, /* no outer rel either */ - NULL, /* no extra plan */ - NIL); /* no fdw_private list */ + NULL, /* no outer rel either */ + NULL, /* no extra plan */ + NIL); /* no fdw_private list */ add_path(baserel, (Path *) path); /* Add paths with pathkeys */ @@ -999,9 +999,9 @@ postgresGetForeignPaths(PlannerInfo *root, arg.current = NULL; clauses = generate_implied_equalities_for_column(root, baserel, - ec_member_matches_foreign, + ec_member_matches_foreign, (void *) &arg, - baserel->lateral_referencers); + baserel->lateral_referencers); /* Done if there are no more expressions in the foreign rel */ if (arg.current == NULL) @@ -1075,7 +1075,7 @@ postgresGetForeignPaths(PlannerInfo *root, rows, startup_cost, total_cost, - NIL, /* no pathkeys */ + NIL, /* no pathkeys */ param_info->ppi_req_outer, NULL, NIL); /* no fdw_private list */ @@ -1332,7 +1332,7 @@ postgresBeginForeignScan(ForeignScanState *node, int eflags) fsstate->query = strVal(list_nth(fsplan->fdw_private, FdwScanPrivateSelectSql)); fsstate->retrieved_attrs = (List *) list_nth(fsplan->fdw_private, - FdwScanPrivateRetrievedAttrs); + FdwScanPrivateRetrievedAttrs); fsstate->fetch_size = intVal(list_nth(fsplan->fdw_private, FdwScanPrivateFetchSize)); @@ -1591,7 +1591,7 @@ postgresPlanForeignModify(PlannerInfo *root, /* bit numbers are offset by FirstLowInvalidHeapAttributeNumber */ AttrNumber attno = col + FirstLowInvalidHeapAttributeNumber; - if (attno <= InvalidAttrNumber) /* shouldn't happen */ + if (attno <= InvalidAttrNumber) /* shouldn't happen */ elog(ERROR, "system-column update is not supported"); targetAttrs = lappend_int(targetAttrs, attno); } @@ -1710,7 +1710,7 @@ postgresBeginForeignModify(ModifyTableState *mtstate, fmstate->has_returning = intVal(list_nth(fdw_private, FdwModifyPrivateHasReturning)); fmstate->retrieved_attrs = (List *) list_nth(fdw_private, - FdwModifyPrivateRetrievedAttrs); + FdwModifyPrivateRetrievedAttrs); /* Create context for per-tuple temp workspace. */ fmstate->temp_cxt = AllocSetContextCreate(estate->es_query_cxt, @@ -2173,7 +2173,7 @@ postgresPlanDirectModify(PlannerInfo *root, AttrNumber attno = col + FirstLowInvalidHeapAttributeNumber; TargetEntry *tle; - if (attno <= InvalidAttrNumber) /* shouldn't happen */ + if (attno <= InvalidAttrNumber) /* shouldn't happen */ elog(ERROR, "system-column update is not supported"); tle = get_tle_by_resno(subplan->targetlist, attno); @@ -2311,11 +2311,11 @@ postgresBeginDirectModify(ForeignScanState *node, int eflags) dmstate->query = strVal(list_nth(fsplan->fdw_private, FdwDirectModifyPrivateUpdateSql)); dmstate->has_returning = intVal(list_nth(fsplan->fdw_private, - FdwDirectModifyPrivateHasReturning)); + FdwDirectModifyPrivateHasReturning)); dmstate->retrieved_attrs = (List *) list_nth(fsplan->fdw_private, - FdwDirectModifyPrivateRetrievedAttrs); + FdwDirectModifyPrivateRetrievedAttrs); dmstate->set_processed = intVal(list_nth(fsplan->fdw_private, - FdwDirectModifyPrivateSetProcessed)); + FdwDirectModifyPrivateSetProcessed)); /* Create context for per-tuple temp workspace. */ dmstate->temp_cxt = AllocSetContextCreate(estate->es_query_cxt, @@ -2725,8 +2725,8 @@ estimate_path_cost_size(PlannerInfo *root, /* Get number of grouping columns and possible number of groups */ numGroupCols = list_length(root->parse->groupClause); numGroups = estimate_num_groups(root, - get_sortgrouplist_exprs(root->parse->groupClause, - fpinfo->grouped_tlist), + get_sortgrouplist_exprs(root->parse->groupClause, + fpinfo->grouped_tlist), input_rows, NULL); /* @@ -3763,7 +3763,7 @@ analyze_row_processor(PGresult *res, int row, PgFdwAnalyzeState *astate) astate->rows[pos] = make_tuple_from_result_row(res, row, astate->rel, astate->attinmeta, - astate->retrieved_attrs, + astate->retrieved_attrs, NULL, astate->temp_cxt); @@ -3836,8 +3836,8 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid) if (PQntuples(res) != 1) ereport(ERROR, (errcode(ERRCODE_FDW_SCHEMA_NOT_FOUND), - errmsg("schema \"%s\" is not present on foreign server \"%s\"", - stmt->remote_schema, server->servername))); + errmsg("schema \"%s\" is not present on foreign server \"%s\"", + stmt->remote_schema, server->servername))); PQclear(res); res = NULL; @@ -4205,23 +4205,23 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, { case JOIN_INNER: fpinfo->remote_conds = list_concat(fpinfo->remote_conds, - list_copy(fpinfo_i->remote_conds)); + list_copy(fpinfo_i->remote_conds)); fpinfo->remote_conds = list_concat(fpinfo->remote_conds, - list_copy(fpinfo_o->remote_conds)); + list_copy(fpinfo_o->remote_conds)); break; case JOIN_LEFT: fpinfo->joinclauses = list_concat(fpinfo->joinclauses, - list_copy(fpinfo_i->remote_conds)); + list_copy(fpinfo_i->remote_conds)); fpinfo->remote_conds = list_concat(fpinfo->remote_conds, - list_copy(fpinfo_o->remote_conds)); + list_copy(fpinfo_o->remote_conds)); break; case JOIN_RIGHT: fpinfo->joinclauses = list_concat(fpinfo->joinclauses, - list_copy(fpinfo_o->remote_conds)); + list_copy(fpinfo_o->remote_conds)); fpinfo->remote_conds = list_concat(fpinfo->remote_conds, - list_copy(fpinfo_i->remote_conds)); + list_copy(fpinfo_i->remote_conds)); break; case JOIN_FULL: @@ -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); @@ -4316,7 +4316,7 @@ static void add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel, Path *epq_path) { - List *useful_pathkeys_list = NIL; /* List of all pathkeys */ + List *useful_pathkeys_list = NIL; /* List of all pathkeys */ ListCell *lc; useful_pathkeys_list = get_useful_pathkeys_for_relation(root, rel); @@ -4568,7 +4568,7 @@ postgresGetForeignJoinPaths(PlannerInfo *root, rows, startup_cost, total_cost, - NIL, /* no pathkeys */ + NIL, /* no pathkeys */ NULL, /* no required_outer */ epq_path, NIL); /* no fdw_private */ diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h index 25c950dd76..788b003650 100644 --- a/contrib/postgres_fdw/postgres_fdw.h +++ b/contrib/postgres_fdw/postgres_fdw.h @@ -176,10 +176,10 @@ extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel, List *tlist, List *remote_conds, List *pathkeys, bool is_subquery, List **retrieved_attrs, List **params_list); +extern const char *get_jointype_name(JoinType jointype); /* in shippable.c */ extern bool is_builtin(Oid objectId); extern bool is_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo); -extern const char *get_jointype_name(JoinType jointype); -#endif /* POSTGRES_FDW_H */ +#endif /* POSTGRES_FDW_H */ diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c index 61e72937ee..4fc18130e1 100644 --- a/contrib/seg/seg.c +++ b/contrib/seg/seg.c @@ -558,7 +558,7 @@ Datum seg_same(PG_FUNCTION_ARGS) { int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp == 0); } @@ -848,7 +848,7 @@ Datum seg_lt(PG_FUNCTION_ARGS) { int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp < 0); } @@ -857,7 +857,7 @@ Datum seg_le(PG_FUNCTION_ARGS) { int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp <= 0); } @@ -866,7 +866,7 @@ Datum seg_gt(PG_FUNCTION_ARGS) { int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp > 0); } @@ -875,7 +875,7 @@ Datum seg_ge(PG_FUNCTION_ARGS) { int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp >= 0); } @@ -885,7 +885,7 @@ Datum seg_different(PG_FUNCTION_ARGS) { int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp != 0); } diff --git a/contrib/sepgsql/hooks.c b/contrib/sepgsql/hooks.c index dadf99e74b..dc1d1a1d39 100644 --- a/contrib/sepgsql/hooks.c +++ b/contrib/sepgsql/hooks.c @@ -52,7 +52,7 @@ typedef struct * command. Elsewhere (including the case of default) NULL. */ const char *createdb_dtemplate; -} sepgsql_context_info_t; +} sepgsql_context_info_t; static sepgsql_context_info_t sepgsql_context_info; @@ -108,7 +108,7 @@ sepgsql_object_access(ObjectAccessType access, case DatabaseRelationId: Assert(!is_internal); sepgsql_database_post_create(objectId, - sepgsql_context_info.createdb_dtemplate); + sepgsql_context_info.createdb_dtemplate); break; case NamespaceRelationId: @@ -402,7 +402,7 @@ _PG_init(void) if (IsUnderPostmaster) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("sepgsql must be loaded via shared_preload_libraries"))); + errmsg("sepgsql must be loaded via shared_preload_libraries"))); /* * Check availability of SELinux on the platform. If disabled, we cannot diff --git a/contrib/sepgsql/label.c b/contrib/sepgsql/label.c index 6239800189..cbb9249be7 100644 --- a/contrib/sepgsql/label.c +++ b/contrib/sepgsql/label.c @@ -68,17 +68,17 @@ static fmgr_hook_type next_fmgr_hook = NULL; * labels were set during the (sub-)transactions. */ static char *client_label_peer = NULL; /* set by getpeercon(3) */ -static List *client_label_pending = NIL; /* pending list being set by - * sepgsql_setcon() */ -static char *client_label_committed = NULL; /* set by sepgsql_setcon(), - * and already committed */ +static List *client_label_pending = NIL; /* pending list being set by + * sepgsql_setcon() */ +static char *client_label_committed = NULL; /* set by sepgsql_setcon(), and + * already committed */ static char *client_label_func = NULL; /* set by trusted procedure */ typedef struct { SubTransactionId subid; char *label; -} pending_label; +} pending_label; /* * sepgsql_get_client_label @@ -477,7 +477,7 @@ sepgsql_get_label(Oid classId, Oid objectId, int32 subId) if (security_get_initial_context_raw("unlabeled", &unlabeled) < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("SELinux: failed to get initial security label: %m"))); + errmsg("SELinux: failed to get initial security label: %m"))); PG_TRY(); { label = pstrdup(unlabeled); @@ -510,7 +510,7 @@ sepgsql_object_relabel(const ObjectAddress *object, const char *seclabel) security_check_context_raw((security_context_t) seclabel) < 0) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), - errmsg("SELinux: invalid security label: \"%s\"", seclabel))); + errmsg("SELinux: invalid security label: \"%s\"", seclabel))); /* * Do actual permission checks for each object classes @@ -721,7 +721,7 @@ quote_object_name(const char *src1, const char *src2, * catalog OID. */ static void -exec_object_restorecon(struct selabel_handle * sehnd, Oid catalogId) +exec_object_restorecon(struct selabel_handle *sehnd, Oid catalogId) { Relation rel; SysScanDesc sscan; @@ -925,7 +925,7 @@ sepgsql_restorecon(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("SELinux: must be superuser to restore initial contexts"))); + errmsg("SELinux: must be superuser to restore initial contexts"))); /* * Open selabel_lookup(3) stuff. It provides a set of mapping between an @@ -945,7 +945,7 @@ sepgsql_restorecon(PG_FUNCTION_ARGS) if (!sehnd) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("SELinux: failed to initialize labeling handle: %m"))); + errmsg("SELinux: failed to initialize labeling handle: %m"))); PG_TRY(); { exec_object_restorecon(sehnd, DatabaseRelationId); diff --git a/contrib/sepgsql/proc.c b/contrib/sepgsql/proc.c index 73564edaa7..14faa5fac6 100644 --- a/contrib/sepgsql/proc.c +++ b/contrib/sepgsql/proc.c @@ -106,7 +106,7 @@ sepgsql_proc_post_create(Oid functionId) initStringInfo(&audit_name); nsp_name = get_namespace_name(proForm->pronamespace); appendStringInfo(&audit_name, "%s(", - quote_qualified_identifier(nsp_name, NameStr(proForm->proname))); + quote_qualified_identifier(nsp_name, NameStr(proForm->proname))); for (i = 0; i < proForm->pronargs; i++) { if (i > 0) diff --git a/contrib/sepgsql/selinux.c b/contrib/sepgsql/selinux.c index 7728a18333..bf89e83dd6 100644 --- a/contrib/sepgsql/selinux.c +++ b/contrib/sepgsql/selinux.c @@ -36,7 +36,7 @@ static struct const char *av_name; uint32 av_code; } av[32]; -} selinux_catalog[] = +} selinux_catalog[] = { { @@ -732,7 +732,7 @@ void sepgsql_compute_avd(const char *scontext, const char *tcontext, uint16 tclass, - struct av_decision * avd) + struct av_decision *avd) { const char *tclass_name; security_class_t tclass_ex; diff --git a/contrib/sepgsql/sepgsql.h b/contrib/sepgsql/sepgsql.h index 9d245c2780..d4bf0cd14a 100644 --- a/contrib/sepgsql/sepgsql.h +++ b/contrib/sepgsql/sepgsql.h @@ -235,7 +235,7 @@ extern void sepgsql_audit_log(bool denied, extern void sepgsql_compute_avd(const char *scontext, const char *tcontext, uint16 tclass, - struct av_decision * avd); + struct av_decision *avd); extern char *sepgsql_compute_create(const char *scontext, const char *tcontext, @@ -324,4 +324,4 @@ extern void sepgsql_proc_relabel(Oid functionId, const char *seclabel); extern void sepgsql_proc_setattr(Oid functionId); extern void sepgsql_proc_execute(Oid functionId); -#endif /* SEPGSQL_H */ +#endif /* SEPGSQL_H */ diff --git a/contrib/sepgsql/uavc.c b/contrib/sepgsql/uavc.c index 6fd58c7e42..f0915918db 100644 --- a/contrib/sepgsql/uavc.c +++ b/contrib/sepgsql/uavc.c @@ -45,7 +45,7 @@ typedef struct /* true, if tcontext is valid */ char *ncontext; /* temporary scontext on execution of trusted * procedure, or NULL elsewhere */ -} avc_cache; +} avc_cache; /* * Declaration of static variables @@ -182,7 +182,7 @@ sepgsql_avc_unlabeled(void) if (security_get_initial_context_raw("unlabeled", &unlabeled) < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("SELinux: failed to get initial security label: %m"))); + errmsg("SELinux: failed to get initial security label: %m"))); PG_TRY(); { avc_unlabeled = MemoryContextStrdup(avc_mem_cxt, unlabeled); diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c index 208ff6103d..46205c7613 100644 --- a/contrib/spi/refint.c +++ b/contrib/spi/refint.c @@ -175,7 +175,7 @@ check_primary_key(PG_FUNCTION_ARGS) for (i = 0; i < nkeys; i++) { snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%s = $%d %s", - args[i + nkeys + 1], i + 1, (i < nkeys - 1) ? "and " : ""); + args[i + nkeys + 1], i + 1, (i < nkeys - 1) ? "and " : ""); } /* Prepare plan for query */ @@ -248,7 +248,7 @@ check_foreign_key(PG_FUNCTION_ARGS) Datum *kvals; /* key values */ char *relname; /* referencing relation name */ Relation rel; /* triggered relation */ - HeapTuple trigtuple = NULL; /* tuple to being changed */ + HeapTuple trigtuple = NULL; /* tuple to being changed */ HeapTuple newtuple = NULL; /* tuple to return */ TupleDesc tupdesc; /* tuple description */ EPlan *plan; /* prepared plan(s) */ diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c index 19bf8a892c..f7905e20db 100644 --- a/contrib/spi/timetravel.c +++ b/contrib/spi/timetravel.c @@ -85,7 +85,7 @@ timetravel(PG_FUNCTION_ARGS) Trigger *trigger; /* to get trigger name */ int argc; char **args; /* arguments */ - int attnum[MaxAttrNum]; /* fnumbers of start/stop columns */ + int attnum[MaxAttrNum]; /* fnumbers of start/stop columns */ Datum oldtimeon, oldtimeoff; Datum newtimeon, @@ -461,7 +461,7 @@ set_timetravel(PG_FUNCTION_ARGS) s = rname = DatumGetCString(DirectFunctionCall1(nameout, NameGetDatum(relname))); if (s) { - pp = malloc(offsetof(TTOffList, name) +strlen(rname) + 1); + pp = malloc(offsetof(TTOffList, name) + strlen(rname) + 1); if (pp) { pp->next = NULL; diff --git a/contrib/sslinfo/sslinfo.c b/contrib/sslinfo/sslinfo.c index 42846436eb..5ba3988e27 100644 --- a/contrib/sslinfo/sslinfo.c +++ b/contrib/sslinfo/sslinfo.c @@ -484,8 +484,8 @@ ssl_extension_info(PG_FUNCTION_ARGS) if (nid == NID_undef) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("unknown OpenSSL extension in certificate at position %d", - call_cntr))); + errmsg("unknown OpenSSL extension in certificate at position %d", + call_cntr))); values[0] = CStringGetTextDatum(OBJ_nid2sn(nid)); nulls[0] = false; diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c index 7434ca9373..0bc8177b61 100644 --- a/contrib/tablefunc/tablefunc.c +++ b/contrib/tablefunc/tablefunc.c @@ -684,7 +684,7 @@ crosstab_hash(PG_FUNCTION_ARGS) crosstab_hash, tupdesc, per_query_ctx, - rsinfo->allowedModes & SFRM_Materialize_Random); + rsinfo->allowedModes & SFRM_Materialize_Random); /* * SFRM_Materialize mode expects us to return a NULL Datum. The actual @@ -1046,7 +1046,7 @@ connectby_text(PG_FUNCTION_ARGS) show_branch, show_serial, per_query_ctx, - rsinfo->allowedModes & SFRM_Materialize_Random, + rsinfo->allowedModes & SFRM_Materialize_Random, attinmeta); rsinfo->setDesc = tupdesc; @@ -1126,7 +1126,7 @@ connectby_text_serial(PG_FUNCTION_ARGS) show_branch, show_serial, per_query_ctx, - rsinfo->allowedModes & SFRM_Materialize_Random, + rsinfo->allowedModes & SFRM_Materialize_Random, attinmeta); rsinfo->setDesc = tupdesc; @@ -1187,8 +1187,8 @@ connectby(char *relname, branch_delim, start_with, start_with, /* current_branch */ - 0, /* initial level is 0 */ - &serial, /* initial serial is 1 */ + 0, /* initial level is 0 */ + &serial, /* initial serial is 1 */ max_depth, show_branch, show_serial, @@ -1475,17 +1475,17 @@ validateConnectbyTupleDesc(TupleDesc tupdesc, bool show_branch, bool show_serial if (show_branch && show_serial && tupdesc->attrs[4]->atttypid != INT4OID) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), - errmsg("query-specified return tuple not valid for Connectby: " - "fifth column must be type %s", - format_type_be(INT4OID)))); + errmsg("query-specified return tuple not valid for Connectby: " + "fifth column must be type %s", + format_type_be(INT4OID)))); /* check that the type of the fifth column is INT4 */ if (!show_branch && show_serial && tupdesc->attrs[3]->atttypid != INT4OID) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), - errmsg("query-specified return tuple not valid for Connectby: " - "fourth column must be type %s", - format_type_be(INT4OID)))); + errmsg("query-specified return tuple not valid for Connectby: " + "fourth column must be type %s", + format_type_be(INT4OID)))); /* OK, the tupdesc is valid for our purposes */ } @@ -1525,8 +1525,8 @@ compatConnectbyTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupdesc) errmsg("invalid return type"), errdetail("SQL key field type %s does " \ "not match return key field type %s.", - format_type_with_typemod(ret_atttypid, ret_atttypmod), - format_type_with_typemod(sql_atttypid, sql_atttypmod)))); + format_type_with_typemod(ret_atttypid, ret_atttypmod), + format_type_with_typemod(sql_atttypid, sql_atttypmod)))); ret_atttypid = ret_tupdesc->attrs[1]->atttypid; sql_atttypid = sql_tupdesc->attrs[1]->atttypid; @@ -1539,8 +1539,8 @@ compatConnectbyTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupdesc) errmsg("invalid return type"), errdetail("SQL parent key field type %s does " \ "not match return parent key field type %s.", - format_type_with_typemod(ret_atttypid, ret_atttypmod), - format_type_with_typemod(sql_atttypid, sql_atttypmod)))); + format_type_with_typemod(ret_atttypid, ret_atttypmod), + format_type_with_typemod(sql_atttypid, sql_atttypmod)))); /* OK, the two tupdescs are compatible for our purposes */ } diff --git a/contrib/tablefunc/tablefunc.h b/contrib/tablefunc/tablefunc.h index 87fa1e5dcb..e88a5720fa 100644 --- a/contrib/tablefunc/tablefunc.h +++ b/contrib/tablefunc/tablefunc.h @@ -36,4 +36,4 @@ #include "fmgr.h" -#endif /* TABLEFUNC_H */ +#endif /* TABLEFUNC_H */ diff --git a/contrib/tcn/tcn.c b/contrib/tcn/tcn.c index 124110830f..0b9acbf848 100644 --- a/contrib/tcn/tcn.c +++ b/contrib/tcn/tcn.c @@ -73,7 +73,7 @@ triggered_change_notification(PG_FUNCTION_ARGS) if (!CALLED_AS_TRIGGER(fcinfo)) ereport(ERROR, (errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED), - errmsg("triggered_change_notification: must be called as trigger"))); + errmsg("triggered_change_notification: must be called as trigger"))); /* and that it's called after the change */ if (!TRIGGER_FIRED_AFTER(trigdata->tg_event)) @@ -132,7 +132,7 @@ triggered_change_notification(PG_FUNCTION_ARGS) Form_pg_index index; indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid)); - if (!HeapTupleIsValid(indexTuple)) /* should not happen */ + if (!HeapTupleIsValid(indexTuple)) /* should not happen */ elog(ERROR, "cache lookup failed for index %u", indexoid); index = (Form_pg_index) GETSTRUCT(indexTuple); /* we're only interested if it is the primary key and valid */ @@ -175,5 +175,5 @@ triggered_change_notification(PG_FUNCTION_ARGS) (errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED), errmsg("triggered_change_notification: must be called on a table with a primary key"))); - return PointerGetDatum(NULL); /* after trigger; value doesn't matter */ + return PointerGetDatum(NULL); /* after trigger; value doesn't matter */ } diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c index 21cfd673c6..a1a7c2ae0c 100644 --- a/contrib/test_decoding/test_decoding.c +++ b/contrib/test_decoding/test_decoding.c @@ -126,8 +126,8 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, else if (!parse_bool(strVal(elem->arg), &data->include_xids)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("could not parse value \"%s\" for parameter \"%s\"", - strVal(elem->arg), elem->defname))); + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); } else if (strcmp(elem->defname, "include-timestamp") == 0) { @@ -136,8 +136,8 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, else if (!parse_bool(strVal(elem->arg), &data->include_timestamp)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("could not parse value \"%s\" for parameter \"%s\"", - strVal(elem->arg), elem->defname))); + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); } else if (strcmp(elem->defname, "force-binary") == 0) { @@ -148,8 +148,8 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, else if (!parse_bool(strVal(elem->arg), &force_binary)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("could not parse value \"%s\" for parameter \"%s\"", - strVal(elem->arg), elem->defname))); + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); if (force_binary) opt->output_type = OUTPUT_PLUGIN_BINARY_OUTPUT; @@ -162,8 +162,8 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, else if (!parse_bool(strVal(elem->arg), &data->skip_empty_xacts)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("could not parse value \"%s\" for parameter \"%s\"", - strVal(elem->arg), elem->defname))); + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); } else if (strcmp(elem->defname, "only-local") == 0) { @@ -173,8 +173,8 @@ pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, else if (!parse_bool(strVal(elem->arg), &data->only_local)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("could not parse value \"%s\" for parameter \"%s\"", - strVal(elem->arg), elem->defname))); + errmsg("could not parse value \"%s\" for parameter \"%s\"", + strVal(elem->arg), elem->defname))); } else { @@ -421,8 +421,8 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, appendStringInfoString(ctx->out, quote_qualified_identifier( get_namespace_name( - get_rel_namespace(RelationGetRelid(relation))), - NameStr(class_form->relname))); + get_rel_namespace(RelationGetRelid(relation))), + NameStr(class_form->relname))); appendStringInfoChar(ctx->out, ':'); switch (change->action) diff --git a/contrib/unaccent/unaccent.c b/contrib/unaccent/unaccent.c index 6a34cfd3ed..e08cca1707 100644 --- a/contrib/unaccent/unaccent.c +++ b/contrib/unaccent/unaccent.c @@ -67,7 +67,7 @@ placeChar(TrieChar *node, const unsigned char *str, int lenstr, if (curnode->replaceTo) ereport(WARNING, (errcode(ERRCODE_CONFIG_FILE_ERROR), - errmsg("duplicate source strings, first one will be used"))); + errmsg("duplicate source strings, first one will be used"))); else { curnode->replacelen = replacelen; @@ -389,9 +389,9 @@ unaccent_dict(PG_FUNCTION_ARGS) dict = lookup_ts_dictionary_cache(dictOid); res = (TSLexeme *) DatumGetPointer(FunctionCall4(&(dict->lexize), - PointerGetDatum(dict->dictData), - PointerGetDatum(VARDATA_ANY(str)), - Int32GetDatum(VARSIZE_ANY_EXHDR(str)), + PointerGetDatum(dict->dictData), + PointerGetDatum(VARDATA_ANY(str)), + Int32GetDatum(VARSIZE_ANY_EXHDR(str)), PointerGetDatum(NULL))); PG_FREE_IF_COPY(str, strArg); diff --git a/contrib/uuid-ossp/uuid-ossp.c b/contrib/uuid-ossp/uuid-ossp.c index 1ce08555cf..55bc609415 100644 --- a/contrib/uuid-ossp/uuid-ossp.c +++ b/contrib/uuid-ossp/uuid-ossp.c @@ -110,7 +110,7 @@ do { \ uu.clock_seq_hi_and_reserved |= 0x80; \ } while(0) -#endif /* !HAVE_UUID_OSSP */ +#endif /* !HAVE_UUID_OSSP */ PG_MODULE_MAGIC; @@ -262,11 +262,11 @@ uuid_generate_internal(int v, unsigned char *ns, char *ptr, int len) switch (v) { - case 0: /* constant-value uuids */ + case 0: /* constant-value uuids */ strlcpy(strbuf, ptr, 37); break; - case 1: /* time/node-based uuids */ + case 1: /* time/node-based uuids */ { #ifdef HAVE_UUID_E2FS uuid_t uu; @@ -316,8 +316,8 @@ uuid_generate_internal(int v, unsigned char *ns, char *ptr, int len) break; } - case 3: /* namespace-based MD5 uuids */ - case 5: /* namespace-based SHA1 uuids */ + case 3: /* namespace-based MD5 uuids */ + case 5: /* namespace-based SHA1 uuids */ { dce_uuid_t uu; #ifdef HAVE_UUID_BSD @@ -373,7 +373,7 @@ uuid_generate_internal(int v, unsigned char *ns, char *ptr, int len) break; } - case 4: /* random uuid */ + case 4: /* random uuid */ default: { #ifdef HAVE_UUID_E2FS @@ -398,7 +398,7 @@ uuid_generate_internal(int v, unsigned char *ns, char *ptr, int len) return DirectFunctionCall1(uuid_in, CStringGetDatum(strbuf)); } -#endif /* HAVE_UUID_OSSP */ +#endif /* HAVE_UUID_OSSP */ Datum diff --git a/contrib/vacuumlo/vacuumlo.c b/contrib/vacuumlo/vacuumlo.c index 887483cf0f..a4d4553303 100644 --- a/contrib/vacuumlo/vacuumlo.c +++ b/contrib/vacuumlo/vacuumlo.c @@ -47,7 +47,7 @@ struct _param long transaction_limit; }; -static int vacuumlo(const char *database, const struct _param * param); +static int vacuumlo(const char *database, const struct _param *param); static void usage(const char *progname); @@ -56,7 +56,7 @@ static void usage(const char *progname); * This vacuums LOs of one database. It returns 0 on success, -1 on failure. */ static int -vacuumlo(const char *database, const struct _param * param) +vacuumlo(const char *database, const struct _param *param) { PGconn *conn; PGresult *res, diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c index 034545caa8..95e580df08 100644 --- a/contrib/xml2/xpath.c +++ b/contrib/xml2/xpath.c @@ -95,7 +95,7 @@ PG_FUNCTION_INFO_V1(xml_is_well_formed); Datum xml_is_well_formed(PG_FUNCTION_ARGS) { - text *t = PG_GETARG_TEXT_PP(0); /* document buffer */ + text *t = PG_GETARG_TEXT_PP(0); /* document buffer */ bool result = false; int32 docsize = VARSIZE_ANY_EXHDR(t); xmlDocPtr doctree; @@ -187,7 +187,7 @@ pgxmlNodeSetToText(xmlNodeSetPtr nodeset, if (plainsep != NULL) { xmlBufferWriteCHAR(buf, - xmlXPathCastNodeToString(nodeset->nodeTab[i])); + xmlXPathCastNodeToString(nodeset->nodeTab[i])); /* If this isn't the last entry, write the plain sep. */ if (i < (nodeset->nodeNr) - 1) @@ -249,7 +249,7 @@ Datum xpath_nodeset(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *toptag = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2)); xmlChar *septag = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(3)); xmlChar *xpath; @@ -282,7 +282,7 @@ Datum xpath_list(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *plainsep = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2)); xmlChar *xpath; text *xpres; @@ -311,7 +311,7 @@ Datum xpath_string(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *xpath; int32 pathsize; text *xpres; @@ -352,7 +352,7 @@ Datum xpath_number(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *xpath; float4 fRes; xmlXPathObjectPtr res; @@ -384,7 +384,7 @@ Datum xpath_bool(PG_FUNCTION_ARGS) { text *document = PG_GETARG_TEXT_PP(0); - text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ + text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ xmlChar *xpath; int bRes; xmlXPathObjectPtr res; @@ -579,8 +579,8 @@ xpath_table(PG_FUNCTION_ARGS) if (!(rsinfo->allowedModes & SFRM_Materialize)) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("xpath_table requires Materialize mode, but it is not " - "allowed in this context"))); + errmsg("xpath_table requires Materialize mode, but it is not " + "allowed in this context"))); /* * The tuplestore must exist in a higher context than this function call @@ -720,7 +720,7 @@ xpath_table(PG_FUNCTION_ARGS) /* Parse the document */ if (xmldoc) doctree = xmlParseMemory(xmldoc, strlen(xmldoc)); - else /* treat NULL as not well-formed */ + else /* treat NULL as not well-formed */ doctree = NULL; if (doctree == NULL) diff --git a/contrib/xml2/xslt_proc.c b/contrib/xml2/xslt_proc.c index 391e6b593b..2189bca86f 100644 --- a/contrib/xml2/xslt_proc.c +++ b/contrib/xml2/xslt_proc.c @@ -29,7 +29,7 @@ #include <libxslt/security.h> #include <libxslt/transform.h> #include <libxslt/xsltutils.h> -#endif /* USE_LIBXSLT */ +#endif /* USE_LIBXSLT */ #ifdef USE_LIBXSLT @@ -39,7 +39,7 @@ extern PgXmlErrorContext *pgxml_parser_init(PgXmlStrictness strictness); /* local defs */ static const char **parse_params(text *paramstr); -#endif /* USE_LIBXSLT */ +#endif /* USE_LIBXSLT */ PG_FUNCTION_INFO_V1(xslt_process); @@ -189,7 +189,7 @@ xslt_process(PG_FUNCTION_ARGS) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("xslt_process() is not available without libxslt"))); PG_RETURN_NULL(); -#endif /* USE_LIBXSLT */ +#endif /* USE_LIBXSLT */ } #ifdef USE_LIBXSLT @@ -219,7 +219,7 @@ parse_params(text *paramstr) { max_params *= 2; params = (const char **) repalloc(params, - (max_params + 1) * sizeof(char *)); + (max_params + 1) * sizeof(char *)); } params[nparams++] = pos; pos = strstr(pos, nvsep); @@ -253,4 +253,4 @@ parse_params(text *paramstr) return params; } -#endif /* USE_LIBXSLT */ +#endif /* USE_LIBXSLT */ diff --git a/doc/src/sgml/adminpack.sgml b/doc/src/sgml/adminpack.sgml index 98736cb7c4..fddf90c4a5 100644 --- a/doc/src/sgml/adminpack.sgml +++ b/doc/src/sgml/adminpack.sgml @@ -152,7 +152,7 @@ <entry><type>integer</type></entry> <entry> Alternate name for <function>pg_rotate_logfile()</>, but note that it - returns integer 0 or 1 rather than boolean + returns integer 0 or 1 rather than <type>boolean</type> </entry> </row> </tbody> diff --git a/doc/src/sgml/amcheck.sgml b/doc/src/sgml/amcheck.sgml index 893a5b41d9..dd71dbd679 100644 --- a/doc/src/sgml/amcheck.sgml +++ b/doc/src/sgml/amcheck.sgml @@ -215,7 +215,7 @@ ORDER BY c.relpages DESC LIMIT 10; </listitem> <listitem> <para> - Filesystem or storage subsystem faults where checksums happen to + File system or storage subsystem faults where checksums happen to simply not be enabled. </para> <para> @@ -223,7 +223,7 @@ ORDER BY c.relpages DESC LIMIT 10; shared memory buffer at the time of verification if there is only a shared buffer hit when accessing the block. Consequently, <filename>amcheck</> does not necessarily examine data read from the - filesystem at the time of verification. Note that when checksums are + file system at the time of verification. Note that when checksums are enabled, <filename>amcheck</> may raise an error due to a checksum failure when a corrupt block is read into a buffer. </para> diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml index 5e0a0bf7a7..48ecfc5f48 100644 --- a/doc/src/sgml/charset.sgml +++ b/doc/src/sgml/charset.sgml @@ -508,8 +508,8 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR"; operating system C library. These are the locales that most tools provided by the operating system use. Another provider is <literal>icu</literal>, which uses the external - ICU<indexterm><primary>ICU</></> library. Support for ICU has to be - configured when PostgreSQL is built. + ICU<indexterm><primary>ICU</></> library. ICU locales can only be + used if support for ICU was configured when PostgreSQL was built. </para> <para> @@ -529,12 +529,12 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR"; </para> <para> - A collation provided by <literal>icu</literal> maps to a named collator - provided by the ICU library. ICU does not support - separate <quote>collate</quote> and <quote>ctype</quote> settings, so they - are always the same. Also, ICU collations are independent of the - encoding, so there is always only one ICU collation for a given name in a - database. + A collation object provided by <literal>icu</literal> maps to a named + collator provided by the ICU library. ICU does not support + separate <quote>collate</quote> and <quote>ctype</quote> settings, so + they are always the same. Also, ICU collations are independent of the + encoding, so there is always only one ICU collation of a given name in + a database. </para> <sect3> @@ -566,10 +566,10 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR"; <para> If the operating system provides support for using multiple locales within a single program (<function>newlocale</> and related functions), - or support for ICU is configured, + or if support for ICU is configured, then when a database cluster is initialized, <command>initdb</command> populates the system catalog <literal>pg_collation</literal> with - collations based on all the locales it finds on the operating + collations based on all the locales it finds in the operating system at the time. </para> @@ -602,10 +602,12 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR"; directly to the locales installed in the operating system, which can be listed using the command <literal>locale -a</literal>. In case a <literal>libc</literal> collation is needed that has different values - for <symbol>LC_COLLATE</symbol> and <symbol>LC_CTYPE</symbol>, or new + for <symbol>LC_COLLATE</symbol> and <symbol>LC_CTYPE</symbol>, or if new locales are installed in the operating system after the database system was initialized, then a new collation may be created using the <xref linkend="sql-createcollation"> command. + New operating system locales can also be imported en masse using + the <link linkend="functions-admin-collation"><function>pg_import_system_collations()</function></link> function. </para> <para> @@ -617,8 +619,8 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR"; Use of the stripped collation names is recommended, since it will make one less thing you need to change if you decide to change to another database encoding. Note however that the <literal>default</>, - <literal>C</>, and <literal>POSIX</> collations, as well as all collations - provided by ICU can be used regardless of the database encoding. + <literal>C</>, and <literal>POSIX</> collations can be used regardless of + the database encoding. </para> <para> @@ -641,7 +643,7 @@ SELECT a COLLATE "C" < b COLLATE "POSIX" FROM test1; Collations provided by ICU are created with names in BCP 47 language tag format, with a <quote>private use</quote> extension <literal>-x-icu</literal> appended, to distinguish them from - libc locales. So <literal>de-x-icu</literal> would be an example. + libc locales. So <literal>de-x-icu</literal> would be an example name. </para> <para> @@ -652,7 +654,7 @@ SELECT a COLLATE "C" < b COLLATE "POSIX" FROM test1; See <ulink url="http://userguide.icu-project.org/locale"></ulink> for information on ICU locale naming. <command>initdb</command> uses the ICU APIs to extract a set of locales with distinct collation rules to populate - the initial set of collations. Here are some examples collations that + the initial set of collations. Here are some example collations that might be created: <variablelist> @@ -675,7 +677,7 @@ SELECT a COLLATE "C" < b COLLATE "POSIX" FROM test1; <listitem> <para>German collation for Austria, default variant</para> <para> - (Note that as of this writing, there is no, + (As of this writing, there is no, say, <literal>de-DE-x-icu</literal> or <literal>de-CH-x-icu</literal>, because those are equivalent to <literal>de-x-icu</literal>.) </para> @@ -701,9 +703,11 @@ SELECT a COLLATE "C" < b COLLATE "POSIX" FROM test1; </para> <para> - Some (less frequently used) encodings are not supported by ICU. If the - database cluster was initialized with such an encoding, no ICU collations - will be predefined. + Some (less frequently used) encodings are not supported by ICU. When the + database encoding is one of these, ICU collation entries + in <literal>pg_collation</literal> are ignored. Attempting to use one + will draw an error along the lines of <quote>collation "de-x-icu" for + encoding "WIN874" does not exist</>. </para> </sect4> </sect3> @@ -761,8 +765,11 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; classification) and <envar>LC_COLLATE</> (string sort order) locale settings. For <literal>C</> or <literal>POSIX</> locale, any character set is allowed, but for other - locales there is only one character set that will work correctly. + libc-provided locales there is only one character set that will work + correctly. (On Windows, however, UTF-8 encoding can be used with any locale.) + If you have ICU support configured, ICU-provided locales can be used + with most but not all server-side encodings. </para> <sect2 id="multibyte-charset-supported"> @@ -775,13 +782,14 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <table id="charset-table"> <title><productname>PostgreSQL</productname> Character Sets</title> - <tgroup cols="6"> + <tgroup cols="7"> <thead> <row> <entry>Name</entry> <entry>Description</entry> <entry>Language</entry> <entry>Server?</entry> + <entry>ICU?</entry> <!-- The Bytes/Char field is populated by looking at the values returned by pg_wchar_table.mblen function for each encoding. @@ -796,6 +804,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Big Five</entry> <entry>Traditional Chinese</entry> <entry>No</entry> + <entry>No</entry> <entry>1-2</entry> <entry><literal>WIN950</>, <literal>Windows950</></entry> </row> @@ -804,6 +813,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Extended UNIX Code-CN</entry> <entry>Simplified Chinese</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1-3</entry> <entry></entry> </row> @@ -812,6 +822,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Extended UNIX Code-JP</entry> <entry>Japanese</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1-3</entry> <entry></entry> </row> @@ -820,6 +831,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Extended UNIX Code-JP, JIS X 0213</entry> <entry>Japanese</entry> <entry>Yes</entry> + <entry>No</entry> <entry>1-3</entry> <entry></entry> </row> @@ -828,6 +840,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Extended UNIX Code-KR</entry> <entry>Korean</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1-3</entry> <entry></entry> </row> @@ -836,6 +849,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Extended UNIX Code-TW</entry> <entry>Traditional Chinese, Taiwanese</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1-3</entry> <entry></entry> </row> @@ -844,6 +858,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>National Standard</entry> <entry>Chinese</entry> <entry>No</entry> + <entry>No</entry> <entry>1-4</entry> <entry></entry> </row> @@ -852,6 +867,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Extended National Standard</entry> <entry>Simplified Chinese</entry> <entry>No</entry> + <entry>No</entry> <entry>1-2</entry> <entry><literal>WIN936</>, <literal>Windows936</></entry> </row> @@ -860,6 +876,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-5, <acronym>ECMA</> 113</entry> <entry>Latin/Cyrillic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -868,6 +885,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-6, <acronym>ECMA</> 114</entry> <entry>Latin/Arabic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -876,6 +894,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-7, <acronym>ECMA</> 118</entry> <entry>Latin/Greek</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -884,6 +903,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-8, <acronym>ECMA</> 121</entry> <entry>Latin/Hebrew</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -892,6 +912,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry><acronym>JOHAB</></entry> <entry>Korean (Hangul)</entry> <entry>No</entry> + <entry>No</entry> <entry>1-3</entry> <entry></entry> </row> @@ -900,6 +921,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry><acronym>KOI</acronym>8-R</entry> <entry>Cyrillic (Russian)</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>KOI8</></entry> </row> @@ -908,6 +930,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry><acronym>KOI</acronym>8-U</entry> <entry>Cyrillic (Ukrainian)</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -916,6 +939,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-1, <acronym>ECMA</> 94</entry> <entry>Western European</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO88591</></entry> </row> @@ -924,6 +948,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-2, <acronym>ECMA</> 94</entry> <entry>Central European</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO88592</></entry> </row> @@ -932,6 +957,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-3, <acronym>ECMA</> 94</entry> <entry>South European</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO88593</></entry> </row> @@ -940,6 +966,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-4, <acronym>ECMA</> 94</entry> <entry>North European</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO88594</></entry> </row> @@ -948,6 +975,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-9, <acronym>ECMA</> 128</entry> <entry>Turkish</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO88599</></entry> </row> @@ -956,6 +984,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-10, <acronym>ECMA</> 144</entry> <entry>Nordic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO885910</></entry> </row> @@ -964,6 +993,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-13</entry> <entry>Baltic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO885913</></entry> </row> @@ -972,6 +1002,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-14</entry> <entry>Celtic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO885914</></entry> </row> @@ -980,6 +1011,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-15</entry> <entry>LATIN1 with Euro and accents</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ISO885915</></entry> </row> @@ -988,6 +1020,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>ISO 8859-16, <acronym>ASRO</> SR 14111</entry> <entry>Romanian</entry> <entry>Yes</entry> + <entry>No</entry> <entry>1</entry> <entry><literal>ISO885916</></entry> </row> @@ -996,6 +1029,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Mule internal code</entry> <entry>Multilingual Emacs</entry> <entry>Yes</entry> + <entry>No</entry> <entry>1-4</entry> <entry></entry> </row> @@ -1004,6 +1038,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Shift JIS</entry> <entry>Japanese</entry> <entry>No</entry> + <entry>No</entry> <entry>1-2</entry> <entry><literal>Mskanji</>, <literal>ShiftJIS</>, <literal>WIN932</>, <literal>Windows932</></entry> </row> @@ -1012,6 +1047,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Shift JIS, JIS X 0213</entry> <entry>Japanese</entry> <entry>No</entry> + <entry>No</entry> <entry>1-2</entry> <entry></entry> </row> @@ -1020,6 +1056,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>unspecified (see text)</entry> <entry><emphasis>any</></entry> <entry>Yes</entry> + <entry>No</entry> <entry>1</entry> <entry></entry> </row> @@ -1028,6 +1065,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Unified Hangul Code</entry> <entry>Korean</entry> <entry>No</entry> + <entry>No</entry> <entry>1-2</entry> <entry><literal>WIN949</>, <literal>Windows949</></entry> </row> @@ -1036,6 +1074,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Unicode, 8-bit</entry> <entry><emphasis>all</></entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1-4</entry> <entry><literal>Unicode</></entry> </row> @@ -1044,6 +1083,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP866</entry> <entry>Cyrillic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ALT</></entry> </row> @@ -1052,6 +1092,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP874</entry> <entry>Thai</entry> <entry>Yes</entry> + <entry>No</entry> <entry>1</entry> <entry></entry> </row> @@ -1060,6 +1101,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1250</entry> <entry>Central European</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -1068,6 +1110,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1251</entry> <entry>Cyrillic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>WIN</></entry> </row> @@ -1076,6 +1119,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1252</entry> <entry>Western European</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -1084,6 +1128,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1253</entry> <entry>Greek</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -1092,6 +1137,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1254</entry> <entry>Turkish</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -1100,6 +1146,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1255</entry> <entry>Hebrew</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -1108,6 +1155,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1256</entry> <entry>Arabic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -1116,6 +1164,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1257</entry> <entry>Baltic</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry></entry> </row> @@ -1124,6 +1173,7 @@ CREATE COLLATION "de-DE-x-icu" FROM "de-x-icu"; <entry>Windows CP1258</entry> <entry>Vietnamese</entry> <entry>Yes</entry> + <entry>Yes</entry> <entry>1</entry> <entry><literal>ABC</>, <literal>TCVN</>, <literal>TCVN5712</>, <literal>VSCII</></entry> </row> diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 89eecb4758..28cfc6d258 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1929,10 +1929,10 @@ include_dir 'conf.d' <listitem> <para> Whenever more than <varname>bgwriter_flush_after</varname> bytes have - been written by the bgwriter, attempt to force the OS to issue these + been written by the background writer, attempt to force the OS to issue these writes to the underlying storage. Doing so will limit the amount of dirty data in the kernel's page cache, reducing the likelihood of - stalls when an fsync is issued at the end of a checkpoint, or when + stalls when an <function>fsync</function> is issued at the end of a checkpoint, or when the OS writes data back in larger batches in the background. Often that will result in greatly reduced transaction latency, but there also are some cases, especially with workloads that are bigger than @@ -2050,7 +2050,7 @@ include_dir 'conf.d' pool of processes established by <xref linkend="guc-max-worker-processes">, limited by <xref linkend="guc-max-parallel-workers">. Note that the requested - number of workers may not actually be available at runtime. If this + number of workers may not actually be available at run time. If this occurs, the plan will run with fewer workers than expected, which may be inefficient. The default value is 2. Setting this value to 0 disables parallel query execution. @@ -2111,7 +2111,7 @@ include_dir 'conf.d' been written by a single backend, attempt to force the OS to issue these writes to the underlying storage. Doing so will limit the amount of dirty data in the kernel's page cache, reducing the - likelihood of stalls when an fsync is issued at the end of a + likelihood of stalls when an <function>fsync</function> is issued at the end of a checkpoint, or when the OS writes data back in larger batches in the background. Often that will result in greatly reduced transaction latency, but there also are some cases, especially with workloads @@ -2291,7 +2291,7 @@ include_dir 'conf.d' For reliable recovery when changing <varname>fsync</varname> off to on, it is necessary to force all modified buffers in the kernel to durable storage. This can be done while the cluster - is shutdown or while fsync is on by running <command>initdb + is shutdown or while <varname>fsync</varname> is on by running <command>initdb --sync-only</command>, running <command>sync</>, unmounting the file system, or rebooting the server. </para> @@ -2721,7 +2721,7 @@ include_dir 'conf.d' have been written while performing a checkpoint, attempt to force the OS to issue these writes to the underlying storage. Doing so will limit the amount of dirty data in the kernel's page cache, reducing - the likelihood of stalls when an fsync is issued at the end of the + the likelihood of stalls when an <function>fsync</function> is issued at the end of the checkpoint, or when the OS writes data back in larger batches in the background. Often that will result in greatly reduced transaction latency, but there also are some cases, especially with workloads @@ -3486,7 +3486,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class=" <listitem> <para> Maximum number of synchronization workers per subscription. This - parameter controls the amount of paralelism of the initial data copy + parameter controls the amount of parallelism of the initial data copy during the subscription initialization or when new tables are added. </para> <para> @@ -7038,12 +7038,6 @@ SET XML OPTION { DOCUMENT | CONTENT }; </para> <para> - For each parameter, if more than one library is to be loaded, separate - their names with commas. All library names are converted to lower case - unless double-quoted. - </para> - - <para> Only shared libraries specifically intended to be used with PostgreSQL can be loaded this way. Every PostgreSQL-supported library has a <quote>magic block</> that is checked to guarantee compatibility. For @@ -7071,6 +7065,10 @@ SET XML OPTION { DOCUMENT | CONTENT }; <para> This variable specifies one or more shared libraries that are to be preloaded at connection start. + It contains a comma-separated list of library names, where each name + is interpreted as for the <xref linkend="SQL-LOAD"> command. + Whitespace between entries is ignored; surround a library name with + double quotes if you need to include whitespace or commas in the name. The parameter value only takes effect at the start of the connection. Subsequent changes have no effect. If a specified library is not found, the connection attempt will fail. @@ -7117,10 +7115,15 @@ SET XML OPTION { DOCUMENT | CONTENT }; <listitem> <para> This variable specifies one or more shared libraries that are to be - preloaded at connection start. Only superusers can change this setting. + preloaded at connection start. + It contains a comma-separated list of library names, where each name + is interpreted as for the <xref linkend="SQL-LOAD"> command. + Whitespace between entries is ignored; surround a library name with + double quotes if you need to include whitespace or commas in the name. The parameter value only takes effect at the start of the connection. Subsequent changes have no effect. If a specified library is not found, the connection attempt will fail. + Only superusers can change this setting. </para> <para> @@ -7154,9 +7157,13 @@ SET XML OPTION { DOCUMENT | CONTENT }; <listitem> <para> This variable specifies one or more shared libraries to be preloaded at - server start. This parameter can only be set at server - start. If a specified library is not found, the server will fail to - start. + server start. + It contains a comma-separated list of library names, where each name + is interpreted as for the <xref linkend="SQL-LOAD"> command. + Whitespace between entries is ignored; surround a library name with + double quotes if you need to include whitespace or commas in the name. + This parameter can only be set at server start. If a specified + library is not found, the server will fail to start. </para> <para> @@ -7399,7 +7406,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' limit, while negative values mean <xref linkend="guc-max-pred-locks-per-transaction"> divided by the absolute value of this setting. The default is -2, which keeps - the behaviour from previous versions of <productname>PostgreSQL</>. + the behavior from previous versions of <productname>PostgreSQL</>. This parameter can only be set in the <filename>postgresql.conf</> file or on the server command line. </para> diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index a70047b340..7449e064ac 100755 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -2039,13 +2039,13 @@ UPDATE 1 <para> All of the policies constructed thus far have been permissive policies, meaning that when multiple policies are applied they are combined using - the "OR" boolean operator. While permissive policies can be constructed + the <quote>OR</quote> Boolean operator. While permissive policies can be constructed to only allow access to rows in the intended cases, it can be simpler to combine permissive policies with restrictive policies (which the records - must pass and which are combined using the "AND" boolean operator). + must pass and which are combined using the <quote>AND</quote> Boolean operator). Building on the example above, we add a restrictive policy to require - the administrator to be connected over a local unix socket to access the - records of the passwd table: + the administrator to be connected over a local Unix socket to access the + records of the <literal>passwd</literal> table: </para> <programlisting> @@ -3241,7 +3241,8 @@ VALUES ('Albany', NULL, NULL, 'NY'); <command>CREATE TABLE</> nor is it possible to add columns to partitions after-the-fact using <command>ALTER TABLE</>. Tables may be added as a partition with <command>ALTER TABLE ... ATTACH PARTITION</> - only if their columns exactly match the parent, including oids. + only if their columns exactly match the parent, including any + <literal>oid</literal> column. </para> </listitem> diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index c4f211bc02..b96ef389a2 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1207,7 +1207,7 @@ include $(PGXS) <term><varname>NO_INSTALLCHECK</varname></term> <listitem> <para> - don't define an installcheck target, useful e.g. if tests require special configuration, or don't use pg_regress + don't define an <literal>installcheck</literal> target, useful e.g. if tests require special configuration, or don't use <application>pg_regress</application> </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 58c1858121..3d56b889c7 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1302,7 +1302,7 @@ transformation functions <literal><function>radians()</function></literal> and <literal><function>degrees()</function></literal> shown earlier. However, using the degree-based trigonometric functions is preferred, - as that way avoids roundoff error for special cases such + as that way avoids round-off error for special cases such as <literal>sind(30)</>. </para> </note> @@ -9571,7 +9571,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>tsvector</type></entry> <entry> reduce each string value in the document to a <type>tsvector</>, and then - concatentate those in document order to produce a single <type>tsvector</> + concatenate those in document order to produce a single <type>tsvector</> </entry> <entry><literal>to_tsvector('english', '{"a": "The Fat Rats"}'::json)</literal></entry> <entry><literal>'fat':2 'rat':3</literal></entry> @@ -9744,7 +9744,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <literal><function>unnest(<type>tsvector</>, OUT <replaceable class="PARAMETER">lexeme</> <type>text</>, OUT <replaceable class="PARAMETER">positions</> <type>smallint[]</>, OUT <replaceable class="PARAMETER">weights</> <type>text</>)</function></literal> </entry> <entry><type>setof record</type></entry> - <entry>expand a tsvector to a set of rows</entry> + <entry>expand a <type>tsvector</type> to a set of rows</entry> <entry><literal>unnest('fat:2,4 cat:3 rat:5A'::tsvector)</literal></entry> <entry><literal>(cat,{3},{D}) ...</literal></entry> </row> @@ -17705,7 +17705,7 @@ SELECT collation for ('foo' COLLATE "de_DE"); <row> <entry><literal><function>txid_current_if_assigned()</function></literal></entry> <entry><type>bigint</type></entry> - <entry>same as <function>txid_current()</function> but returns null instead of assigning an xid if none is already assigned</entry> + <entry>same as <function>txid_current()</function> but returns null instead of assigning a new transaction ID if none is already assigned</entry> </row> <row> <entry><literal><function>txid_current_snapshot()</function></literal></entry> @@ -17735,7 +17735,7 @@ SELECT collation for ('foo' COLLATE "de_DE"); <row> <entry><literal><function>txid_status(<parameter>bigint</parameter>)</function></literal></entry> <entry><type>txid_status</type></entry> - <entry>report the status of the given xact - <literal>committed</literal>, <literal>aborted</literal>, <literal>in progress</literal>, or NULL if the txid is too old</entry> + <entry>report the status of the given transaction: <literal>committed</literal>, <literal>aborted</literal>, <literal>in progress</literal>, or null if the transaction ID is too old</entry> </row> </tbody> </tgroup> @@ -18634,7 +18634,7 @@ postgres=# select pg_start_backup('label_goes_here'); the <filename>backup_label</> and <filename>tablespace_map</> are returned in the result of the function, and should be written to files in the backup (and not in the data directory). There is an optional second - parameter of type boolean. If false, the <function>pg_stop_backup</> + parameter of type <type>boolean</type>. If false, the <function>pg_stop_backup</> will return immediately after the backup is completed without waiting for WAL to be archived. This behavior is only useful for backup software which independently monitors WAL archiving. Otherwise, WAL @@ -19784,9 +19784,9 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); <row> <entry> <indexterm><primary>pg_import_system_collations</primary></indexterm> - <literal><function>pg_import_system_collations(<parameter>if_not_exists</> <type>boolean</>, <parameter>schema</> <type>regnamespace</>)</function></literal> + <literal><function>pg_import_system_collations(<parameter>schema</> <type>regnamespace</>)</function></literal> </entry> - <entry><type>void</type></entry> + <entry><type>integer</type></entry> <entry>Import operating system collations</entry> </row> </tbody> @@ -19803,18 +19803,20 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); </para> <para> - <function>pg_import_system_collations</> populates the system - catalog <literal>pg_collation</literal> with collations based on all the - locales it finds on the operating system. This is + <function>pg_import_system_collations</> adds collations to the system + catalog <literal>pg_collation</literal> based on all the + locales it finds in the operating system. This is what <command>initdb</command> uses; see <xref linkend="collation-managing"> for more details. If additional locales are installed into the operating system later on, this function - can be run again to add collations for the new locales. In that case, the - parameter <parameter>if_not_exists</parameter> should be set to true to - skip over existing collations. The <parameter>schema</parameter> - parameter would typically be <literal>pg_catalog</literal>, but that is - not a requirement. (Collation objects based on locales that are no longer - present on the operating system are never removed by this function.) + can be run again to add collations for the new locales. Locales that + match existing entries in <literal>pg_collation</literal> will be skipped. + (But collation objects based on locales that are no longer + present in the operating system are not removed by this function.) + The <parameter>schema</parameter> parameter would typically + be <literal>pg_catalog</literal>, but that is not a requirement; + the collations could be installed into some other schema as well. + The function returns the number of new collation objects it created. </para> </sect2> diff --git a/doc/src/sgml/generic-wal.sgml b/doc/src/sgml/generic-wal.sgml index 147d456d34..dfa78c5ca2 100644 --- a/doc/src/sgml/generic-wal.sgml +++ b/doc/src/sgml/generic-wal.sgml @@ -35,7 +35,7 @@ — register a buffer to be modified within the current generic WAL record. This function returns a pointer to a temporary copy of the buffer's page, where modifications should be made. (Do not modify the - buffer's contents directly.) The third argument is a bitmask of flags + buffer's contents directly.) The third argument is a bit mask of flags applicable to the operation. Currently the only such flag is <literal>GENERIC_XLOG_FULL_IMAGE</>, which indicates that a full-page image rather than a delta update should be included in the WAL record. diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index 01f46d39b6..d0354108d1 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -2208,12 +2208,12 @@ LOG: database system is ready to accept read only connections <function>pg_cancel_backend()</> and <function>pg_terminate_backend()</> will work on user backends, but not the Startup process, which performs - recovery. <structname>pg_stat_activity</structname> does not show an - entry for the Startup process, nor do recovering transactions show - as active. As a result, <structname>pg_prepared_xacts</structname> - is always empty during recovery. If you wish to resolve in-doubt - prepared transactions, view <literal>pg_prepared_xacts</> on the - primary and issue commands to resolve transactions there. + recovery. <structname>pg_stat_activity</structname> does not show + recovering transactions as active. As a result, + <structname>pg_prepared_xacts</structname> is always empty during + recovery. If you wish to resolve in-doubt prepared transactions, view + <literal>pg_prepared_xacts</> on the primary and issue commands to + resolve transactions there or resolve them after the end of recovery. </para> <para> diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index 36c157c43f..fa8ae536d9 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -110,11 +110,29 @@ Publications can choose to limit the changes they produce to any combination of <command>INSERT</command>, <command>UPDATE</command>, and <command>DELETE</command>, similar to how triggers are fired by - particular event types. If a table without a <literal>REPLICA - IDENTITY</literal> is added to a publication that - replicates <command>UPDATE</command> or <command>DELETE</command> - operations then subsequent <command>UPDATE</command> - or <command>DELETE</command> operations will fail on the publisher. + particular event types. By default, all operation types are replicated. + </para> + + <para> + A published table must have a <quote>replica identity</quote> configured in + order to be able to replicate <command>UPDATE</command> + and <command>DELETE</command> operations, so that appropriate rows to + update or delete can be identified on the subscriber side. By default, + this is the primary key, if there is one. Another unique index (with + certain additional requirements) can also be set to be the replica + identity. If the table does not have any suitable key, then it can be set + to replica identity <quote>full</quote>, which means the entire row becomes + the key. This, however, is very inefficient and should only be used as a + fallback if no other solution is possible. If a replica identity other + than <quote>full</quote> is set on the publisher side, a replica identity + comprising the same or fewer columns must also be set on the subscriber + side. See <xref linkend="SQL-CREATETABLE-REPLICA-IDENTITY"> for details on + how to set the replica identity. If a table without a replica identity is + added to a publication that replicates <command>UPDATE</command> + or <command>DELETE</command> operations then + subsequent <command>UPDATE</command> or <command>DELETE</command> + operations will cause an error on the publisher. <command>INSERT</command> + operations can proceed regardless of any replica identity. </para> <para> @@ -299,6 +317,76 @@ </para> </sect1> + <sect1 id="logical-replication-restrictions"> + <title>Restrictions</title> + + <para> + Logical replication currently has the following restrictions or missing + functionality. These might be addressed in future releases. + </para> + + <itemizedlist> + <listitem> + <para> + The database schema and DDL commands are not replicated. The initial + schema can be copied by hand using <literal>pg_dump + --schema-only</literal>. Subsequent schema changes would need to be kept + in sync manually. (Note, however, that there is no need for the schemas + to be absolutely the same on both sides.) Logical replication is robust + when schema definitions change in a live database: When the schema is + changed on the publisher and replicated data starts arriving at the + subscriber but does not fit into the table schema, replication will error + until the schema is updated. In many cases, intermittent errors can be + avoided by applying additive schema changes to the subscriber first. + </para> + </listitem> + + <listitem> + <para> + Sequence data is not replicated. The data in serial or identity columns + backed by sequences will of course be replicated as part of the table, + but the sequence itself would still show the start value on the + subscriber. If the subscriber is used as a read-only database, then this + should typically not be a problem. If, however, some kind of switchover + or failover to the subscriber database is intended, then the sequences + would need to be updated to the latest values, either by copying the + current data from the publisher (perhaps + using <command>pg_dump</command>) or by determining a sufficiently high + value from the tables themselves. + </para> + </listitem> + + <listitem> + <para> + <command>TRUNCATE</command> commands are not replicated. This can, of + course, be worked around by using <command>DELETE</command> instead. To + avoid accidental <command>TRUNCATE</command> invocations, you can revoke + the <literal>TRUNCATE</literal> privilege from tables. + </para> + </listitem> + + <listitem> + <para> + Large objects (see <xref linkend="largeobjects">) are not replicated. + There is no workaround for that, other than storing data in normal + tables. + </para> + </listitem> + + <listitem> + <para> + Replication is only possible from base tables to base tables. That is, + the tables on the publication and on the subscription side must be normal + tables, not views, materialized views, partition root tables, or foreign + tables. In the case of partitions, you can therefore replicate a + partition hierarchy one-to-one, but you cannot currently replicate to a + differently partitioned setup. Attempts to replicate tables other than + base tables will result in an error. + </para> + </listitem> + </itemizedlist> + </sect1> + <sect1 id="logical-replication-architecture"> <title>Architecture</title> @@ -382,7 +470,7 @@ <para> The role used for the replication connection must have - the <literal>REPLICATION</literal> attribute. Access for the role must be + the <literal>REPLICATION</literal> attribute (or be a superuser). Access for the role must be configured in <filename>pg_hba.conf</filename>. </para> diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index cfaa0da4b8..9f09355f5f 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -630,7 +630,7 @@ SELECT datname, age(datfrozenxid) FROM pg_database; scans every page in the table that is not already all-frozen, it should set <literal>age(relfrozenxid)</> to a value just a little more than the <varname>vacuum_freeze_min_age</> setting - that was used (more by the number of transcations started since the + that was used (more by the number of transactions started since the <command>VACUUM</> started). If no <structfield>relfrozenxid</>-advancing <command>VACUUM</> is issued on the table until <varname>autovacuum_freeze_max_age</> is reached, an autovacuum will soon diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 9ff5eea038..be3dc672bc 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -1143,7 +1143,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser </row> <row> <entry><literal>userlock</></entry> - <entry>Waiting to acquire a userlock.</entry> + <entry>Waiting to acquire a user lock.</entry> </row> <row> <entry><literal>advisory</></entry> @@ -1244,7 +1244,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser </row> <row> <entry><literal>BtreePage</></entry> - <entry>Waiting for the page number needed to continue a parallel btree scan to become available.</entry> + <entry>Waiting for the page number needed to continue a parallel B-tree scan to become available.</entry> </row> <row> <entry><literal>ExecuteGather</></entry> diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index 789be3d6a8..454c3f1fd2 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -1227,7 +1227,7 @@ SELECT * FROM zipcodes WHERE city = 'San Francisco' AND zip = '90210'; <para> In many practical situations, this assumption is usually satisfied; for example, there might be a GUI in the application that only allows - selecting compatible city and zipcode values to use in a query. + selecting compatible city and ZIP code values to use in a query. But if that's not the case, functional dependencies may not be a viable option. </para> diff --git a/doc/src/sgml/planstats.sgml b/doc/src/sgml/planstats.sgml index 8caf297f85..838fcda6d2 100644 --- a/doc/src/sgml/planstats.sgml +++ b/doc/src/sgml/planstats.sgml @@ -501,8 +501,8 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1; of this clause to be 1%. By comparing this estimate and the actual number of rows, we see that the estimate is very accurate (in fact exact, as the table is very small). Changing the - <literal>WHERE</> to use the <structfield>b</> column, an identical - plan is generated. But observe what happens if we apply the same + <literal>WHERE</> condition to use the <structfield>b</> column, an + identical plan is generated. But observe what happens if we apply the same condition on both columns, combining them with <literal>AND</>: <programlisting> diff --git a/doc/src/sgml/plperl.sgml b/doc/src/sgml/plperl.sgml index 09b4d54b72..25e41fd5a8 100644 --- a/doc/src/sgml/plperl.sgml +++ b/doc/src/sgml/plperl.sgml @@ -1341,7 +1341,7 @@ DO 'elog(WARNING, join ", ", sort keys %INC)' LANGUAGE plperl; </programlisting> </para> <para> - Initialization will happen in the postmaster if the plperl library is + Initialization will happen in the postmaster if the <literal>plperl</literal> library is included in <xref linkend="guc-shared-preload-libraries">, in which case extra consideration should be given to the risk of destabilizing the postmaster. The principal reason for making use of this feature diff --git a/doc/src/sgml/pltcl.sgml b/doc/src/sgml/pltcl.sgml index 321a46917e..ebe4b78476 100644 --- a/doc/src/sgml/pltcl.sgml +++ b/doc/src/sgml/pltcl.sgml @@ -887,7 +887,7 @@ CREATE EVENT TRIGGER tcl_a_snitch ON ddl_command_start EXECUTE PROCEDURE tclsnit first word identifies the subsystem or library reporting the error; beyond that the contents are left to the individual subsystem or library. For database errors reported by PL/Tcl commands, the first - word is <literal>POSTGRES</literal>, the second word is the Postgres + word is <literal>POSTGRES</literal>, the second word is the PostgreSQL version number, and additional words are field name/value pairs providing detailed information about the error. Fields <varname>SQLSTATE</>, <varname>condition</>, diff --git a/doc/src/sgml/ref/alter_collation.sgml b/doc/src/sgml/ref/alter_collation.sgml index 71cf4de802..30e8c756a1 100644 --- a/doc/src/sgml/ref/alter_collation.sgml +++ b/doc/src/sgml/ref/alter_collation.sgml @@ -92,7 +92,7 @@ ALTER COLLATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_sche <term><literal>REFRESH VERSION</literal></term> <listitem> <para> - Updated the collation version. + Update the collation's version. See <xref linkend="sql-altercollation-notes" endterm="sql-altercollation-notes-title"> below. </para> @@ -107,16 +107,16 @@ ALTER COLLATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_sche <para> When using collations provided by the ICU library, the ICU-specific version of the collator is recorded in the system catalog when the collation object - is created. When the collation is then used, the current version is + is created. When the collation is used, the current version is checked against the recorded version, and a warning is issued when there is a mismatch, for example: <screen> -WARNING: ICU collator version mismatch -DETAIL: The database was created using version 1.2.3.4, the library provides version 2.3.4.5. -HINT: Rebuild all objects affected by this collation and run ALTER COLLATION pg_catalog."xx-x-icu" REFRESH VERSION, or build PostgreSQL with the right version of ICU. +WARNING: collation "xx-x-icu" has version mismatch +DETAIL: The collation in the database was created using version 1.2.3.4, but the operating system provides version 2.3.4.5. +HINT: Rebuild all objects affected by this collation and run ALTER COLLATION pg_catalog."xx-x-icu" REFRESH VERSION, or build PostgreSQL with the right library version. </screen> A change in collation definitions can lead to corrupt indexes and other - problems where the database system relies on stored objects having a + problems because the database system relies on stored objects having a certain sort order. Generally, this should be avoided, but it can happen in legitimate circumstances, such as when using <command>pg_upgrade</command> to upgrade to server binaries linked diff --git a/doc/src/sgml/ref/create_collation.sgml b/doc/src/sgml/ref/create_collation.sgml index 47de9a09b6..2d3e050545 100644 --- a/doc/src/sgml/ref/create_collation.sgml +++ b/doc/src/sgml/ref/create_collation.sgml @@ -122,7 +122,9 @@ CREATE COLLATION [ IF NOT EXISTS ] <replaceable>name</replaceable> FROM <replace <para> Specifies the provider to use for locale services associated with this collation. Possible values - are: <literal>icu</literal>,<indexterm><primary>ICU</></> <literal>libc</literal>. + are: <literal>icu</literal>,<indexterm><primary>ICU</></> + <literal>libc</literal>. + <literal>libc</literal> is the default. The available choices depend on the operating system and build options. </para> </listitem> diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml index 4868317a12..c82cec3072 100644 --- a/doc/src/sgml/ref/create_function.sgml +++ b/doc/src/sgml/ref/create_function.sgml @@ -569,8 +569,9 @@ CREATE [ OR REPLACE ] FUNCTION dynamically loadable C language functions when the function name in the C language source code is not the same as the name of the SQL function. The string <replaceable - class="parameter">obj_file</replaceable> is the name of the - file containing the dynamically loadable object, and + class="parameter">obj_file</replaceable> is the name of the shared + library file containing the compiled C function, and is interpreted + as for the <xref linkend="SQL-LOAD"> command. The string <replaceable class="parameter">link_symbol</replaceable> is the function's link symbol, that is, the name of the function in the C language source code. If the link symbol is omitted, it is assumed diff --git a/doc/src/sgml/ref/create_policy.sgml b/doc/src/sgml/ref/create_policy.sgml index 3b24e5e95e..c0dfe1ea4b 100644 --- a/doc/src/sgml/ref/create_policy.sgml +++ b/doc/src/sgml/ref/create_policy.sgml @@ -126,7 +126,7 @@ CREATE POLICY <replaceable class="parameter">name</replaceable> ON <replaceable <para> Specify that the policy is to be created as a permissive policy. All permissive policies which are applicable to a given query will - be combined together using the boolean "OR" operator. By creating + be combined together using the Boolean <quote>OR</quote> operator. By creating permissive policies, administrators can add to the set of records which can be accessed. Policies are permissive by default. </para> @@ -139,7 +139,7 @@ CREATE POLICY <replaceable class="parameter">name</replaceable> ON <replaceable <para> Specify that the policy is to be created as a restrictive policy. All restrictive policies which are applicable to a given query will - be combined together using the boolean "AND" operator. By creating + be combined together using the Boolean <quote>AND</quote> operator. By creating restrictive policies, administrators can reduce the set of records which can be accessed as all restrictive policies must be passed for each record. diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml index c5299dd74e..62a5fd432e 100644 --- a/doc/src/sgml/ref/create_publication.sgml +++ b/doc/src/sgml/ref/create_publication.sgml @@ -163,6 +163,11 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable> </para> <para> + <command>COPY ... FROM</command> commands are published + as <command>INSERT</command> operations. + </para> + + <para> <command>TRUNCATE</command> and <acronym>DDL</acronym> operations are not published. </para> diff --git a/doc/src/sgml/ref/create_statistics.sgml b/doc/src/sgml/ref/create_statistics.sgml index f319a6ea9c..deda21fec7 100644 --- a/doc/src/sgml/ref/create_statistics.sgml +++ b/doc/src/sgml/ref/create_statistics.sgml @@ -152,14 +152,14 @@ CREATE STATISTICS s1 (dependencies) ON a, b FROM t1; ANALYZE t1; --- now the rowcount estimate is more accurate: +-- now the row count estimate is more accurate: EXPLAIN ANALYZE SELECT * FROM t1 WHERE (a = 1) AND (b = 0); </programlisting> Without functional-dependency statistics, the planner would assume that the two <literal>WHERE</> conditions are independent, and would multiply their selectivities together to arrive at a much-too-small - rowcount estimate. + row count estimate. With such statistics, the planner recognizes that the <literal>WHERE</> conditions are redundant and does not underestimate the rowcount. </para> diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 77bf87681b..9f45b6f574 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -32,7 +32,7 @@ CREATE SUBSCRIPTION <replaceable class="PARAMETER">subscription_name</replaceabl <title>Description</title> <para> - <command>CREATE SUBSCRIPTION</command> adds a new subscription for a + <command>CREATE SUBSCRIPTION</command> adds a new subscription for the current database. The subscription name must be distinct from the name of any existing subscription in the database. </para> @@ -222,7 +222,7 @@ CREATE SUBSCRIPTION <replaceable class="PARAMETER">subscription_name</replaceabl <title>Notes</title> <para> - See <xref linkend="streaming-replication-authentication"> for details on + See <xref linkend="logical-replication-security"> for details on how to configure access control between the subscription and the publication instance. </para> diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 5a3821b25e..c799984f3b 100755 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -459,8 +459,8 @@ FROM ( { <replaceable class="PARAMETER">numeric_literal</replaceable> | <replace include multiple columns or expressions (up to 32, but this limit can altered when building <productname>PostgreSQL</productname>.), but for list partitioning, the partition key must consist of a single column or - expression. If no btree operator class is specified when creating a - partitioned table, the default btree operator class for the datatype will + expression. If no B-tree operator class is specified when creating a + partitioned table, the default B-tree operator class for the datatype will be used. If there is none, an error will be reported. </para> diff --git a/doc/src/sgml/ref/drop_publication.sgml b/doc/src/sgml/ref/drop_publication.sgml index 517d142251..8e45a43982 100644 --- a/doc/src/sgml/ref/drop_publication.sgml +++ b/doc/src/sgml/ref/drop_publication.sgml @@ -46,8 +46,8 @@ DROP PUBLICATION [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> <term><literal>IF EXISTS</literal></term> <listitem> <para> - Do not throw an error if the extension does not exist. A notice is issued - in this case. + Do not throw an error if the publication does not exist. A notice is + issued in this case. </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml index 5bd3438197..50292d8e26 100644 --- a/doc/src/sgml/ref/explain.sgml +++ b/doc/src/sgml/ref/explain.sgml @@ -229,7 +229,7 @@ ROLLBACK; <term><literal>SUMMARY</literal></term> <listitem> <para> - Include summary information (eg: totalled timing information) after the + Include summary information (e.g., totaled timing information) after the query plan. Summary information is included by default when <literal>ANALYZE</literal> is used but otherwise is not included by default, but can be enabled using this option. Planning time in diff --git a/doc/src/sgml/ref/load.sgml b/doc/src/sgml/ref/load.sgml index 74aff0c833..9db1743e2d 100644 --- a/doc/src/sgml/ref/load.sgml +++ b/doc/src/sgml/ref/load.sgml @@ -38,11 +38,12 @@ LOAD '<replaceable class="PARAMETER">filename</replaceable>' </para> <para> - The file name is specified in the same way as for shared library - names in <xref linkend="sql-createfunction">; in particular, one - can rely on a search path and automatic addition of the system's standard - shared library file name extension. See <xref linkend="xfunc-c"> for - more information on this topic. + The library file name is typically given as just a bare file name, + which is sought in the server's library search path (set + by <xref linkend="guc-dynamic-library-path">). Alternatively it can be + given as a full path name. In either case the platform's standard shared + library file name extension may be omitted. + See <xref linkend="xfunc-c-dynload"> for more information on this topic. </para> <indexterm> diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml index 2ab570ad4c..aa944a2e92 100644 --- a/doc/src/sgml/ref/pg_dumpall.sgml +++ b/doc/src/sgml/ref/pg_dumpall.sgml @@ -345,11 +345,14 @@ PostgreSQL documentation <term><option>--no-role-passwords</option></term> <listitem> <para> - Do not dump passwords for roles. When restored, roles will have a NULL - password and authentication will always fail until the password is reset. - Since password values aren't needed when this option is specified we - use the catalog view pg_roles in preference to pg_authid, since access - to pg_authid may be restricted by security policy. + Do not dump passwords for roles. When restored, roles will have a + null password, and password authentication will always fail until the + password is set. Since password values aren't needed when this option + is specified, the role information is read from the catalog + view <structname>pg_roles</structname> instead + of <structname>pg_authid</structname>. Therefore, this option also + helps if access to <structname>pg_authid</structname> is restricted by + some security policy. </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/ref/pgupgrade.sgml b/doc/src/sgml/ref/pgupgrade.sgml index 26b6ba14ba..bbd103f97e 100644 --- a/doc/src/sgml/ref/pgupgrade.sgml +++ b/doc/src/sgml/ref/pgupgrade.sgml @@ -129,7 +129,7 @@ <term><option>-k</option></term> <term><option>--link</option></term> <listitem><para>use hard links instead of copying files to the new - cluster (use junction points on Windows)</para></listitem> + cluster</para></listitem> </varlistentry> <varlistentry> @@ -323,15 +323,22 @@ NET STOP postgresql-&majorversion; </step> <step> - <title>Verify standby servers</title> + <title>Prepare for standby server upgrades</title> <para> - If you are upgrading Streaming Replication and Log-Shipping standby - servers, verify that the old standby servers are caught up by running - <application>pg_controldata</> against the old primary and standby - clusters. Verify that the <quote>Latest checkpoint location</> - values match in all clusters. (There will be a mismatch if old - standby servers were shut down before the old primary.) + If you are upgrading standby servers (as outlined in section <xref + linkend="pgupgrade-step-replicas">), verify that the old standby + servers are caught up by running <application>pg_controldata</> + against the old primary and standby clusters. Verify that the + <quote>Latest checkpoint location</> values match in all clusters. + (There will be a mismatch if old standby servers were shut down + before the old primary.) + </para> + + <para> + Also, if upgrading standby servers, change <varname>wal_level</> + to <literal>replica</> in the <filename>postgresql.conf</> file on + the new master cluster. </para> </step> @@ -416,7 +423,7 @@ pg_upgrade.exe </para> </step> - <step> + <step id="pgupgrade-step-replicas"> <title>Upgrade Streaming Replication and Log-Shipping standby servers</title> <para> @@ -478,16 +485,6 @@ pg_upgrade.exe </step> <step> - <title>Start and stop the new master cluster</title> - - <para> - In the new master cluster, change <varname>wal_level</> to - <literal>replica</> in the <filename>postgresql.conf</> file - and then start and stop the cluster. - </para> - </step> - - <step> <title>Run <application>rsync</></title> <para> diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index e6eba21eda..9faa365481 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1096,7 +1096,8 @@ testdb=> <listitem> <para> - For each relation (table, view, index, sequence, or foreign table) + For each relation (table, view, materialized view, index, sequence, + or foreign table) or composite type matching the <replaceable class="parameter">pattern</replaceable>, show all columns, their types, the tablespace (if not the default) and any @@ -1111,8 +1112,8 @@ testdb=> <para> For some types of relation, <literal>\d</> shows additional information - for each column: column values for sequences, indexed expression for - indexes and foreign data wrapper options for foreign tables. + for each column: column values for sequences, indexed expressions for + indexes, and foreign data wrapper options for foreign tables. </para> <para> @@ -1134,8 +1135,9 @@ testdb=> <para> If <command>\d</command> is used without a <replaceable class="parameter">pattern</replaceable> argument, it is - equivalent to <command>\dtvsE</command> which will show a list of - all visible tables, views, sequences and foreign tables. + equivalent to <command>\dtvmsE</command> which will show a list of + all visible tables, views, materialized views, sequences and + foreign tables. This is purely a convenience measure. </para> </note> diff --git a/doc/src/sgml/release-10.sgml b/doc/src/sgml/release-10.sgml index 1918149333..8b1b66d874 100644 --- a/doc/src/sgml/release-10.sgml +++ b/doc/src/sgml/release-10.sgml @@ -52,7 +52,7 @@ --> <para> <application>pg_upgrade</>-ed hash indexes from previous major - Postgres versions must be rebuilt. + PostgreSQL versions must be rebuilt. </para> <para> @@ -277,7 +277,7 @@ Changing this from the default value caused queries referencing parent tables to not include children tables. The <acronym>SQL</> standard requires such behavior and this has been the default since - Postgres 7.1. + PostgreSQL 7.1. </para> </listitem> @@ -308,7 +308,7 @@ <para> Users needing dump support for pre-8.0 servers need to use dump - binaries from Postgres 9.6. + binaries from PostgreSQL 9.6. </para> </listitem> @@ -323,7 +323,7 @@ <para> This removes configure's <option>--disable-integer-datetimes</> option. Floating-point datetimes/timestamps have not been the - default since Postgres 8.3 and have few advantages. + default since PostgreSQL 8.3 and have few advantages. </para> </listitem> @@ -336,7 +336,7 @@ </para> <para> - This protocol hasn't had client support since Postgres 6.3. + This protocol hasn't had client support since PostgreSQL 6.3. </para> </listitem> @@ -350,7 +350,7 @@ <para> This removes compatibility with the contrib version of full text - search that shipped in pre-8.3 Postgres versions. + search that shipped in pre-8.3 PostgreSQL versions. </para> </listitem> @@ -412,12 +412,12 @@ 2017-02-19 [0414b26ba] Add optimizer and executor support for parallel index-on --> <para> - Support parallel btree index scans (Rahila Syed, Amit Kapila, + Support parallel B-tree index scans (Rahila Syed, Amit Kapila, Robert Haas, Rafia Sabih) </para> <para> - Allows btree index pages to be checked by separate parallel + Allows B-tree index pages to be checked by separate parallel workers. </para> </listitem> @@ -735,7 +735,7 @@ 2017-01-15 [0777f7a2e] Fix matching of boolean index columns to sort ordering. --> <para> - Improve planner matching of boolean indexes (Tom Lane) + Improve planner matching of <type>boolean</type> indexes (Tom Lane) </para> </listitem> @@ -824,7 +824,7 @@ 2017-03-29 [f90d23d0c] Implement SortSupport for macaddr data type --> <para> - Improve sort performance of the macaddr data type (Brandur Leach) + Improve sort performance of the <type>macaddr</type> data type (Brandur Leach) </para> </listitem> @@ -960,7 +960,7 @@ <para> Add function <link linkend="functions-info-session-table"><function>pg_current_logfile()</></> - to read syslog's current stderr and csvlog output file names + to read logging collector's current stderr and csvlog output file names (Gilles Darold) </para> </listitem> @@ -1217,7 +1217,7 @@ 2017-04-05 [68ea2b7f9] Reduce lock level for CREATE STATISTICS --> <para> - Reduce locking required to change table params (Simon Riggs, + Reduce locking required to change table parameters (Simon Riggs, Fabrízio Mello) </para> @@ -1337,7 +1337,7 @@ <para> This allows more fine-grained replication options, including - replication between different major versions of Postgres and + replication between different major versions of PostgreSQL and selective-table replication. </para> </listitem> @@ -1732,7 +1732,7 @@ <para> This is accessed via <function>ts_headline()</> and - <function>to_tsvector</>. + <function>to_tsvector()</>. </para> </listitem> @@ -1876,7 +1876,7 @@ --> <para> Improve <link - linkend="functions-json-processing-table"><function>json_populate_record</></> + linkend="functions-json-processing-table"><function>json_populate_record()</></> and friends operate recursively (Nikita Glukhov) </para> @@ -2127,7 +2127,7 @@ </para> <para> - The ecpg version now matches the Postgres distribution version + The ecpg version now matches the PostgreSQL distribution version number. </para> </listitem> @@ -2427,7 +2427,7 @@ <para> Temporary replication slots will be used by default when - <application>pg_basebackup</> uses wal streaming with default + <application>pg_basebackup</> uses WAL streaming with default options. </para> </listitem> @@ -2525,7 +2525,7 @@ <para> Major versions will now increase just the first number, and minor releases will increase just the second number. A third number - will no longer be used in Postgres version numbers. + will no longer be used in PostgreSQL version numbers. </para> </listitem> @@ -2670,7 +2670,7 @@ 2017-04-06 [510074f9f] Remove use of Jade and DSSSL --> <para> - Use <acronym>XSLT</> to build the Postgres documentation (Peter + Use <acronym>XSLT</> to build the PostgreSQL documentation (Peter Eisentraut) </para> @@ -2785,7 +2785,7 @@ --> <para> Add <link linkend="amcheck"><application>amcheck</></> which can - check the validity of btree indexes (Peter Geoghegan) + check the validity of B-tree indexes (Peter Geoghegan) </para> </listitem> diff --git a/doc/src/sgml/user-manag.sgml b/doc/src/sgml/user-manag.sgml index 914f1505ab..46989f0169 100644 --- a/doc/src/sgml/user-manag.sgml +++ b/doc/src/sgml/user-manag.sgml @@ -527,7 +527,7 @@ DROP ROLE doomed_role; </row> <row> <entry>pg_stat_scan_tables</entry> - <entry>Execute monitoring functions that may take AccessShareLocks on tables, + <entry>Execute monitoring functions that may take <literal>ACCESS SHARE</literal> locks on tables, potentially for a long time.</entry> </row> <row> diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index 8acdb0500e..2379fdddc8 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -2360,7 +2360,7 @@ CREATE FUNCTION concat_text(text, text) RETURNS text the system should automatically assume a null result if any input value is null. By doing this, we avoid having to check for null inputs in the function code. Without this, we'd have to check for null values - explicitly, using PG_ARGISNULL(). + explicitly, using <function>PG_ARGISNULL()</function>. </para> <para> @@ -3092,7 +3092,7 @@ CREATE OR REPLACE FUNCTION retcomposite(IN integer, IN integer, </para> <para> - The directory <link linkend="tablefunc">contrib/tablefunc</> + The directory <link linkend="tablefunc"><filename>contrib/tablefunc</filename></> module in the source distribution contains more examples of set-returning functions. </para> diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c index b0e89ace5e..efebeb035a 100644 --- a/src/backend/access/brin/brin.c +++ b/src/backend/access/brin/brin.c @@ -473,7 +473,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm) */ Assert((key->sk_flags & SK_ISNULL) || (key->sk_collation == - bdesc->bd_tupdesc->attrs[keyattno - 1]->attcollation)); + bdesc->bd_tupdesc->attrs[keyattno - 1]->attcollation)); /* First time this column? look up consistent function */ if (consistentFn[keyattno - 1].fn_oid == InvalidOid) @@ -1116,7 +1116,7 @@ terminate_brin_buildstate(BrinBuildState *state) page = BufferGetPage(state->bs_currentInsertBuf); RecordPageWithFreeSpace(state->bs_irel, - BufferGetBlockNumber(state->bs_currentInsertBuf), + BufferGetBlockNumber(state->bs_currentInsertBuf), PageGetFreeSpace(page)); ReleaseBuffer(state->bs_currentInsertBuf); } diff --git a/src/backend/access/brin/brin_inclusion.c b/src/backend/access/brin/brin_inclusion.c index bc16dd7981..9c0a058ccb 100644 --- a/src/backend/access/brin/brin_inclusion.c +++ b/src/backend/access/brin/brin_inclusion.c @@ -312,7 +312,7 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) case RTLeftStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, - RTOverRightStrategyNumber); + RTOverRightStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); PG_RETURN_BOOL(!DatumGetBool(result)); @@ -336,7 +336,7 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) case RTBelowStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, - RTOverAboveStrategyNumber); + RTOverAboveStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); PG_RETURN_BOOL(!DatumGetBool(result)); @@ -354,7 +354,7 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) case RTAboveStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, - RTOverBelowStrategyNumber); + RTOverBelowStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); PG_RETURN_BOOL(!DatumGetBool(result)); @@ -686,7 +686,7 @@ inclusion_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, strategynum, attr->atttypid, subtype, opfamily); oprid = DatumGetObjectId(SysCacheGetAttr(AMOPSTRATEGY, tuple, - Anum_pg_amop_amopopr, &isNull)); + Anum_pg_amop_amopopr, &isNull)); ReleaseSysCache(tuple); Assert(!isNull && RegProcedureIsValid(oprid)); diff --git a/src/backend/access/brin/brin_minmax.c b/src/backend/access/brin/brin_minmax.c index 8f7a0c75b8..62fd90aabe 100644 --- a/src/backend/access/brin/brin_minmax.c +++ b/src/backend/access/brin/brin_minmax.c @@ -212,7 +212,7 @@ brin_minmax_consistent(PG_FUNCTION_ARGS) break; /* max() >= scankey */ finfo = minmax_get_strategy_procinfo(bdesc, attno, subtype, - BTGreaterEqualStrategyNumber); + BTGreaterEqualStrategyNumber); matches = FunctionCall2Coll(finfo, colloid, column->bv_values[1], value); break; @@ -358,7 +358,7 @@ minmax_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, strategynum, attr->atttypid, subtype, opfamily); oprid = DatumGetObjectId(SysCacheGetAttr(AMOPSTRATEGY, tuple, - Anum_pg_amop_amopopr, &isNull)); + Anum_pg_amop_amopopr, &isNull)); ReleaseSysCache(tuple); Assert(!isNull && RegProcedureIsValid(oprid)); diff --git a/src/backend/access/brin/brin_pageops.c b/src/backend/access/brin/brin_pageops.c index 3609c8ae7c..80f803e438 100644 --- a/src/backend/access/brin/brin_pageops.c +++ b/src/backend/access/brin/brin_pageops.c @@ -73,8 +73,8 @@ brin_doupdate(Relation idxrel, BlockNumber pagesPerRange, { ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", - newsz, BrinMaxItemSize, RelationGetRelationName(idxrel)))); + errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", + newsz, BrinMaxItemSize, RelationGetRelationName(idxrel)))); return false; /* keep compiler quiet */ } @@ -355,9 +355,9 @@ brin_doinsert(Relation idxrel, BlockNumber pagesPerRange, { ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", - itemsz, BrinMaxItemSize, RelationGetRelationName(idxrel)))); - return InvalidOffsetNumber; /* keep compiler quiet */ + errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", + itemsz, BrinMaxItemSize, RelationGetRelationName(idxrel)))); + return InvalidOffsetNumber; /* keep compiler quiet */ } /* Make sure the revmap is long enough to contain the entry we need */ @@ -821,9 +821,9 @@ brin_getinsertbuffer(Relation irel, Buffer oldbuf, Size itemsz, ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), - errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", - itemsz, freespace, RelationGetRelationName(irel)))); - return InvalidBuffer; /* keep compiler quiet */ + errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", + itemsz, freespace, RelationGetRelationName(irel)))); + return InvalidBuffer; /* keep compiler quiet */ } if (newblk != oldblk) diff --git a/src/backend/access/brin/brin_revmap.c b/src/backend/access/brin/brin_revmap.c index e778cbcacd..22f2076887 100644 --- a/src/backend/access/brin/brin_revmap.c +++ b/src/backend/access/brin/brin_revmap.c @@ -48,7 +48,7 @@ struct BrinRevmap { Relation rm_irel; BlockNumber rm_pagesPerRange; - BlockNumber rm_lastRevmapPage; /* cached from the metapage */ + BlockNumber rm_lastRevmapPage; /* cached from the metapage */ Buffer rm_metaBuf; Buffer rm_currBuf; }; @@ -260,7 +260,7 @@ brinGetTupleForHeapBlock(Br |