/* 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.
{
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;
/*
/* 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;
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];
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;
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);
#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);
{
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
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 (;;)
*/
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));
/*
#include <string.h>
#include <stdarg.h>
-#endif /* DMETAPHONE_MAIN */
+#endif /* DMETAPHONE_MAIN */
#include <assert.h>
#include <ctype.h>
* 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 */
(v = (t*)realloc((v),((n)*sizeof(t))))
#define META_FREE(x) free((x))
-#endif /* defined DMETAPHONE_MAIN */
+#endif /* defined DMETAPHONE_MAIN */
}
}
- if (GetAt(original, current + 1) == 'J') /* it could happen! */
+ if (GetAt(original, current + 1) == 'J') /* it could happen! */
current += 2;
else
current += 1;
#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;
extern int no_such_variable
#endif
-#endif /* __HSTORE_H__ */
+#endif /* __HSTORE_H__ */
my_extra->ncolumns = ncolumns;
}
- Assert(ncolumns <= MaxTupleAttributeNumber); /* thus, no overflow */
+ Assert(ncolumns <= MaxTupleAttributeNumber); /* thus, no overflow */
pairs = palloc(ncolumns * sizeof(Pairs));
if (rec)
(direction) ? compASC : compDESC ); \
} while(0)
-#endif /* ___INT_H__ */
+#endif /* ___INT_H__ */
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;
}
elog(DEBUG1, "index %d is invalid", j);
return false;
}
-#endif /* ISN_DEBUG */
+#endif /* ISN_DEBUG */
/*----------------------------------------------------------
* Formatting and conversion routines.
/* 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'))
{
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:
g_weak = PG_GETARG_BOOL(0);
#else
/* function has no effect */
-#endif /* ISN_WEAK_MODE */
+#endif /* ISN_WEAK_MODE */
PG_RETURN_BOOL(g_weak);
}
extern void initialize(void);
-#endif /* ISN_H */
+#endif /* ISN_H */
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);
#define OPR 3
#define OPEN 4
#define CLOSE 5
-#define VALTRUE 6 /* for stop words */
+#define VALTRUE 6 /* for stop words */
#define VALFALSE 7
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);
}
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;
/* in rawpage.c */
extern Page get_page_from_raw(bytea *raw_page);
-#endif /* _PAGEINSPECT_H_ */
+#endif /* _PAGEINSPECT_H_ */
FuncCallContext *funcctx;
Datum result;
MemoryContext oldcontext;
- BufferCachePagesContext *fctx; /* User function context. */
+ BufferCachePagesContext *fctx; /* User function context. */
TupleDesc tupledesc;
TupleDesc expected_tupledesc;
HeapTuple tuple;
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;
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).
* 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
#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 */
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 */
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 */
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);
#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.
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
TrgmPackedGraph **graph, MemoryContext rcontext);
extern bool trigramsMatchGraph(TrgmPackedGraph *graph, bool *check);
-#endif /* __TRGM_H__ */
+#endif /* __TRGM_H__ */
* 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
pfree(buf.data);
}
-#endif /* TRGM_REGEXP_DEBUG */
+#endif /* TRGM_REGEXP_DEBUG */
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
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)
/* 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);
/* 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);
* 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 */
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);
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) */
{
w = UPPER_HALF(w);
if (ov)
{
- w += MP_DIGIT_MAX; /* MP_RADIX */
+ w += MP_DIGIT_MAX; /* MP_RADIX */
++w;
}
}
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 */
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) */
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) */
void s_print_buf(char *tag, mp_digit *buf, mp_size num);
#endif
-#endif /* end IMATH_H_ */
+#endif /* end IMATH_H_ */
/*
* 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.
*/
(dst) = __b; \
} while (0)
-#endif /* __PX_MBUF_H */
+#endif /* __PX_MBUF_H */
md5_result((x), (y)); \
} while (0)
-#endif /* ! _NETINET6_MD5_H_ */
+#endif /* ! _NETINET6_MD5_H_ */
*/
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;
char *px_crypt_md5(const char *pw, const char *salt,
char *dst, unsigned dstlen);
-#endif /* _PX_CRYPT_H */
+#endif /* _PX_CRYPT_H */
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);
(c)->decrypt(c, data, dlen, res, rlen)
#define px_combo_free(c) (c)->free(c)
-#endif /* __PX_H */
+#endif /* __PX_H */
#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)
}
tab_gen = 1;
-#endif /* !PRE_CALC_TABLES */
+#endif /* !PRE_CALC_TABLES */
}
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_ */
#define SHA1_RESULTLEN (160/8)
-#endif /* _NETINET6_SHA1_H_ */
+#endif /* _NETINET6_SHA1_H_ */
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 +
{
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++)
{
{
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++)
{
* 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 */
rows,
startup_cost,
total_cost,
- NIL, /* no pathkeys */
+ NIL, /* no pathkeys */
param_info->ppi_req_outer,
NULL,
NIL); /* no fdw_private list */
/* 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);
}
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);
* 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);
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);
rows,
startup_cost,
total_cost,
- NIL, /* no pathkeys */
+ NIL, /* no pathkeys */
NULL, /* no required_outer */
epq_path,
NIL); /* no fdw_private */
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 */
* 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
extern void sepgsql_proc_setattr(Oid functionId);
extern void sepgsql_proc_execute(Oid functionId);
-#endif /* SEPGSQL_H */
+#endif /* SEPGSQL_H */
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) */
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,
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,
#include "fmgr.h"
-#endif /* TABLEFUNC_H */
+#endif /* TABLEFUNC_H */
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 */
(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 */
}
uu.clock_seq_hi_and_reserved |= 0x80; \
} while(0)
-#endif /* !HAVE_UUID_OSSP */
+#endif /* !HAVE_UUID_OSSP */
PG_MODULE_MAGIC;
return DirectFunctionCall1(uuid_in, CStringGetDatum(strbuf));
}
-#endif /* HAVE_UUID_OSSP */
+#endif /* HAVE_UUID_OSSP */
Datum
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;
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;
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;
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;
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;
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;
#include <libxslt/security.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
-#endif /* USE_LIBXSLT */
+#endif /* USE_LIBXSLT */
#ifdef USE_LIBXSLT
/* local defs */
static const char **parse_params(text *paramstr);
-#endif /* USE_LIBXSLT */
+#endif /* USE_LIBXSLT */
PG_FUNCTION_INFO_V1(xslt_process);
(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
return params;
}
-#endif /* USE_LIBXSLT */
+#endif /* USE_LIBXSLT */
(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 */
+ return InvalidOffsetNumber; /* keep compiler quiet */
}
/* Make sure the revmap is long enough to contain the entry we need */
(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 */
+ return InvalidBuffer; /* keep compiler quiet */
}
if (newblk != oldblk)
{
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;
};
HeapTupleHeader tup = tuple->t_data;
Form_pg_attribute *att = tupleDesc->attrs;
char *tp; /* ptr to data part of tuple */
- bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
+ bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
bool slow = false; /* do we have to walk attrs? */
int off; /* current offset within data */
HeapTupleHeaderSetNatts(td, numberOfAttributes);
td->t_hoff = hoff;
- if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */
+ if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */
td->t_infomask = HEAP_HASOID;
heap_fill_tuple(tupleDescriptor,
int attnum;
char *tp; /* ptr to tuple data */
long off; /* offset in tuple data */
- bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
+ bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
bool slow = false; /* can we use/set attcacheoff? */
natts = HeapTupleHeaderGetNatts(tup);
int attnum;
char *tp; /* ptr to tuple data */
long off; /* offset in tuple data */
- bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
+ bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
bool slow; /* can we use/set attcacheoff? */
/*
{
if (tuple == NULL) /* internal error */
elog(ERROR, "cannot extract system attribute from virtual tuple");
- if (tuple == &(slot->tts_minhdr)) /* internal error */
+ if (tuple == &(slot->tts_minhdr)) /* internal error */
elog(ERROR, "cannot extract system attribute from minimal tuple");
return heap_getsysattr(tuple, attnum, tupleDesc, isnull);
}
{
if (tuple == NULL) /* internal error */
elog(ERROR, "cannot extract system attribute from virtual tuple");
- if (tuple == &(slot->tts_minhdr)) /* internal error */
+ if (tuple == &(slot->tts_minhdr)) /* internal error */
elog(ERROR, "cannot extract system attribute from minimal tuple");
return heap_attisnull(tuple, attnum);
}
HeapTupleHeaderSetNatts(tuple, numberOfAttributes);
tuple->t_hoff = hoff + MINIMAL_TUPLE_OFFSET;
- if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */
+ if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */
tuple->t_infomask = HEAP_HASOID;
heap_fill_tuple(tupleDescriptor,
case INT4OID:
{
int32 num = DatumGetInt32(value);
- char str[12]; /* sign, 10 digits and '\0' */
+ char str[12]; /* sign, 10 digits and '\0' */
pg_ltoa(num, str);
pq_sendcountedtext(&buf, str, strlen(str), false);
case INT8OID:
{
int64 num = DatumGetInt64(value);
- char str[23]; /* sign, 21 digits and '\0' */
+ char str[23]; /* sign, 21 digits and '\0' */
pg_lltoa(num, str);
pq_sendcountedtext(&buf, str, strlen(str), false);
n = indesc->natts + 1; /* +1 for NULL */
map->invalues = (Datum *) palloc(n * sizeof(Datum));
map->inisnull = (bool *) palloc(n * sizeof(bool));
- map->invalues[0] = (Datum) 0; /* set up the NULL entry */
+ map->invalues[0] = (Datum) 0; /* set up the NULL entry */
map->inisnull[0] = true;
return map;
n = indesc->natts + 1; /* +1 for NULL */
map->invalues = (Datum *) palloc(n * sizeof(Datum));
map->inisnull = (bool *) palloc(n * sizeof(bool));
- map->invalues[0] = (Datum) 0; /* set up the NULL entry */
+ map->invalues[0] = (Datum) 0; /* set up the NULL entry */
map->inisnull[0] = true;
return map;
cmpEntryAccumulator,
ginCombineData,
ginAllocEntryAccumulator,
- NULL, /* no freefunc needed */
+ NULL, /* no freefunc needed */
(void *) accum);
}
* Remember next page - it will become the new list head
*/
blkno = GinPageGetOpaque(page)->rightlink;
- UnlockReleaseBuffer(buffer); /* shiftList will do exclusive
- * locking */
+ UnlockReleaseBuffer(buffer); /* shiftList will do exclusive
+ * locking */
/*
* remove read pages from pending list, at this point all content
{
if (nullFlags[j])
{
- nullFlags[j] = true; /* not any other nonzero value */
+ nullFlags[j] = true; /* not any other nonzero value */
hasNullQuery = true;
}
}
vacuum_delay_point();
}
- if (blkno == InvalidBlockNumber) /* rightmost page */
+ if (blkno == InvalidBlockNumber) /* rightmost page */
break;
buffer = ReadBufferExtended(index, MAIN_FORKNUM, blkno,
giststate = (GISTSTATE *) palloc(sizeof(GISTSTATE));
giststate->scanCxt = scanCxt;
- giststate->tempCxt = scanCxt; /* caller must change this if needed */
+ giststate->tempCxt = scanCxt; /* caller must change this if needed */
giststate->tupdesc = index->rd_att;
for (i = 0; i < index->rd_att->natts; i++)
downlinks, ndownlinks, downlinkoffnum,
InvalidBlockNumber, InvalidOffsetNumber);
- list_free_deep(splitinfo); /* we don't need this anymore */
+ list_free_deep(splitinfo); /* we don't need this anymore */
}
else
UnlockReleaseBuffer(buffer);
* page seen so far. Skip the remaining columns and move
* on to the next page, if any.
*/
- zero_penalty = false; /* so outer loop won't exit */
+ zero_penalty = false; /* so outer loop won't exit */
break;
}
}
{
int i;
- if (GistPageIsLeaf(page)) /* shouldn't happen */
+ if (GistPageIsLeaf(page)) /* shouldn't happen */
elog(ERROR, "invalid GiST tuple found on leaf page");
for (i = 0; i < scan->numberOfOrderBys; i++)
so->distances[i] = -get_float8_infinity();
a += k[0];
/* case 0: nothing left to add */
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
}
else
{
a += (k[0] + ((uint32) k[1] << 8) + ((uint32) k[2] << 16) + ((uint32) k[3] << 24));
b += (k[4] + ((uint32) k[5] << 8) + ((uint32) k[6] << 16) + ((uint32) k[7] << 24));
c += (k[8] + ((uint32) k[9] << 8) + ((uint32) k[10] << 16) + ((uint32) k[11] << 24));
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
mix(a, b, c);
k += 12;
len -= 12;
a += k[0];
/* case 0: nothing left to add */
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
}
final(a, b, c);
}
if (so->hashso_sk_hash == _hash_get_indextuple_hashkey(itup))
- break; /* yes, so exit for-loop */
+ break; /* yes, so exit for-loop */
}
/* Before leaving current page, deal with any killed items */
}
if (so->hashso_sk_hash == _hash_get_indextuple_hashkey(itup))
- break; /* yes, so exit for-loop */
+ break; /* yes, so exit for-loop */
}
/* Before leaving current page, deal with any killed items */
/* account for buckets within splitpoint_group */
phases_within_splitpoint_group =
(((splitpoint_phase - HASH_SPLITPOINT_GROUPS_WITH_ONE_PHASE) &
- HASH_SPLITPOINT_PHASE_MASK) + 1); /* from 0-based to 1-based */
+ HASH_SPLITPOINT_PHASE_MASK) + 1); /* from 0-based to 1-based */
total_buckets +=
(((1 << (splitpoint_group - 1)) >> HASH_SPLITPOINT_PHASE_BITS) *
phases_within_splitpoint_group);
}
}
else
- page = scan->rs_startblock; /* first page */
+ page = scan->rs_startblock; /* first page */
heapgetpage(scan, page);
- lineoff = FirstOffsetNumber; /* first offnum */
+ lineoff = FirstOffsetNumber; /* first offnum */
scan->rs_inited = true;
}
else
{
/* continue from previously returned page/tuple */
- page = scan->rs_cblock; /* current page */
+ page = scan->rs_cblock; /* current page */
lineoff = /* next offnum */
OffsetNumberNext(ItemPointerGetOffsetNumber(&(tuple->t_self)));
}
else
{
/* continue from previously returned page/tuple */
- page = scan->rs_cblock; /* current page */
+ page = scan->rs_cblock; /* current page */
}
LockBuffer(scan->rs_cbuf, BUFFER_LOCK_SHARE);
}
}
else
- page = scan->rs_startblock; /* first page */
+ page = scan->rs_startblock; /* first page */
heapgetpage(scan, page);
lineindex = 0;
scan->rs_inited = true;
else
{
/* continue from previously returned page/tuple */
- page = scan->rs_cblock; /* current page */
+ page = scan->rs_cblock; /* current page */
lineindex = scan->rs_cindex + 1;
}
else
{
/* continue from previously returned page/tuple */
- page = scan->rs_cblock; /* current page */
+ page = scan->rs_cblock; /* current page */
}
dp = BufferGetPage(scan->rs_cbuf);
)
);
}
-#endif /* defined(DISABLE_COMPLEX_MACRO) */
+#endif /* defined(DISABLE_COMPLEX_MACRO) */
/* ----------------------------------------------------------------
#define HEAPDEBUG_1
#define HEAPDEBUG_2
#define HEAPDEBUG_3
-#endif /* !defined(HEAPDEBUGALL) */
+#endif /* !defined(HEAPDEBUGALL) */
HeapTuple
HeapTupleHeaderSetXminFrozen(tup->t_data);
HeapTupleHeaderSetCmin(tup->t_data, cid);
- HeapTupleHeaderSetXmax(tup->t_data, 0); /* for cleanliness */
+ HeapTupleHeaderSetXmax(tup->t_data, 0); /* for cleanliness */
tup->t_tableOid = RelationGetRelid(relation);
/*
HeapTupleClearHeapOnly(newtup);
}
- RelationPutHeapTuple(relation, newbuf, heaptup, false); /* insert new tuple */
+ RelationPutHeapTuple(relation, newbuf, heaptup, false); /* insert new tuple */
/* Clear obsolete visibility flags, possibly set by ourselves above... */
{
Assert(!TransactionIdDidCommit(xid));
*flags |= FRM_INVALIDATE_XMAX;
- xid = InvalidTransactionId; /* not strictly necessary */
+ xid = InvalidTransactionId; /* not strictly necessary */
}
else
{
if (otherBuffer != InvalidBuffer)
otherBlock = BufferGetBlockNumber(otherBuffer);
else
- otherBlock = InvalidBlockNumber; /* just to keep compiler quiet */
+ otherBlock = InvalidBlockNumber; /* just to keep compiler quiet */
/*
* We first try to put the tuple on the same page we last inserted a tuple
typedef struct
{
TransactionId new_prune_xid; /* new prune hint value for page */
- TransactionId latestRemovedXid; /* latest xid to be removed by this
- * prune */
+ TransactionId latestRemovedXid; /* latest xid to be removed by this prune */
int nredirected; /* numbers of entries in arrays below */
int ndead;
int nunused;
*/
if (PageIsFull(page) || PageGetHeapFreeSpace(page) < minfree)
{
- TransactionId ignore = InvalidTransactionId; /* return value not
- * needed */
+ TransactionId ignore = InvalidTransactionId; /* return value not
+ * needed */
/* OK to prune */
(void) heap_page_prune(relation, buffer, OldestXmin, true, &ignore);
BlockNumber rs_blockno; /* block where page will go */
bool rs_buffer_valid; /* T if any tuples in buffer */
bool rs_use_wal; /* must we WAL-log inserts? */
- bool rs_logical_rewrite; /* do we need to do logical rewriting */
- TransactionId rs_oldest_xmin; /* oldest xmin used by caller to
- * determine tuple visibility */
+ bool rs_logical_rewrite; /* do we need to do logical rewriting */
+ TransactionId rs_oldest_xmin; /* oldest xmin used by caller to determine
+ * tuple visibility */
TransactionId rs_freeze_xid; /* Xid that will be used as freeze cutoff
* point */
- TransactionId rs_logical_xmin; /* Xid that will be used as cutoff
- * point for logical rewrites */
+ TransactionId rs_logical_xmin; /* Xid that will be used as cutoff point
+ * for logical rewrites */
MultiXactId rs_cutoff_multi; /* MultiXactId that will be used as cutoff
* point for multixacts */
MemoryContext rs_cxt; /* for hash tables and entries and tuples in
* them */
XLogRecPtr rs_begin_lsn; /* XLogInsertLsn when starting the rewrite */
- HTAB *rs_unresolved_tups; /* unmatched A tuples */
- HTAB *rs_old_new_tid_map; /* unmatched B tuples */
+ HTAB *rs_unresolved_tups; /* unmatched A tuples */
+ HTAB *rs_old_new_tid_map; /* unmatched B tuples */
HTAB *rs_logical_mappings; /* logical remapping files */
- uint32 rs_num_rewrite_mappings; /* # in memory mappings */
+ uint32 rs_num_rewrite_mappings; /* # in memory mappings */
} RewriteStateData;
/*
*/
typedef struct RewriteMappingDataEntry
{
- LogicalRewriteMappingData map; /* map between old and new location of
- * the tuple */
+ LogicalRewriteMappingData map; /* map between old and new location of the
+ * tuple */
dlist_node node;
} RewriteMappingDataEntry;
else
heaptup = tup;
- len = MAXALIGN(heaptup->t_len); /* be conservative */
+ len = MAXALIGN(heaptup->t_len); /* be conservative */
/*
* If we're gonna fail for oversize tuple, do it right away
{
data_p = VARDATA_SHORT(dval);
data_todo = VARSIZE_SHORT(dval) - VARHDRSZ_SHORT;
- toast_pointer.va_rawsize = data_todo + VARHDRSZ; /* as if not short */
+ toast_pointer.va_rawsize = data_todo + VARHDRSZ; /* as if not short */
toast_pointer.va_extsize = data_todo;
}
else if (VARATT_IS_COMPRESSED(dval))
scan->heapRelation = NULL; /* may be set later */
scan->indexRelation = indexRelation;
- scan->xs_snapshot = InvalidSnapshot; /* caller must initialize this */
+ scan->xs_snapshot = InvalidSnapshot; /* caller must initialize this */
scan->numberOfKeys = nkeys;
scan->numberOfOrderBys = norderbys;
scan->xs_continue_hot = false;
- scan->kill_prior_tuple = false; /* for safety */
+ scan->kill_prior_tuple = false; /* for safety */
scan->indexRelation->rd_amroutine->amrescan(scan, keys, nkeys,
orderbys, norderbys);
scan->xs_continue_hot = false;
- scan->kill_prior_tuple = false; /* for safety */
+ scan->kill_prior_tuple = false; /* for safety */
scan->indexRelation->rd_amroutine->amrestrpos(scan);
}
OffsetNumber newitemoff; /* where the new item is to be inserted */
int leftspace; /* space available for items on left page */
int rightspace; /* space available for items on right page */
- int olddataitemstotal; /* space taken by old items */
+ int olddataitemstotal; /* space taken by old items */
bool have_split; /* found a valid split? */
IndexBulkDeleteCallback callback;
void *callback_state;
BTCycleId cycleid;
- BlockNumber lastBlockVacuumed; /* highest blkno actually vacuumed */
+ BlockNumber lastBlockVacuumed; /* highest blkno actually vacuumed */
BlockNumber lastBlockLocked; /* highest blkno we've cleanup-locked */
BlockNumber totFreePages; /* true total # of free pages */
MemoryContext pagedelcontext;
BTPS_State btps_pageStatus; /* indicates whether next page is
* available for scan. see above for
* possible states of parallel scan. */
- int btps_arrayKeyCount; /* count indicating number of array
- * scan keys processed by parallel
- * scan */
+ int btps_arrayKeyCount; /* count indicating number of array scan
+ * keys processed by parallel scan */
slock_t btps_mutex; /* protects above variables */
ConditionVariable btps_cv; /* used to synchronize parallel scan */
} BTParallelScanDescData;
#ifdef BTREE_BUILD_STATS
if (log_btree_build_stats)
ResetUsage();
-#endif /* BTREE_BUILD_STATS */
+#endif /* BTREE_BUILD_STATS */
/*
* We expect to be called exactly once for any index relation. If that's
ShowUsage("BTREE BUILD STATS");
ResetUsage();
}
-#endif /* BTREE_BUILD_STATS */
+#endif /* BTREE_BUILD_STATS */
/*
* Return statistics
datum = index_getattr(itup, scankey->sk_attno, itupdesc, &isNull);
/* see comments about NULLs handling in btbuild */
- if (scankey->sk_flags & SK_ISNULL) /* key is NULL */
+ if (scankey->sk_flags & SK_ISNULL) /* key is NULL */
{
if (isNull)
result = 0; /* NULL "=" NULL */
OffsetNumber btps_lastoff; /* last item offset loaded */
uint32 btps_level; /* tree level (0 = leaf) */
Size btps_full; /* "full" if less than this much free space */
- struct BTPageState *btps_next; /* link to parent level, if any */
+ struct BTPageState *btps_next; /* link to parent level, if any */
} BTPageState;
/*
Relation heap;
Relation index;
bool btws_use_wal; /* dump pages to WAL? */
- BlockNumber btws_pages_alloced; /* # pages allocated */
- BlockNumber btws_pages_written; /* # pages written out */
+ BlockNumber btws_pages_alloced; /* # pages allocated */
+ BlockNumber btws_pages_written; /* # pages written out */
Page btws_zeropage; /* workspace for filling zeroes */
} BTWriteState;
ShowUsage("BTREE BUILD (Spool) STATISTICS");
ResetUsage();
}
-#endif /* BTREE_BUILD_STATS */
+#endif /* BTREE_BUILD_STATS */
tuplesort_performsort(btspool->sortstate);
if (btspool2)
oopaque->btpo_next = nblkno;
nopaque->btpo_prev = oblkno;
- nopaque->btpo_next = P_NONE; /* redundant */
+ nopaque->btpo_next = P_NONE; /* redundant */
}
/*
const struct config_enum_entry wal_level_options[] = {
{"minimal", WAL_LEVEL_MINIMAL, false},
{"replica", WAL_LEVEL_REPLICA, false},
- {"archive", WAL_LEVEL_REPLICA, true}, /* deprecated */
+ {"archive", WAL_LEVEL_REPLICA, true}, /* deprecated */
{"hot_standby", WAL_LEVEL_REPLICA, true}, /* deprecated */
{"logical", WAL_LEVEL_LOGICAL, false},
{NULL, 0, false}
insertedNew = true;
}
for (i = 0; i < nToInsert; i++)
- leafPageSelect[i] = 0; /* signifies current page */
+ leafPageSelect[i] = 0; /* signifies current page */
}
else if (in.nTuples == 1 && totalLeafSizes > SPGIST_PAGE_CAPACITY)
{
{
if (leafSizes[i] <= curspace)
{
- nodePageSelect[i] = 0; /* signifies current page */
+ nodePageSelect[i] = 0; /* signifies current page */
curspace -= leafSizes[i];
}
else
{
- nodePageSelect[i] = 1; /* signifies new leaf page */
+ nodePageSelect[i] = 1; /* signifies new leaf page */
newspace -= leafSizes[i];
}
}
typedef struct ScanStackEntry
{
- Datum reconstructedValue; /* value reconstructed from parent */
+ Datum reconstructedValue; /* value reconstructed from parent */
void *traversalValue; /* opclass-specific traverse value */
int level; /* level of items on this page */
ItemPointerData ptr; /* block and offset to scan from */
{
ItemPointerData tid; /* redirection target to visit */
bool done; /* have we dealt with this? */
- struct spgVacPendingItem *next; /* list link */
+ struct spgVacPendingItem *next; /* list link */
} spgVacPendingItem;
/* Local state for vacuum operations */
/* Additional working state */
SpGistState spgstate; /* for SPGiST operations that need one */
- spgVacPendingItem *pendingList; /* TIDs we need to (re)visit */
+ spgVacPendingItem *pendingList; /* TIDs we need to (re)visit */
TransactionId myXmin; /* for detecting newly-added redirects */
BlockNumber lastFilledBlock; /* last non-deletable block */
} spgBulkDeleteState;
TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
TransactionId *subxids, XidStatus status, XLogRecPtr lsn)
{
- int pageno = TransactionIdToPage(xid); /* get page of parent */
+ int pageno = TransactionIdToPage(xid); /* get page of parent */
int i;
Assert(status == TRANSACTION_STATUS_COMMITTED ||
{
int num_files; /* # files actually open */
int fd[MAX_FLUSH_BUFFERS]; /* their FD's */
- int segno[MAX_FLUSH_BUFFERS]; /* their log seg#s */
+ int segno[MAX_FLUSH_BUFFERS]; /* their log seg#s */
} SlruFlushData;
typedef struct SlruFlushData *SlruFlush;
sz = MAXALIGN(sizeof(SlruSharedData));
sz += MAXALIGN(nslots * sizeof(char *)); /* page_buffer[] */
sz += MAXALIGN(nslots * sizeof(SlruPageStatus)); /* page_status[] */
- sz += MAXALIGN(nslots * sizeof(bool)); /* page_dirty[] */
- sz += MAXALIGN(nslots * sizeof(int)); /* page_number[] */
- sz += MAXALIGN(nslots * sizeof(int)); /* page_lru_count[] */
- sz += MAXALIGN(nslots * sizeof(LWLockPadded)); /* buffer_locks[] */
+ sz += MAXALIGN(nslots * sizeof(bool)); /* page_dirty[] */
+ sz += MAXALIGN(nslots * sizeof(int)); /* page_number[] */
+ sz += MAXALIGN(nslots * sizeof(int)); /* page_lru_count[] */
+ sz += MAXALIGN(nslots * sizeof(LWLockPadded)); /* buffer_locks[] */
if (nlsns > 0)
sz += MAXALIGN(nslots * nlsns * sizeof(XLogRecPtr)); /* group_lsn[] */
int bestvalidslot = 0; /* keep compiler quiet */
int best_valid_delta = -1;
int best_valid_page_number = 0; /* keep compiler quiet */
- int bestinvalidslot = 0; /* keep compiler quiet */
+ int bestinvalidslot = 0; /* keep compiler quiet */
int best_invalid_delta = -1;
- int best_invalid_page_number = 0; /* keep compiler quiet */
+ int best_invalid_page_number = 0; /* keep compiler quiet */
/* See if page already has a buffer assigned */
for (slotno = 0; slotno < shared->num_slots; slotno++)
{
if (existsTimeLineHistory(probeTLI))
{
- newestTLI = probeTLI; /* probeTLI exists */
+ newestTLI = probeTLI; /* probeTLI exists */
}
else
{
* track of the end LSN because that is the LSN we need to wait for prior
* to commit.
*/
- XLogRecPtr prepare_start_lsn; /* XLOG offset of prepare record start */
+ XLogRecPtr prepare_start_lsn; /* XLOG offset of prepare record start */
XLogRecPtr prepare_end_lsn; /* XLOG offset of prepare record end */
TransactionId xid; /* The GXACT id */
/*
* Header for a 2PC state file
*/
-#define TWOPHASE_MAGIC 0x57F94533 /* format identifier */
+#define TWOPHASE_MAGIC 0x57F94533 /* format identifier */
typedef struct TwoPhaseFileHeader
{
hdr.nabortrels = smgrGetPendingDeletes(false, &abortrels);
hdr.ninvalmsgs = xactGetCommittedInvalidationMessages(&invalmsgs,
&hdr.initfileinval);
- hdr.gidlen = strlen(gxact->gid) + 1; /* Include '\0' */
+ hdr.gidlen = strlen(gxact->gid) + 1; /* Include '\0' */
save_state_data(&hdr, sizeof(TwoPhaseFileHeader));
save_state_data(gxact->gid, hdr.gidlen);
lock_twophase_recover, /* Lock */
NULL, /* pgstat */
multixact_twophase_recover, /* MultiXact */
- predicatelock_twophase_recover /* PredicateLock */
+ predicatelock_twophase_recover /* PredicateLock */
};
const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] =
NULL, /* END ID */
lock_twophase_postcommit, /* Lock */
pgstat_twophase_postcommit, /* pgstat */
- multixact_twophase_postcommit, /* MultiXact */
+ multixact_twophase_postcommit, /* MultiXact */
NULL /* PredicateLock */
};
NULL, /* END ID */
lock_twophase_postabort, /* Lock */
pgstat_twophase_postabort, /* pgstat */
- multixact_twophase_postabort, /* MultiXact */
+ multixact_twophase_postabort, /* MultiXact */
NULL /* PredicateLock */
};
const TwoPhaseCallback twophase_standby_recover_callbacks[TWOPHASE_RM_MAX_ID + 1] =
{
NULL, /* END ID */
- lock_twophase_standby_recover, /* Lock */
+ lock_twophase_standby_recover, /* Lock */
NULL, /* pgstat */
NULL, /* MultiXact */
NULL /* PredicateLock */
TBlockState blockState; /* high-level state */
int nestingLevel; /* transaction nesting depth */
int gucNestLevel; /* GUC context nesting depth */
- MemoryContext curTransactionContext; /* my xact-lifetime context */
+ MemoryContext curTransactionContext; /* my xact-lifetime context */
ResourceOwner curTransactionOwner; /* my query resources */
TransactionId *childXids; /* subcommitted child XIDs, in XID order */
int nChildXids; /* # of subcommitted child XIDs */
int maxChildXids; /* allocated size of childXids[] */
Oid prevUser; /* previous CurrentUserId setting */
int prevSecContext; /* previous SecurityRestrictionContext */
- bool prevXactReadOnly; /* entry-time xact r/o state */
- bool startedInRecovery; /* did we start in recovery? */
+ bool prevXactReadOnly; /* entry-time xact r/o state */
+ bool startedInRecovery; /* did we start in recovery? */
bool didLogXid; /* has xid been included in WAL record? */
- int parallelModeLevel; /* Enter/ExitParallelMode counter */
- struct TransactionStateData *parent; /* back link to parent */
+ int parallelModeLevel; /* Enter/ExitParallelMode counter */
+ struct TransactionStateData *parent; /* back link to parent */
} TransactionStateData;
typedef TransactionStateData *TransactionState;
* do abort cleanup processing
*/
AtCleanup_Portals(); /* now safe to release portal memory */
- AtEOXact_Snapshot(false, true); /* and release the transaction's
- * snapshots */
+ AtEOXact_Snapshot(false, true); /* and release the transaction's snapshots */
CurrentResourceOwner = NULL; /* and resource owner */
if (TopTransactionResourceOwner)
case TBLOCK_SUBINPROGRESS:
/* Normal subtransaction start */
PushTransaction();
- s = CurrentTransactionState; /* changed by push */
+ s = CurrentTransactionState; /* changed by push */
/*
* Savepoint names, like the TransactionState block itself, live
case TBLOCK_SUBINPROGRESS:
/* Normal subtransaction start */
PushTransaction();
- s = CurrentTransactionState; /* changed by push */
+ s = CurrentTransactionState; /* changed by push */
/*
* Savepoint names, like the TransactionState block itself, live
/* User-settable parameters */
-int max_wal_size_mb = 1024; /* 1 GB */
-int min_wal_size_mb = 80; /* 80 MB */
+int max_wal_size_mb = 1024; /* 1 GB */
+int min_wal_size_mb = 80; /* 80 MB */
int wal_keep_segments = 0;
int XLOGbuffers = -1;
int XLogArchiveTimeout = 0;
XLogRecPtr asyncXactLSN; /* LSN of newest async commit/abort */
XLogRecPtr replicationSlotMinLSN; /* oldest LSN needed by any slot */
- XLogSegNo lastRemovedSegNo; /* latest removed/recycled XLOG
- * segment */
+ XLogSegNo lastRemovedSegNo; /* latest removed/recycled XLOG segment */
/* Fake LSN counter, for unlogged relations. Protected by ulsn_lck. */
XLogRecPtr unloggedLSN;
static XLogSegNo readSegNo = 0;
static uint32 readOff = 0;
static uint32 readLen = 0;
-static XLogSource readSource = 0; /* XLOG_FROM_* code */
+static XLogSource readSource = 0; /* XLOG_FROM_* code */
/*
* Keeps track of which source we're currently reading from. This is
* XLogReceiptSource tracks where we last successfully read some WAL.)
*/
static TimestampTz XLogReceiptTime = 0;
-static XLogSource XLogReceiptSource = 0; /* XLOG_FROM_* code */
+static XLogSource XLogReceiptSource = 0; /* XLOG_FROM_* code */
/* State information for XLOG reading */
static XLogRecPtr ReadRecPtr; /* start of last record read */
static XLogRecPtr EndRecPtr; /* end+1 of last record read */
-static XLogRecPtr minRecoveryPoint; /* local copy of
- * ControlFile->minRecoveryPoint */
+static XLogRecPtr minRecoveryPoint; /* local copy of
+ * ControlFile->minRecoveryPoint */
static TimeLineID minRecoveryPointTLI;
static bool updateMinRecoveryPoint = true;
{
result = fullsegs * UsableBytesInSegment +
(XLOG_BLCKSZ - SizeOfXLogLongPHD) + /* account for first page */
- (fullpages - 1) * UsableBytesInPage; /* full pages */
+ (fullpages - 1) * UsableBytesInPage; /* full pages */
if (offset > 0)
{
Assert(offset >= SizeOfXLogShortPHD);
/* signal that we need to wakeup walsenders later */
WalSndWakeupRequest();
- LogwrtResult.Flush = LogwrtResult.Write; /* end of page */
+ LogwrtResult.Flush = LogwrtResult.Write; /* end of page */
if (XLogArchivingActive())
XLogArchiveNotifySeg(openLogSegNo);
WriteControlFile(void)
{
int fd;
- char buffer[PG_CONTROL_SIZE]; /* need not be aligned */
+ char buffer[PG_CONTROL_SIZE]; /* need not be aligned */
/*
* Initialize version and compatibility-check fields
ereport(LOG,
(errmsg("using previous checkpoint record at %X/%X",
(uint32) (checkPointLoc >> 32), (uint32) checkPointLoc)));
- InRecovery = true; /* force recovery even if SHUTDOWNED */
+ InRecovery = true; /* force recovery even if SHUTDOWNED */
}
else
ereport(PANIC,
if (shutdown)
{
if (flags & CHECKPOINT_END_OF_RECOVERY)
- LocalXLogInsertAllowed = -1; /* return to "check" state */
+ LocalXLogInsertAllowed = -1; /* return to "check" state */
else
LocalXLogInsertAllowed = 0; /* never again write WAL */
}
appendStringInfoString(buf, " FPW");
}
}
-#endif /* WAL_DEBUG */
+#endif /* WAL_DEBUG */
/*
* Returns a string describing an XLogRecord, consisting of its identity
} registered_buffer;
static registered_buffer *registered_buffers;
-static int max_registered_buffers; /* allocated size */
-static int max_registered_block_id = 0; /* highest block_id + 1
- * currently registered */
+static int max_registered_buffers; /* allocated size */
+static int max_registered_block_id = 0; /* highest block_id + 1 currently
+ * registered */
/*
* A chain of XLogRecDatas to hold the "main data" of a WAL record, registered
if (IsBootstrapProcessingMode() && rmid != RM_XLOG_ID)
{
XLogResetInsertion();
- EndPos = SizeOfXLogLongPHD; /* start of 1st chkpt record */
+ EndPos = SizeOfXLogLongPHD; /* start of 1st chkpt record */
return EndPos;
}
return found;
}
-#endif /* FRONTEND */
+#endif /* FRONTEND */
/* ----------------------------------------
#include "utils/relmapper.h"
#include "utils/tqual.h"
-uint32 bootstrap_data_checksum_version = 0; /* No checksum */
+uint32 bootstrap_data_checksum_version = 0; /* No checksum */
#define ALLOC(t, c) \
static Datum values[MAXATTR]; /* current row's attribute values */
static bool Nulls[MAXATTR];
-static MemoryContext nogc = NULL; /* special no-gc mem context */
+static MemoryContext nogc = NULL; /* special no-gc mem context */
/*
* At bootstrap time, we first declare all the indices to be built, and
namestrcpy(&attrtypes[attnum]->attname, name);
elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
- attrtypes[attnum]->attnum = attnum + 1; /* fillatt */
+ attrtypes[attnum]->attnum = attnum + 1; /* fillatt */
typeoid = gettype(type);
DatumGetCString(DirectFunctionCall1(aclitemout,
PointerGetDatum(aip + i))));
}
-#endif /* ACLDEBUG */
+#endif /* ACLDEBUG */
/*
} ObjectAddressExtra;
/* ObjectAddressExtra flag bits */
-#define DEPFLAG_ORIGINAL 0x0001 /* an original deletion target */
-#define DEPFLAG_NORMAL 0x0002 /* reached via normal dependency */
-#define DEPFLAG_AUTO 0x0004 /* reached via auto dependency */
-#define DEPFLAG_INTERNAL 0x0008 /* reached via internal dependency */
-#define DEPFLAG_EXTENSION 0x0010 /* reached via extension dependency */
-#define DEPFLAG_REVERSE 0x0020 /* reverse internal/extension link */
+#define DEPFLAG_ORIGINAL 0x0001 /* an original deletion target */
+#define DEPFLAG_NORMAL 0x0002 /* reached via normal dependency */
+#define DEPFLAG_AUTO 0x0004 /* reached via auto dependency */
+#define DEPFLAG_INTERNAL 0x0008 /* reached via internal dependency */
+#define DEPFLAG_EXTENSION 0x0010 /* reached via extension dependency */
+#define DEPFLAG_REVERSE 0x0020 /* reverse internal/extension link */
/* expansible list of ObjectAddresses */
OperatorClassRelationId, /* OCLASS_OPCLASS */
OperatorFamilyRelationId, /* OCLASS_OPFAMILY */
AccessMethodRelationId, /* OCLASS_AM */
- AccessMethodOperatorRelationId, /* OCLASS_AMOP */
+ AccessMethodOperatorRelationId, /* OCLASS_AMOP */
AccessMethodProcedureRelationId, /* OCLASS_AMPROC */
RewriteRelationId, /* OCLASS_REWRITE */
TriggerRelationId, /* OCLASS_TRIGGER */
AuthIdRelationId, /* OCLASS_ROLE */
DatabaseRelationId, /* OCLASS_DATABASE */
TableSpaceRelationId, /* OCLASS_TBLSPACE */
- ForeignDataWrapperRelationId, /* OCLASS_FDW */
+ ForeignDataWrapperRelationId, /* OCLASS_FDW */
ForeignServerRelationId, /* OCLASS_FOREIGN_SERVER */
UserMappingRelationId, /* OCLASS_USER_MAPPING */
DefaultAclRelationId, /* OCLASS_DEFACL */
findDependentObjects(thisobj,
DEPFLAG_ORIGINAL,
flags,
- NULL, /* empty stack */
+ NULL, /* empty stack */
targetObjects,
objects,
&depRel);
rte.type = T_RangeTblEntry;
rte.rtekind = RTE_RELATION;
rte.relid = relId;
- rte.relkind = RELKIND_RELATION; /* no need for exactness here */
+ rte.relkind = RELKIND_RELATION; /* no need for exactness here */
context.rtables = list_make1(list_make1(&rte));
TargetEntry *tle = (TargetEntry *) lfirst(lc);
if (tle->resjunk)
- continue; /* ignore junk tlist items */
+ continue; /* ignore junk tlist items */
add_object_address(OCLASS_CLASS, rte->relid, tle->resno,
context->addrs);
}
return
TypeCreate(new_row_type, /* optional predetermined OID */
typeName, /* type name */
- typeNamespace, /* type namespace */
+ typeNamespace, /* type namespace */
new_rel_oid, /* relation oid */
new_rel_kind, /* relation kind */
ownerid, /* owner's ID */
-1, /* internal size (varlena) */
TYPTYPE_COMPOSITE, /* type-type (composite) */
- TYPCATEGORY_COMPOSITE, /* type-category (ditto) */
+ TYPCATEGORY_COMPOSITE, /* type-category (ditto) */
false, /* composite types are never preferred */
DEFAULT_TYPDELIM, /* default array delimiter */
F_RECORD_IN, /* input procedure */
F_RECORD_OUT, /* output procedure */
- F_RECORD_RECV, /* receive procedure */
- F_RECORD_SEND, /* send procedure */
+ F_RECORD_RECV, /* receive procedure */
+ F_RECORD_SEND, /* send procedure */
InvalidOid, /* typmodin procedure - none */
InvalidOid, /* typmodout procedure - none */
InvalidOid, /* analyze procedure - default */
InvalidOid, /* array element type - irrelevant */
false, /* this is not an array type */
- new_array_type, /* array type if any */
+ new_array_type, /* array type if any */
InvalidOid, /* domain base type - irrelevant */
NULL, /* default value - none */
NULL, /* default binary representation */
relarrayname = makeArrayTypeName(relname, relnamespace);
- TypeCreate(new_array_oid, /* force the type's OID to this */
+ TypeCreate(new_array_oid, /* force the type's OID to this */
relarrayname, /* Array type name */
relnamespace, /* Same namespace as parent */
InvalidOid, /* Not composite, no relationOid */
tuple = SearchSysCacheCopy2(ATTNUM,
ObjectIdGetDatum(relid),
Int16GetDatum(attnum));
- if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
+ if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, relid);
attStruct = (Form_pg_attribute) GETSTRUCT(tuple);
tuple = SearchSysCacheCopy2(ATTNUM,
ObjectIdGetDatum(myrelid),
Int16GetDatum(myattnum));
- if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
+ if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
myattnum, myrelid);
*/
constrOid =
CreateConstraintEntry(ccname, /* Constraint Name */
- RelationGetNamespace(rel), /* namespace */
+ RelationGetNamespace(rel), /* namespace */
CONSTRAINT_CHECK, /* Constraint Type */
false, /* Is Deferrable */
false, /* Is Deferred */
RelationGetRelid(rel), /* relation */
attNos, /* attrs in the constraint */
keycount, /* # attrs in the constraint */
- InvalidOid, /* not a domain constraint */
- InvalidOid, /* no associated index */
- InvalidOid, /* Foreign key fields */
+ InvalidOid, /* not a domain constraint */
+ InvalidOid, /* no associated index */
+ InvalidOid, /* Foreign key fields */
NULL,
NULL,
NULL,
' ',
' ',
' ',
- NULL, /* not an exclusion constraint */
- expr, /* Tree form of check constraint */
+ NULL, /* not an exclusion constraint */
+ expr, /* Tree form of check constraint */
ccbin, /* Binary form of check constraint */
ccsrc, /* Source form of check constraint */
is_local, /* conislocal */
inhcount, /* coninhcount */
is_no_inherit, /* connoinherit */
- is_internal); /* internally constructed? */
+ is_internal); /* internally constructed? */
pfree(ccbin);
pfree(ccsrc);
HeapTuple indexTuple;
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);
result = ((Form_pg_index) GETSTRUCT(indexTuple))->indisprimary;
ReleaseSysCache(indexTuple);
/*
* here we are indexing on a normal attribute (1...n)
*/
- if (atnum > natts) /* safety check */
+ if (atnum > natts) /* safety check */
elog(ERROR, "invalid column number %d", atnum);
from = heapTupDesc->attrs[AttrNumberGetAttrOffset(atnum)];
}
/*
* Set the attribute name as specified by caller.
*/
- if (colnames_item == NULL) /* shouldn't happen */
+ if (colnames_item == NULL) /* shouldn't happen */
elog(ERROR, "too few entries in colnames list");
namestrcpy(&to->attname, (const char *) lfirst(colnames_item));
colnames_item = lnext(colnames_item);
else
{
elog(ERROR, "constraint must be PRIMARY, UNIQUE or EXCLUDE");
- constraintType = 0; /* keep compiler quiet */
+ constraintType = 0; /* keep compiler quiet */
}
index_constraint_create(heapRelation,
constraintType,
deferrable,
initdeferred,
- false, /* already marked primary */
- false, /* pg_index entry is OK */
- false, /* no old dependencies */
+ false, /* already marked primary */
+ false, /* pg_index entry is OK */
+ false, /* no old dependencies */
allow_system_table_mods,
is_internal);
}
indexInfo->ii_KeyAttrNumbers,
indexInfo->ii_NumIndexAttrs,
InvalidOid, /* no domain */
- indexRelationId, /* index OID */
+ indexRelationId, /* index OID */
InvalidOid, /* no foreign key */
NULL,
NULL,
' ',
' ',
indexInfo->ii_ExclusionOps,
- NULL, /* no check constraint */
+ NULL, /* no check constraint */
NULL,
NULL,
- true, /* islocal */
+ true, /* islocal */
0, /* inhcount */
- true, /* noinherit */
+ true, /* noinherit */
is_internal);
/*
if (IsBootstrapProcessingMode() || indexInfo->ii_Concurrent)
{
snapshot = RegisterSnapshot(GetTransactionSnapshot());
- OldestXmin = InvalidTransactionId; /* not used */
+ OldestXmin = InvalidTransactionId; /* not used */
/* "any visible" mode is not compatible with this */
Assert(!anyvisible);
}
scan = heap_beginscan_strat(heapRelation, /* relation */
- snapshot, /* snapshot */
- 0, /* number of keys */
+ snapshot, /* snapshot */
+ 0, /* number of keys */
NULL, /* scan key */
true, /* buffer access strategy OK */
allow_sync); /* syncscan OK? */
break;
default:
elog(ERROR, "unexpected HeapTupleSatisfiesVacuum result");
- indexIt = tupleIsAlive = false; /* keep compiler quiet */
+ indexIt = tupleIsAlive = false; /* keep compiler quiet */
break;
}
*/
snapshot = RegisterSnapshot(GetLatestSnapshot());
scan = heap_beginscan_strat(heapRelation, /* relation */
- snapshot, /* snapshot */
- 0, /* number of keys */
+ snapshot, /* snapshot */
+ 0, /* number of keys */
NULL, /* scan key */
true, /* buffer access strategy OK */
true); /* syncscan OK */
* match the sorted TIDs.
*/
scan = heap_beginscan_strat(heapRelation, /* relation */
- snapshot, /* snapshot */
- 0, /* number of keys */
+ snapshot, /* snapshot */
+ 0, /* number of keys */
NULL, /* scan key */
true, /* buffer access strategy OK */
false); /* syncscan not OK */
ResultRelInfo *resultRelInfo;
resultRelInfo = makeNode(ResultRelInfo);
- resultRelInfo->ri_RangeTableIndex = 1; /* dummy */
+ resultRelInfo->ri_RangeTableIndex = 1; /* dummy */
resultRelInfo->ri_RelationDesc = heapRel;
resultRelInfo->ri_TrigDesc = NULL; /* we don't fire triggers */
index_insert(relationDescs[i], /* index relation */
values, /* array of index Datums */
isnull, /* is-null flags */
- &(heapTuple->t_self), /* tid of heap tuple */
+ &(heapTuple->t_self), /* tid of heap tuple */
heapRelation,
relationDescs[i]->rd_index->indisunique ?
UNIQUE_CHECK_YES : UNIQUE_CHECK_NO,
typedef struct
{
List *searchPath; /* the desired search path */
- Oid creationNamespace; /* the desired creation namespace */
+ Oid creationNamespace; /* the desired creation namespace */
int nestLevel; /* subtransaction nesting level */
} OverrideStackEntry;
if (relation->relpersistence == RELPERSISTENCE_TEMP)
{
if (!OidIsValid(myTempNamespace))
- relId = InvalidOid; /* this probably can't happen? */
+ relId = InvalidOid; /* this probably can't happen? */
else
{
if (relation->schemaname)
/* We have a match with a previous result */
Assert(pathpos != prevResult->pathpos);
if (pathpos > prevResult->pathpos)
- continue; /* keep previous result */
+ continue; /* keep previous result */
/* replace previous result */
prevResult->pathpos = pathpos;
prevResult->oid = HeapTupleGetOid(opertup);
entry = (OverrideStackEntry *) linitial(overrideStack);
activeSearchPath = entry->searchPath;
activeCreationNamespace = entry->creationNamespace;
- activeTempCreationPending = false; /* XXX is this OK? */
+ activeTempCreationPending = false; /* XXX is this OK? */
}
else
{
{
myTempNamespace = InvalidOid;
myTempToastNamespace = InvalidOid;
- baseSearchPathValid = false; /* need to rebuild list */
+ baseSearchPathValid = false; /* need to rebuild list */
}
myTempNamespaceSubID = InvalidSubTransactionId;
}
/* TEMP namespace creation failed, so reset state */
myTempNamespace = InvalidOid;
myTempToastNamespace = InvalidOid;
- baseSearchPathValid = false; /* need to rebuild list */
+ baseSearchPathValid = false; /* need to rebuild list */
}
}
entry = (OverrideStackEntry *) linitial(overrideStack);
activeSearchPath = entry->searchPath;
activeCreationNamespace = entry->creationNamespace;
- activeTempCreationPending = false; /* XXX is this OK? */
+ activeTempCreationPending = false; /* XXX is this OK? */
}
else
{
Oid class_oid; /* oid of catalog */
Oid oid_index_oid; /* oid of index on system oid column */
int oid_catcache_id; /* id of catcache on system oid column */
- int name_catcache_id; /* id of catcache on (name,namespace),
- * or (name) if the object does not
- * live in a namespace */
+ int name_catcache_id; /* id of catcache on (name,namespace), or
+ * (name) if the object does not live in a
+ * namespace */
AttrNumber attnum_name; /* attnum of name field */
- AttrNumber attnum_namespace; /* attnum of namespace field */
+ AttrNumber attnum_namespace; /* attnum of namespace field */
AttrNumber attnum_owner; /* attnum of owner field */
AttrNumber attnum_acl; /* attnum of acl field */
AclObjectKind acl_kind; /* ACL_KIND_* of this object type */
- bool is_nsp_name_unique; /* can the nsp/name combination (or
- * name alone, if there's no
- * namespace) be considered a unique
- * identifier for an object of this
- * class? */
+ bool is_nsp_name_unique; /* can the nsp/name combination (or name
+ * alone, if there's no namespace) be
+ * considered a unique identifier for an
+ * object of this class? */
} ObjectPropertyType;
static const ObjectPropertyType ObjectProperty[] =
*/
i = 0;
partexprs_item = list_head(key->partexprs);
- partexprs_item_saved = partexprs_item; /* placate compiler */
+ partexprs_item_saved = partexprs_item; /* placate compiler */
forboth(cell1, spec->lowerdatums, cell2, spec->upperdatums)
{
EState *estate;
Oid finalfn = InvalidOid; /* can be omitted */
Oid combinefn = InvalidOid; /* can be omitted */
Oid serialfn = InvalidOid; /* can be omitted */
- Oid deserialfn = InvalidOid; /* can be omitted */
+ Oid deserialfn = InvalidOid; /* can be omitted */
Oid mtransfn = InvalidOid; /* can be omitted */
- Oid minvtransfn = InvalidOid; /* can be omitted */
+ Oid minvtransfn = InvalidOid; /* can be omitted */
Oid mfinalfn = InvalidOid; /* can be omitted */
Oid sortop = InvalidOid; /* can be omitted */
Oid *aggArgTypes = parameterTypes->values;
myself = ProcedureCreate(aggName,
aggNamespace,
- false, /* no replacement */
- false, /* doesn't return a set */
+ false, /* no replacement */
+ false, /* doesn't return a set */
finaltype, /* returnType */
- GetUserId(), /* proowner */
- INTERNALlanguageId, /* languageObjectId */
- InvalidOid, /* no validator */
+ GetUserId(), /* proowner */
+ INTERNALlanguageId, /* languageObjectId */
+ InvalidOid, /* no validator */
"aggregate_dummy", /* placeholder proc */
- NULL, /* probin */
- true, /* isAgg */
- false, /* isWindowFunc */
- false, /* security invoker (currently not
- * definable for agg) */
- false, /* isLeakProof */
- false, /* isStrict (not needed for agg) */
- PROVOLATILE_IMMUTABLE, /* volatility (not
- * needed for agg) */
+ NULL, /* probin */
+ true, /* isAgg */
+ false, /* isWindowFunc */
+ false, /* security invoker (currently not
+ * definable for agg) */
+ false, /* isLeakProof */
+ false, /* isStrict (not needed for agg) */
+ PROVOLATILE_IMMUTABLE, /* volatility (not needed
+ * for agg) */
proparallel,
parameterTypes, /* paramTypes */
allParameterTypes, /* allParamTypes */
parameterModes, /* parameterModes */
parameterNames, /* parameterNames */
parameterDefaults, /* parameterDefaults */
- PointerGetDatum(NULL), /* trftypes */
- PointerGetDatum(NULL), /* proconfig */
+ PointerGetDatum(NULL), /* trftypes */
+ PointerGetDatum(NULL), /* proconfig */
1, /* procost */
0); /* prorows */
procOid = myself.objectId;
con->conrelid);
classForm = (Form_pg_class) GETSTRUCT(relTup);
- if (classForm->relchecks == 0) /* should not happen */
+ if (classForm->relchecks == 0) /* should not happen */
elog(ERROR, "relation \"%s\" has relchecks = 0",
RelationGetRelationName(rel));
classForm->relchecks--;
if (isNull)
elog(ERROR, "null conkey for constraint %u",
HeapTupleGetOid(tuple));
- arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
+ arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
numkeys = ARR_DIMS(arr)[0];
if (ARR_NDIM(arr) != 1 ||
numkeys < 0 ||
for (i = 0; i < Natts_pg_operator; ++i)
{
nulls[i] = false;
- values[i] = (Datum) NULL; /* redundant, but safe */
+ values[i] = (Datum) NULL; /* redundant, but safe */
}
/*
for (i = 0; i < Natts_pg_type; ++i)
{
nulls[i] = false;
- values[i] = (Datum) NULL; /* redundant, but safe */
+ values[i] = (Datum) NULL; /* redundant, but safe */
}
/*
bool isImplicitArray,
Oid arrayType,
Oid baseType,
- const char *defaultTypeValue, /* human readable rep */
+ const char *defaultTypeValue, /* human readable rep */
char *defaultTypeBin, /* cooked rep */
bool passedByValue,
char alignment,
void
GenerateTypeDependencies(Oid typeNamespace,
Oid typeObjectId,
- Oid relationOid, /* only for relation rowtypes */
- char relationKind, /* ditto */
+ Oid relationOid, /* only for relation rowtypes */
+ char relationKind, /* ditto */
Oid owner,
Oid inputProcedure,
Oid outputProcedure,
BackendId backend; /* InvalidBackendId if not a temp rel */
bool atCommit; /* T=delete at commit; F=delete at abort */
int nestLevel; /* xact nesting level of request */
- struct PendingRelDelete *next; /* linked-list link */
+ struct PendingRelDelete *next; /* linked-list link */
} PendingRelDelete;
static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */
/*
* Most of the argument-checking is done inside of AggregateCreate
*/
- return AggregateCreate(aggName, /* aggregate name */
- aggNamespace, /* namespace */
+ return AggregateCreate(aggName, /* aggregate name */
+ aggNamespace, /* namespace */
aggKind,
numArgs,
numDirectArgs,
PointerGetDatum(parameterNames),
parameterDefaults,
variadicArgType,
- transfuncName, /* step function name */
- finalfuncName, /* final function name */
- combinefuncName, /* combine function name */
- serialfuncName, /* serial function name */
+ transfuncName, /* step function name */
+ finalfuncName, /* final function name */
+ combinefuncName, /* combine function name */
+ serialfuncName, /* serial function name */
deserialfuncName, /* deserial function name */
- mtransfuncName, /* fwd trans function name */
+ mtransfuncName, /* fwd trans function name */
minvtransfuncName, /* inv trans function name */
- mfinalfuncName, /* final function name */
+ mfinalfuncName, /* final function name */
finalfuncExtraArgs,
mfinalfuncExtraArgs,
sortoperatorName, /* sort operator name */
transTypeId, /* transition data type */
transSpace, /* transition space */
- mtransTypeId, /* transition data type */
+ mtransTypeId, /* transition data type */
mtransSpace, /* transition space */
- initval, /* initial condition */
+ initval, /* initial condition */
minitval, /* initial condition */
- proparallel); /* parallel safe? */
+ proparallel); /* parallel safe? */
}
default:
elog(ERROR, "unrecognized rename stmt type: %d",
(int) stmt->renameType);
- return InvalidObjectAddress; /* keep compiler happy */
+ return InvalidObjectAddress; /* keep compiler happy */
}
}
default:
elog(ERROR, "unrecognized AlterObjectSchemaStmt type: %d",
(int) stmt->objectType);
- return InvalidObjectAddress; /* keep compiler happy */
+ return InvalidObjectAddress; /* keep compiler happy */
}
if (oldSchemaAddr)
default:
elog(ERROR, "unrecognized AlterOwnerStmt type: %d",
(int) stmt->objectType);
- return InvalidObjectAddress; /* keep compiler happy */
+ return InvalidObjectAddress; /* keep compiler happy */
}
}
/* Found an index expression */
Node *indexkey;
- if (indexpr_item == NULL) /* shouldn't happen */
+ if (indexpr_item == NULL) /* shouldn't happen */
elog(ERROR, "too few entries in indexprs list");
indexkey = (Node *) lfirst(indexpr_item);
indexpr_item = lnext(indexpr_item);
i = Anum_pg_statistic_stakind1 - 1;
for (k = 0; k < STATISTIC_NUM_SLOTS; k++)
{
- values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */
+ values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */
}
i = Anum_pg_statistic_staop1 - 1;
for (k = 0; k < STATISTIC_NUM_SLOTS; k++)
stats->stawidth = total_width / (double) nonnull_cnt;
else
stats->stawidth = stats->attrtype->typlen;
- stats->stadistinct = 0.0; /* "unknown" */
+ stats->stadistinct = 0.0; /* "unknown" */
}
else if (null_cnt > 0)
{
stats->stawidth = 0; /* "unknown" */
else
stats->stawidth = stats->attrtype->typlen;
- stats->stadistinct = 0.0; /* "unknown" */
+ stats->stadistinct = 0.0; /* "unknown" */
}
}
stats->stawidth = 0; /* "unknown" */
else
stats->stawidth = stats->attrtype->typlen;
- stats->stadistinct = 0.0; /* "unknown" */
+ stats->stadistinct = 0.0; /* "unknown" */
}
/* We don't need to bother cleaning up any of our temporary palloc's */
stats->stawidth = 0; /* "unknown" */
else
stats->stawidth = stats->attrtype->typlen;
- stats->stadistinct = 0.0; /* "unknown" */
+ stats->stadistinct = 0.0; /* "unknown" */
}
/* We don't need to bother cleaning up any of our temporary palloc's */
QueuePosition head; /* head points to the next free location */
QueuePosition tail; /* the global tail is equivalent to the pos of
* the "slowest" backend */
- TimestampTz lastQueueFillWarn; /* time of last queue-full msg */
+ TimestampTz lastQueueFillWarn; /* time of last queue-full msg */
QueueBackendStatus backend[FLEXIBLE_ARRAY_MEMBER];
/* backend[0] is not used; used entries are from [1] to [MaxBackends] */
} AsyncQueueControl;
#define AsyncCtl (&AsyncCtlData)
#define QUEUE_PAGESIZE BLCKSZ
-#define QUEUE_FULL_WARN_INTERVAL 5000 /* warn at most once every 5s */
+#define QUEUE_FULL_WARN_INTERVAL 5000 /* warn at most once every 5s */
/*
* slru.c currently assumes that all filenames are four characters of hex
* (ie, have committed a LISTEN on). It is a simple list of channel names,
* allocated in TopMemoryContext.
*/
-static List *listenChannels = NIL; /* list of C strings */
+static List *listenChannels = NIL; /* list of C strings */
/*
* State for pending LISTEN/UNLISTEN actions consists of an ordered list of
char channel[FLEXIBLE_ARRAY_MEMBER]; /* nul-terminated string */
} ListenAction;
-static List *pendingActions = NIL; /* list of ListenAction */
+static List *pendingActions = NIL; /* list of ListenAction */
static List *upperPendingActions = NIL; /* list of upper-xact lists */
char *payload; /* payload string (can be empty) */
} Notification;
-static List *pendingNotifies = NIL; /* list of Notifications */
+static List *pendingNotifies = NIL; /* list of Notifications */
-static List *upperPendingNotifies = NIL; /* list of upper-xact lists */
+static List *upperPendingNotifies = NIL; /* list of upper-xact lists */
/*
* Inbound notifications are initially processed by HandleNotifyInterrupt(),
{
bool advanceTail;
- Assert(listenChannels == NIL); /* else caller error */
+ Assert(listenChannels == NIL); /* else caller error */
if (!amRegisteredListener) /* nothing to do */
return;
/* we only want to read as far as head */
copysize = QUEUE_POS_OFFSET(head) - curoffset;
if (copysize < 0)
- copysize = 0; /* just for safety */
+ copysize = 0; /* just for safety */
}
else
{
* Check that the index is still the one with indisclustered set.
*/
tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexOid));
- if (!HeapTupleIsValid(tuple)) /* probably can't happen */
+ if (!HeapTupleIsValid(tuple)) /* probably can't happen */
{
relation_close(OldHeap, AccessExclusiveLock);
return;
return result;
}
-#endif /* USE_ICU */
+#endif /* USE_ICU */
Datum
if (count == 0)
ereport(WARNING,
(errmsg("no usable system locales were found")));
-#endif /* not HAVE_LOCALE_T && not WIN32 */
+#endif /* not HAVE_LOCALE_T && not WIN32 */
#ifdef USE_ICU
if (!is_encoding_supported_by_icu(GetDatabaseEncoding()))
bool fe_eof; /* true if detected end of copy data */
EolType eol_type; /* EOL type of input */
int file_encoding; /* file or remote side's character encoding */
- bool need_transcoding; /* file encoding diff from server? */
+ bool need_transcoding; /* file encoding diff from server? */
bool encoding_embeds_ascii; /* ASCII can be non-first byte? */
/* parameters from the COPY command */
bool header_line; /* CSV header line? */
char *null_print; /* NULL marker string (server encoding!) */
int null_print_len; /* length of same */
- char *null_print_client; /* same converted to file encoding */
+ char *null_print_client; /* same converted to file encoding */
char *delim; /* column delimiter (must be 1 byte) */
char *quote; /* CSV quote char (must be 1 byte) */
char *escape; /* CSV escape char (must be 1 byte) */
List *force_quote; /* list of column names */
bool force_quote_all; /* FORCE_QUOTE *? */
- bool *force_quote_flags; /* per-column CSV FQ flags */
+ bool *force_quote_flags; /* per-column CSV FQ flags */
List *force_notnull; /* list of column names */
bool *force_notnull_flags; /* per-column CSV FNN flags */
List *force_null; /* list of column names */
- bool *force_null_flags; /* per-column CSV FN flags */
+ bool *force_null_flags; /* per-column CSV FN flags */
bool convert_selectively; /* do selective binary conversion? */
List *convert_select; /* list of column names (can be NIL) */
bool *convert_select_flags; /* per-column CSV/TEXT CS flags */
Oid *typioparams; /* array of element types for in_functions */
int *defmap; /* array of default att numbers */
ExprState **defexprs; /* array of default att expressions */
- bool volatile_defexprs; /* is any of defexprs volatile? */
+ bool volatile_defexprs; /* is any of defexprs volatile? */
List *range_table;
PartitionDispatch *partition_dispatch_info;
* can display it in error messages if appropriate.
*/
StringInfoData line_buf;
- bool line_buf_converted; /* converted to server encoding? */
+ bool line_buf_converted; /* converted to server encoding? */
bool line_buf_valid; /* contains the row being processed? */
/*
int i;
pq_beginmessage(&buf, 'H');
- pq_sendbyte(&buf, format); /* overall format */
+ pq_sendbyte(&buf, format); /* overall format */
pq_sendint(&buf, natts, 2);
for (i = 0; i < natts; i++)
- pq_sendint(&buf, format, 2); /* per-column formats */
+ pq_sendint(&buf, format, 2); /* per-column formats */
pq_endmessage(&buf);
cstate->copy_dest = COPY_NEW_FE;
}
int i;
pq_beginmessage(&buf, 'G');
- pq_sendbyte(&buf, format); /* overall format */
+ pq_sendbyte(&buf, format); /* overall format */
pq_sendint(&buf, natts, 2);
for (i = 0; i < natts; i++)
- pq_sendint(&buf, format, 2); /* per-column formats */
+ pq_sendint(&buf, format, 2); /* per-column formats */
pq_endmessage(&buf);
cstate->copy_dest = COPY_NEW_FE;
cstate->fe_msgbuf = makeStringInfo();
RESUME_CANCEL_INTERRUPTS();
switch (mtype)
{
- case 'd': /* CopyData */
+ case 'd': /* CopyData */
break;
- case 'c': /* CopyDone */
+ case 'c': /* CopyDone */
/* COPY IN correctly terminated by frontend */
cstate->fe_eof = true;
return bytesread;
- case 'f': /* CopyFail */
+ case 'f': /* CopyFail */
ereport(ERROR,
(errcode(ERRCODE_QUERY_CANCELED),
errmsg("COPY from stdin failed: %s",
pq_getmsgstring(cstate->fe_msgbuf))));
break;
- case 'H': /* Flush */
- case 'S': /* Sync */
+ case 'H': /* Flush */
+ case 'S': /* Sync */
/*
* Ignore Flush/Sync for the convenience of client
/* See Multibyte encoding comment above */
cstate->encoding_embeds_ascii = PG_ENCODING_IS_CLIENT_ONLY(cstate->file_encoding);
- cstate->copy_dest = COPY_FILE; /* default */
+ cstate->copy_dest = COPY_FILE; /* default */
MemoryContextSwitchTo(oldcontext);
tupDesc = cstate->queryDesc->tupDesc;
attr = tupDesc->attrs;
num_phys_attrs = tupDesc->natts;
- cstate->null_print_client = cstate->null_print; /* default */
+ cstate->null_print_client = cstate->null_print; /* default */
/* We use fe_msgbuf as a per-row buffer regardless of copy_dest */
cstate->fe_msgbuf = makeStringInfo();
if (c == '\n')
{
- raw_buf_ptr++; /* eat newline */
- cstate->eol_type = EOL_CRNL; /* in case not set yet */
+ raw_buf_ptr++; /* eat newline */
+ cstate->eol_type = EOL_CRNL; /* in case not set yet */
}
else
{
break;
/* All ASCII control chars are length 1 */
ptr++;
- continue; /* fall to end of loop */
+ continue; /* fall to end of loop */
}
/* if we get here, we need to convert the control char */
DUMPSOFAR();
break;
/* All ASCII control chars are length 1 */
ptr++;
- continue; /* fall to end of loop */
+ continue; /* fall to end of loop */
}
/* if we get here, we need to convert the control char */
DUMPSOFAR();
* won't change underneath us.
*/
if (!dbtemplate)
- dbtemplate = "template1"; /* Default template database name */
+ dbtemplate = "template1"; /* Default template database name */
if (!get_db_info(dbtemplate, ShareLock,
&src_dboid, &src_owner, &src_encoding,
sysscan = systable_beginscan(pgdbrel, DatabaseNameIndexId, true,
NULL, 1, &scankey);
oldtuple = systable_getnext(sysscan);
- if (!HeapTupleIsValid(oldtuple)) /* shouldn't happen... */
+ if (!HeapTupleIsValid(oldtuple)) /* shouldn't happen... */
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_DATABASE),
errmsg("database \"%s\" does not exist", dbname)));
bool in_sql_drop;
/* table_rewrite */
- Oid table_rewrite_oid; /* InvalidOid, or set for
- * table_rewrite event */
+ Oid table_rewrite_oid; /* InvalidOid, or set for table_rewrite
+ * event */
int table_rewrite_reason; /* AT_REWRITE reason */
/* Support for command collection */
/* working state for Dijkstra's algorithm: */
bool distance_known; /* is distance from start known yet? */
int distance; /* current worst-case distance estimate */
- struct ExtensionVersionInfo *previous; /* current best predecessor */
+ struct ExtensionVersionInfo *previous; /* current best predecessor */
} ExtensionVersionInfo;
/* Local functions */
extTup = systable_getnext(extScan);
- if (!HeapTupleIsValid(extTup)) /* should not happen */
+ if (!HeapTupleIsValid(extTup)) /* should not happen */
elog(ERROR, "could not find tuple for extension %u",
CurrentExtensionObject);
{
if (arrayData[i] == tableoid)
{
- arrayIndex = i + 1; /* replace this element instead */
+ arrayIndex = i + 1; /* replace this element instead */
break;
}
}
extTup = systable_getnext(extScan);
- if (!HeapTupleIsValid(extTup)) /* should not happen */
+ if (!HeapTupleIsValid(extTup)) /* should not happen */
elog(ERROR, "could not find tuple for extension %u",
extensionoid);
extTup = systable_getnext(extScan);
- if (!HeapTupleIsValid(extTup)) /* should not happen */
+ if (!HeapTupleIsValid(extTup)) /* should not happen */
elog(ERROR, "could not find tuple for extension %u",
extensionOid);
dep.objectId = pg_depend->objid;
dep.objectSubId = pg_depend->objsubid;
- if (dep.objectSubId != 0) /* should not happen */
+ if (dep.objectSubId != 0) /* should not happen */
elog(ERROR, "extension should not have a sub-object dependency");
/* Relocate the object */
ListCell *x;
int i;
- *variadicArgType = InvalidOid; /* default result */
+ *variadicArgType = InvalidOid; /* default result */
*requiredResultType = InvalidOid; /* default result */
inTypes = (Oid *) palloc(parameterCount * sizeof(Oid));
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("parameter \"parallel\" must be SAFE, RESTRICTED, or UNSAFE")));
- return PROPARALLEL_UNSAFE; /* keep compiler quiet */
+ return PROPARALLEL_UNSAFE; /* keep compiler quiet */
}
}
languageValidator,
prosrc_str, /* converted to text later */
probin_str, /* converted to text later */
- false, /* not an aggregate */
+ false, /* not an aggregate */
isWindowFunc,
security,
isLeakProof,
relation = heap_open(AggregateRelationId, RowExclusiveLock);
tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcOid));
- if (!HeapTupleIsValid(tup)) /* should not happen */
+ if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for pg_aggregate tuple for function %u", funcOid);
CatalogTupleDelete(relation, &tup->t_self);
elog(ERROR, "cache lookup failed for function %u", funcOid);
procForm = (Form_pg_proc) GETSTRUCT(tup);
- if (procForm->prorettype != OPAQUEOID) /* caller messed up */
+ if (procForm->prorettype != OPAQUEOID) /* caller messed up */
elog(ERROR, "function %u doesn't return OPAQUE", funcOid);
/* okay to overwrite copied tuple */
else
{
elog(ERROR, "unknown constraint type");
- constraint_type = NULL; /* keep compiler quiet */
+ constraint_type = NULL; /* keep compiler quiet */
}
ereport(DEBUG1,
newer_snapshots[k]))
break;
}
- if (k >= n_newer_snapshots) /* not there anymore */
+ if (k >= n_newer_snapshots) /* not there anymore */
SetInvalidVirtualTransactionId(old_snapshots[j]);
}
pfree(newer_snapshots);
/* Get the preliminary name from the IndexElem */
if (ielem->indexcolname)
- origname = ielem->indexcolname; /* caller-specified name */
+ origname = ielem->indexcolname; /* caller-specified name */
else if (ielem->name)
- origname = ielem->name; /* simple column reference */
+ origname = ielem->name; /* simple column reference */
else
origname = "expr"; /* default name for expression */
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("operator argument types must be specified in ALTER OPERATOR FAMILY")));
- operOid = InvalidOid; /* keep compiler quiet */
+ operOid = InvalidOid; /* keep compiler quiet */
}
if (item->order_family)
char *oprName;
Oid oprNamespace;
AclResult aclresult;
- bool canMerge = false; /* operator merges */
+ bool canMerge = false; /* operator merges */
bool canHash = false; /* operator hashes */
- List *functionName = NIL; /* function for operator */
- TypeName *typeName1 = NULL; /* first type name */
- TypeName *typeName2 = NULL; /* second type name */
+ List *functionName = NIL; /* function for operator */
+ TypeName *typeName1 = NULL; /* first type name */
+ TypeName *typeName2 = NULL; /* second type name */
Oid typeId1 = InvalidOid; /* types converted to OID */
Oid typeId2 = InvalidOid;
Oid rettype;
List *commutatorName = NIL; /* optional commutator operator name */
- List *negatorName = NIL; /* optional negator operator name */
+ List *negatorName = NIL; /* optional negator operator name */
List *restrictionName = NIL; /* optional restrict. sel. procedure */
List *joinName = NIL; /* optional join sel. procedure */
Oid functionOid; /* functions converted to OID */
oprNamespace, /* namespace */
typeId1, /* left type id */
typeId2, /* right type id */
- functionOid, /* function for operator */
+ functionOid, /* function for operator */
commutatorName, /* optional commutator operator name */
- negatorName, /* optional negator operator name */
+ negatorName, /* optional negator operator name */
restrictionOid, /* optional restrict. sel. procedure */
joinOid, /* optional join sel. procedure name */
canMerge, /* operator merges */
/*
* Now shut down the inner executor.
*/
- portal->queryDesc = NULL; /* prevent double shutdown */
+ portal->queryDesc = NULL; /* prevent double shutdown */
ExecutorFinish(queryDesc);
ExecutorEnd(queryDesc);
FreeQueryDesc(queryDesc);
{
tmpAddr = ProcedureCreate(pltemplate->tmplinline,
PG_CATALOG_NAMESPACE,
- false, /* replace */
- false, /* returnsSet */
+ false, /* replace */
+ false, /* returnsSet */
VOIDOID,
BOOTSTRAP_SUPERUSERID,
ClanguageId,
F_FMGR_C_VALIDATOR,
pltemplate->tmplinline,
pltemplate->tmpllibrary,
- false, /* isAgg */
- false, /* isWindowFunc */
- false, /* security_definer */
- false, /* isLeakProof */
+ false, /* isAgg */
+ false, /* isWindowFunc */
+ false, /* security_definer */
+ false, /* isLeakProof */
true, /* isStrict */
PROVOLATILE_VOLATILE,
PROPARALLEL_UNSAFE,
{
tmpAddr = ProcedureCreate(pltemplate->tmplvalidator,
PG_CATALOG_NAMESPACE,
- false, /* replace */
- false, /* returnsSet */
+ false, /* replace */
+ false, /* returnsSet */
VOIDOID,
BOOTSTRAP_SUPERUSERID,
ClanguageId,
F_FMGR_C_VALIDATOR,
pltemplate->tmplvalidator,
pltemplate->tmpllibrary,
- false, /* isAgg */
- false, /* isWindowFunc */
- false, /* security_definer */
- false, /* isLeakProof */
+ false, /* isAgg */
+ false, /* isWindowFunc */
+ false, /* security_definer */
+ false, /* isLeakProof */
true, /* isStrict */
PROVOLATILE_VOLATILE,
PROPARALLEL_UNSAFE,
rel = heap_open(LanguageRelationId, RowExclusiveLock);
langTup = SearchSysCache1(LANGOID, ObjectIdGetDatum(langOid));
- if (!HeapTupleIsValid(langTup)) /* should not happen */
+ if (!HeapTupleIsValid(langTup)) /* should not happen */
elog(ERROR, "cache lookup failed for language %u", langOid);
CatalogTupleDelete(rel, &langTup->t_self);
*/
PreventCommandIfParallelMode("nextval()");
- if (elm->last != elm->cached) /* some numbers were cached */
+ if (elm->last != elm->cached) /* some numbers were cached */
{
Assert(elm->last_valid);
Assert(elm->increment != 0);
seqform->seqmax = PG_INT64_MAX;
}
else
- seqform->seqmax = -1; /* descending seq */
+ seqform->seqmax = -1; /* descending seq */
seqdataform->log_cnt = 0;
}
else if (isInit)
{
if (seqform->seqincrement > 0)
- seqform->seqstart = seqform->seqmin; /* ascending seq */
+ seqform->seqstart = seqform->seqmin; /* ascending seq */
else
- seqform->seqstart = seqform->seqmax; /* descending seq */
+ seqform->seqstart = seqform->seqmax; /* descending seq */
}
/* crosscheck START */
* a pass determined by subcommand type.
*/
-#define AT_PASS_UNSET -1 /* UNSET will cause ERROR */
-#define AT_PASS_DROP 0 /* DROP (all flavors) */
-#define AT_PASS_ALTER_TYPE 1 /* ALTER COLUMN TYPE */
-#define AT_PASS_OLD_INDEX 2 /* re-add existing indexes */
-#define AT_PASS_OLD_CONSTR 3 /* re-add existing constraints */
-#define AT_PASS_COL_ATTRS 4 /* set other column attributes */
+#define AT_PASS_UNSET -1 /* UNSET will cause ERROR */
+#define AT_PASS_DROP 0 /* DROP (all flavors) */
+#define AT_PASS_ALTER_TYPE 1 /* ALTER COLUMN TYPE */
+#define AT_PASS_OLD_INDEX 2 /* re-add existing indexes */
+#define AT_PASS_OLD_CONSTR 3 /* re-add existing constraints */
+#define AT_PASS_COL_ATTRS 4 /* set other column attributes */
/* We could support a RENAME COLUMN pass here, but not currently used */
-#define AT_PASS_ADD_COL 5 /* ADD COLUMN */
-#define AT_PASS_ADD_INDEX 6 /* ADD indexes */
-#define AT_PASS_ADD_CONSTR 7 /* ADD constraints, defaults */
-#define AT_PASS_MISC 8 /* other stuff */
+#define AT_PASS_ADD_COL 5 /* ADD COLUMN */
+#define AT_PASS_ADD_INDEX 6 /* ADD indexes */
+#define AT_PASS_ADD_CONSTR 7 /* ADD constraints, defaults */
+#define AT_PASS_MISC 8 /* other stuff */
#define AT_NUM_PASSES 9
typedef struct AlteredTableInfo
int rewrite; /* Reason for forced rewrite, if any */
Oid newTableSpace; /* new tablespace; 0 means no change */
bool chgPersistence; /* T if SET LOGGED/UNLOGGED is used */
- char newrelpersistence; /* if above is true */
+ char newrelpersistence; /* if above is true */
Expr *partition_constraint; /* for attach partition validation */
/* Objects to rebuild after completing ALTER TYPE operations */
List *changedConstraintOids; /* OIDs of constraints to rebuild */
List *changedConstraintDefs; /* string definitions of same */
- List *changedIndexOids; /* OIDs of indexes to rebuild */
- List *changedIndexDefs; /* string definitions of same */
+ List *changedIndexOids; /* OIDs of indexes to rebuild */
+ List *changedIndexDefs; /* string definitions of same */
} AlteredTableInfo;
/* Struct describing one new constraint to check in Phase 3 scan */
cooked = (CookedConstraint *) palloc(sizeof(CookedConstraint));
cooked->contype = CONSTR_DEFAULT;
- cooked->conoid = InvalidOid; /* until created */
+ cooked->conoid = InvalidOid; /* until created */
cooked->name = NULL;
cooked->attnum = attnum;
cooked->expr = colDef->cooked_default;
cooked->skip_validation = false;
cooked->is_local = true; /* not used for defaults */
- cooked->inhcount = 0; /* ditto */
+ cooked->inhcount = 0; /* ditto */
cooked->is_no_inherit = false;
cookedDefaults = lappend(cookedDefaults, cooked);
descriptor->attrs[attnum - 1]->atthasdef = true;
}
}
- Assert(rentry->kind != '\0'); /* Should be impossible */
+ Assert(rentry->kind != '\0'); /* Should be impossible */
}
/*
int parentsWithOids = 0;
bool have_bogus_defaults = false;
int child_attno;
- static Node bogus_marker = {0}; /* marks conflicting defaults */
+ static Node bogus_marker = {0}; /* marks conflicting defaults */
List *saved_schema = NIL;
/*
while (rest != NULL)
{
ColumnDef *restdef = lfirst(rest);
- ListCell *next = lnext(rest); /* need to save it in case we
- * delete it */
+ ListCell *next = lnext(rest); /* need to save it in case we
+ * delete it */
if (strcmp(coldef->colname, restdef->colname) == 0)
{
cooked = (CookedConstraint *) palloc(sizeof(CookedConstraint));
cooked->contype = CONSTR_CHECK;
- cooked->conoid = InvalidOid; /* until created */
+ cooked->conoid = InvalidOid; /* until created */
cooked->name = pstrdup(name);
cooked->attnum = 0; /* not used for constraints */
cooked->expr = expr;
heap_close(attrelation, RowExclusiveLock);
- relation_close(targetrelation, NoLock); /* close rel but keep lock */
+ relation_close(targetrelation, NoLock); /* close rel but keep lock */
return attnum;
}
attnum =
renameatt_internal(relid,
- stmt->subname, /* old att name */
- stmt->newname, /* new att name */
+ stmt->subname, /* old att name */
+ stmt->newname, /* new att name */
stmt->relation->inh, /* recursive? */
- false, /* recursing? */
+ false, /* recursing? */
0, /* expected inhcount */
stmt->behavior);
stmt->subname,
stmt->newname,
(stmt->relation &&
- stmt->relation->inh), /* recursive? */
- false, /* recursing? */
+ stmt->relation->inh), /* recursive? */
+ false, /* recursing? */
0 /* expected inhcount */ );
}
relrelation = heap_open(RelationRelationId, RowExclusiveLock);
reltup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(myrelid));
- if (!HeapTupleIsValid(reltup)) /* shouldn't happen */
+ if (!HeapTupleIsValid(reltup)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for relation %u", myrelid);
relform = (Form_pg_class) GETSTRUCT(reltup);
*/
case AT_AddColumn: /* may rewrite heap, in some cases and visible
* to SELECT */
- case AT_SetTableSpace: /* must rewrite heap */
+ case AT_SetTableSpace: /* must rewrite heap */
case AT_AlterColumnType: /* must rewrite heap */
case AT_AddOids: /* must rewrite heap */
cmd_lockmode = AccessExclusiveLock;
* Removing constraints can affect SELECTs that have been
* optimised assuming the constraint holds true.
*/
- case AT_DropConstraint: /* as DROP INDEX */
+ case AT_DropConstraint: /* as DROP INDEX */
case AT_DropNotNull: /* may change some SQL plans */
cmd_lockmode = AccessExclusiveLock;
break;
break;
case AT_AddConstraint:
- case AT_ProcessedConstraint: /* becomes AT_AddConstraint */
- case AT_AddConstraintRecurse: /* becomes AT_AddConstraint */
+ case AT_ProcessedConstraint: /* becomes AT_AddConstraint */
+ case AT_AddConstraintRecurse: /* becomes AT_AddConstraint */
case AT_ReAddConstraint: /* becomes AT_AddConstraint */
if (IsA(cmd->def, Constraint))
{
* applies: we don't currently allow concurrent catalog
* updates.
*/
- case AT_SetStatistics: /* Uses MVCC in getTableAttrs() */
+ case AT_SetStatistics: /* Uses MVCC in getTableAttrs() */
case AT_ClusterOn: /* Uses MVCC in getIndexes() */
case AT_DropCluster: /* Uses MVCC in getIndexes() */
case AT_SetOptions: /* Uses MVCC in getTableAttrs() */
- case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */
+ case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */
cmd_lockmode = ShareUpdateExclusiveLock;
break;
* reasons these can all be used with ALTER TABLE, so we can't
* decide between them using the basic grammar.
*/
- case AT_SetRelOptions: /* Uses MVCC in getIndexes() and
- * getTables() */
+ case AT_SetRelOptions: /* Uses MVCC in getIndexes() and
+ * getTables() */
case AT_ResetRelOptions: /* Uses MVCC in getIndexes() and
* getTables() */
cmd_lockmode = AlterTableGetRelOptionsLockLevel((List *) cmd->def);
cmd->subtype = AT_AddConstraintRecurse;
pass = AT_PASS_ADD_CONSTR;
break;
- case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */
+ case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */
ATSimplePermissions(rel, ATT_TABLE);
/* This command never recurses */
/* No command-specific prep needed */
break;
case AT_SetRelOptions: /* SET (...) */
case AT_ResetRelOptions: /* RESET (...) */
- case AT_ReplaceRelOptions: /* reset them all, then set just these */
+ case AT_ReplaceRelOptions: /* reset them all, then set just these */
ATSimplePermissions(rel, ATT_TABLE | ATT_VIEW | ATT_MATVIEW | ATT_INDEX);
/* This command never recurses */
/* No command-specific prep needed */
ATSimplePermissions(rel, ATT_TABLE);
pass = AT_PASS_MISC;
break;
- case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */
+ case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */
ATSimplePermissions(rel, ATT_TABLE | ATT_FOREIGN_TABLE);
/* Recursion occurs during execution phase */
/* No command-specific prep needed except saving recurse flag */
default: /* oops */
elog(ERROR, "unrecognized alter table type: %d",
(int) cmd->subtype);
- pass = AT_PASS_UNSET; /* keep compiler quiet */
+ pass = AT_PASS_UNSET; /* keep compiler quiet */
break;
}
Assert(pass > AT_PASS_UNSET);
cmd->behavior, false, false,
cmd->missing_ok, lockmode);
break;
- case AT_DropColumnRecurse: /* DROP COLUMN with recursion */
+ case AT_DropColumnRecurse: /* DROP COLUMN with recursion */
address = ATExecDropColumn(wqueue, rel, cmd->name,
cmd->behavior, true, false,
cmd->missing_ok, lockmode);
case AT_ReAddComment: /* Re-add existing comment */
address = CommentObject((CommentStmt *) cmd->def);
break;
- case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */
+ case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */
address = ATExecAddIndexConstraint(tab, rel, (IndexStmt *) cmd->def,
lockmode);
break;
case AT_AlterConstraint: /* ALTER CONSTRAINT */
address = ATExecAlterConstraint(rel, cmd, false, false, lockmode);
break;
- case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */
+ case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */
address = ATExecValidateConstraint(rel, cmd->name, false, false,
lockmode);
break;
- case AT_ValidateConstraintRecurse: /* VALIDATE CONSTRAINT with
- * recursion */
+ case AT_ValidateConstraintRecurse: /* VALIDATE CONSTRAINT with
+ * recursion */
address = ATExecValidateConstraint(rel, cmd->name, true, false,
lockmode);
break;
case AT_AlterColumnType: /* ALTER COLUMN TYPE */
address = ATExecAlterColumnType(tab, rel, cmd, lockmode);
break;
- case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */
+ case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */
address =
ATExecAlterColumnGenericOptions(rel, cmd->name,
(List *) cmd->def, lockmode);
break;
case AT_SetRelOptions: /* SET (...) */
case AT_ResetRelOptions: /* RESET (...) */
- case AT_ReplaceRelOptions: /* replace entire option list */
+ case AT_ReplaceRelOptions: /* replace entire option list */
ATExecSetRelOptions(rel, (List *) cmd->def, cmd->subtype, lockmode);
break;
case AT_EnableTrig: /* ENABLE TRIGGER name */
ATExecEnableDisableTrigger(rel, cmd->name,
TRIGGER_FIRES_ON_ORIGIN, false, lockmode);
break;
- case AT_EnableAlwaysTrig: /* ENABLE ALWAYS TRIGGER name */
+ case AT_EnableAlwaysTrig: /* ENABLE ALWAYS TRIGGER name */
ATExecEnableDisableTrigger(rel, cmd->name,
TRIGGER_FIRES_ALWAYS, false, lockmode);
break;
- case AT_EnableReplicaTrig: /* ENABLE REPLICA TRIGGER name */
+ case AT_EnableReplicaTrig: /* ENABLE REPLICA TRIGGER name */
ATExecEnableDisableTrigger(rel, cmd->name,
TRIGGER_FIRES_ON_REPLICA, false, lockmode);
break;
ATExecEnableDisableRule(rel, cmd->name,
RULE_FIRES_ON_ORIGIN, lockmode);
break;
- case AT_EnableAlwaysRule: /* ENABLE ALWAYS RULE name */
+ case AT_EnableAlwaysRule: /* ENABLE ALWAYS RULE name */
ATExecEnableDisableRule(rel, cmd->name,
RULE_FIRES_ALWAYS, lockmode);
break;
- case AT_EnableReplicaRule: /* ENABLE REPLICA RULE name */
+ case AT_EnableReplicaRule: /* ENABLE REPLICA RULE name */
ATExecEnableDisableRule(rel, cmd->name,
RULE_FIRES_ON_REPLICA, lockmode);
break;
*/
oldrel = heap_open(tab->relid, NoLock);
oldTupDesc = tab->oldDesc;
- newTupDesc = RelationGetDescr(oldrel); /* includes all mods */
+ newTupDesc = RelationGetDescr(oldrel); /* includes all mods */
if (OidIsValid(OIDNewHeap))
newrel = heap_open(OIDNewHeap, lockmode);
CheckTableNotInUse(childrel, "ALTER TABLE");
tuple = SearchSysCacheCopyAttName(childrelid, colName);
- if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
+ if (!HeapTupleIsValid(tuple)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute \"%s\" of relation %u",
colName, childrelid);
childatt = (Form_pg_attribute) GETSTRUCT(tuple);
- if (childatt->attinhcount <= 0) /* shouldn't happen */
+ if (childatt->attinhcount <= 0) /* shouldn't happen */
elog(ERROR, "relation %u has non-inherited attribute \"%s\"",
childrelid, colName);
stmt->deferrable,
stmt->initdeferred,
stmt->primary,
- true, /* update pg_index */
- true, /* remove old dependencies */
+ true, /* update pg_index */
+ true, /* remove old dependencies */
allowSystemTableMods,
false); /* is_internal */
newcons = AddRelationNewConstraints(rel, NIL,
list_make1(copyObject(constr)),
recursing | is_readd, /* allow_merge */
- !recursing, /* is_local */
- is_readd); /* is_internal */
+ !recursing, /* is_local */
+ is_readd); /* is_internal */
/* we don't expect more than one constraint here */
Assert(list_length(newcons) <= 1);
RelationGetRelid(rel),
fkattnum,
numfks,
- InvalidOid, /* not a domain
- * constraint */
+ InvalidOid, /* not a domain constraint */
indexOid,
RelationGetRelid(pkrel),
pkattnum,
fkconstraint->fk_upd_action,
fkconstraint->fk_del_action,
fkconstraint->fk_matchtype,
- NULL, /* no exclusion constraint */
- NULL, /* no check constraint */
+ NULL, /* no exclusion constraint */
+ NULL, /* no check constraint */
NULL,
NULL,
- true, /* islocal */
- 0, /* inhcount */
- true, /* isnoinherit */
+ true, /* islocal */
+ 0, /* inhcount */
+ true, /* isnoinherit */
false); /* is_internal */
ObjectAddressSet(address, ConstraintRelationId, constrOid);
con = (Form_pg_constraint) GETSTRUCT(copy_tuple);
- if (con->coninhcount <= 0) /* shouldn't happen */
+ if (con->coninhcount <= 0) /* shouldn't happen */
elog(ERROR, "relation %u has non-inherited constraint \"%s\"",
childrelid, constrName);
/* Look up the target column */
heapTup = SearchSysCacheCopyAttName(RelationGetRelid(rel), colName);
- if (!HeapTupleIsValid(heapTup)) /* shouldn't happen */
+ if (!HeapTupleIsValid(heapTup)) /* shouldn't happen */
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("column \"%s\" of relation \"%s\" does not exist",
defaultexpr = build_column_default(rel, attnum);
Assert(defaultexpr);
defaultexpr = strip_implicit_coercions(defaultexpr);
- defaultexpr = coerce_to_target_type(NULL, /* no UNKNOWN params */
+ defaultexpr = coerce_to_target_type(NULL, /* no UNKNOWN params */
defaultexpr, exprType(defaultexpr),
targettype, targettypmod,
COERCION_ASSIGNMENT,
bool conislocal;
tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(oldId));
- if (!HeapTupleIsValid(tup)) /* should not happen */
+ if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for constraint %u", oldId);
con = (Form_pg_constraint) GETSTRUCT(tup);
relid = con->conrelid;
HeapTuple copyTuple = heap_copytuple(constraintTuple);
Form_pg_constraint copy_con = (Form_pg_constraint) GETSTRUCT(copyTuple);
- if (copy_con->coninhcount <= 0) /* shouldn't happen */
+ if (copy_con->coninhcount <= 0) /* shouldn't happen */
elog(ERROR, "relation %u has non-inherited constraint \"%s\"",
RelationGetRelid(child_rel), NameStr(copy_con->conname));
if (oids_to_truncate != NIL)
{
heap_truncate(oids_to_truncate);
- CommandCounterIncrement(); /* XXX needed? */
+ CommandCounterIncrement(); /* XXX needed? */
}
}
return;
tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relId));
- if (!HeapTupleIsValid(tuple)) /* should not happen */
+ if (!HeapTupleIsValid(tuple)) /* should not happen */
elog(ERROR, "cache lookup failed for relation %u", relId);
if (!pg_class_ownercheck(relId, GetUserId()))
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("tablespaces are not supported on this platform")));
return InvalidOid; /* keep compiler quiet */
-#endif /* HAVE_SYMLINK */
+#endif /* HAVE_SYMLINK */
}
/*
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("tablespaces are not supported on this platform")));
-#endif /* HAVE_SYMLINK */
+#endif /* HAVE_SYMLINK */
}
stmt->initdeferred,
true,
RelationGetRelid(rel),
- NULL, /* no conkey */
+ NULL, /* no conkey */
0,
- InvalidOid, /* no domain */
- InvalidOid, /* no index */
- InvalidOid, /* no foreign key */
+ InvalidOid, /* no domain */
+ InvalidOid, /* no index */
+ InvalidOid, /* no foreign key */
NULL,
NULL,
NULL,
' ',
' ',
' ',
- NULL, /* no exclusion */
- NULL, /* no check constraint */
+ NULL, /* no exclusion */
+ NULL, /* no check constraint */
NULL,
NULL,
- true, /* islocal */
- 0, /* inhcount */
- true, /* isnoinherit */
- isInternal); /* is_internal */
+ true, /* islocal */
+ 0, /* inhcount */
+ true, /* isnoinherit */
+ isInternal); /* is_internal */
}
/*
return false;
return true;
}
-#endif /* NOT_USED */
+#endif /* NOT_USED */
/*
* Call a trigger function.
*/
typedef uint32 TriggerFlags;
-#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order
- * bits */
+#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order bits */
#define AFTER_TRIGGER_DONE 0x10000000
#define AFTER_TRIGGER_IN_PROGRESS 0x20000000
/* bits describing the size and tuple sources of this event */
*/
typedef struct AfterTriggerEventChunk
{
- struct AfterTriggerEventChunk *next; /* list link */
+ struct AfterTriggerEventChunk *next; /* list link */
char *freeptr; /* start of free space in chunk */
char *endfree; /* end of free space in chunk */
char *endptr; /* end of chunk */
{
CommandId firing_counter; /* next firing ID to assign */
SetConstraintState state; /* the active S C state */
- AfterTriggerEventList events; /* deferred-event list */
+ AfterTriggerEventList events; /* deferred-event list */
int query_depth; /* current query list index */
AfterTriggerEventList *query_stack; /* events pending from each query */
Tuplestorestate **fdw_tuplestores; /* foreign tuples for one row from
/* these fields are just for resetting at subtrans abort: */
SetConstraintState *state_stack; /* stacked S C states */
- AfterTriggerEventList *events_stack; /* stacked list pointers */
+ AfterTriggerEventList *events_stack; /* stacked list pointers */
int *depth_stack; /* stacked query_depths */
CommandId *firing_stack; /* stacked firing_counters */
int maxtransdepth; /* allocated len of above arrays */
slot1 = MakeSingleTupleTableSlot(rel->rd_att);
slot2 = MakeSingleTupleTableSlot(rel->rd_att);
}
- if (trigdesc == NULL) /* should not happen */
+ if (trigdesc == NULL) /* should not happen */
elog(ERROR, "relation %u has no triggers",
evtshared->ats_relid);
}
/*
* Initialize after-trigger state structure to empty
*/
- afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */
+ afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */
afterTriggers.query_depth = -1;
/*
List *
deserialize_deflist(Datum txt)
{
- text *in = DatumGetTextPP(txt); /* in case it's toasted */
+ text *in = DatumGetTextPP(txt); /* in case it's toasted */
List *result = NIL;
int len = VARSIZE_ANY_EXHDR(in);
char *ptr,
} ds_state;
ds_state state = CS_WAITKEY;
- workspace = (char *) palloc(len + 1); /* certainly enough room */
+ workspace = (char *) palloc(len + 1); /* certainly enough room */
ptr = VARDATA_ANY(in);
endptr = ptr + len;
for (; ptr < endptr; ptr++)
address =
TypeCreate(InvalidOid, /* no predetermined type OID */
typeName, /* type name */
- typeNamespace, /* namespace */
+ typeNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */
- internalLength, /* internal size */
+ internalLength, /* internal size */
TYPTYPE_BASE, /* type-type (base type) */
category, /* type-category */
preferred, /* is it a preferred type? */
GetUserId(), /* owner's ID */
-1, /* internal size (always varlena) */
TYPTYPE_BASE, /* type-type (base type) */
- TYPCATEGORY_ARRAY, /* type-category (array) */
+ TYPCATEGORY_ARRAY, /* type-category (array) */
false, /* array types are never preferred */
delimiter, /* array element delimiter */
F_ARRAY_IN, /* input procedure */
F_ARRAY_SEND, /* send procedure */
typmodinOid, /* typmodin procedure */
typmodoutOid, /* typmodout procedure */
- F_ARRAY_TYPANALYZE, /* analyze procedure */
+ F_ARRAY_TYPANALYZE, /* analyze procedure */
typoid, /* element type ID */
true, /* yes this is an array type */
InvalidOid, /* no further array type */
address =
TypeCreate(InvalidOid, /* no predetermined type OID */
domainName, /* type name */
- domainNamespace, /* namespace */
+ domainNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */
- internalLength, /* internal size */
- TYPTYPE_DOMAIN, /* type-type (domain type) */
+ internalLength, /* internal size */
+ TYPTYPE_DOMAIN, /* type-type (domain type) */
category, /* type-category */
false, /* domain types are never preferred */
delimiter, /* array element delimiter */
- inputProcedure, /* input procedure */
- outputProcedure, /* output procedure */
+ inputProcedure, /* input procedure */
+ outputProcedure, /* output procedure */
receiveProcedure, /* receive procedure */
- sendProcedure, /* send procedure */
+ sendProcedure, /* send procedure */
InvalidOid, /* typmodin procedure - none */
InvalidOid, /* typmodout procedure - none */
analyzeProcedure, /* analyze procedure */
InvalidOid, /* no arrays for domains (yet) */
basetypeoid, /* base type ID */
defaultValue, /* default type value (text) */
- defaultValueBin, /* default type value (binary) */
+ defaultValueBin, /* default type value (binary) */
byValue, /* passed by value */
alignment, /* required alignment */
storage, /* TOAST strategy */
enumTypeAddr =
TypeCreate(InvalidOid, /* no predetermined type OID */
enumName, /* type name */
- enumNamespace, /* namespace */
+ enumNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */
GetUserId(), /* owner's ID */
-1, /* internal size (always varlena) */
TYPTYPE_BASE, /* type-type (base type) */
- TYPCATEGORY_ARRAY, /* type-category (array) */
+ TYPCATEGORY_ARRAY, /* type-category (array) */
false, /* array types are never preferred */
DEFAULT_TYPDELIM, /* array element delimiter */
F_ARRAY_IN, /* input procedure */
F_ARRAY_SEND, /* send procedure */
InvalidOid, /* typmodin procedure - none */
InvalidOid, /* typmodout procedure - none */
- F_ARRAY_TYPANALYZE, /* analyze procedure */
+ F_ARRAY_TYPANALYZE, /* analyze procedure */
enumTypeAddr.objectId, /* element type ID */
true, /* yes this is an array type */
InvalidOid, /* no further array type */
address =
TypeCreate(InvalidOid, /* no predetermined type OID */
typeName, /* type name */
- typeNamespace, /* namespace */
+ typeNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */
-1, /* internal size (always varlena) */
- TYPTYPE_RANGE, /* type-type (range type) */
+ TYPTYPE_RANGE, /* type-type (range type) */
TYPCATEGORY_RANGE, /* type-category (range type) */
false, /* range types are never preferred */
DEFAULT_TYPDELIM, /* array element delimiter */
F_RANGE_TYPANALYZE, /* analyze procedure */
InvalidOid, /* element type ID - none */
false, /* this is not an array type */
- rangeArrayOid, /* array type we are about to create */
+ rangeArrayOid, /* array type we are about to create */
InvalidOid, /* base type ID (only for domains) */
NULL, /* never a default type value */
NULL, /* no binary form available either */
GetUserId(), /* owner's ID */
-1, /* internal size (always varlena) */
TYPTYPE_BASE, /* type-type (base type) */
- TYPCATEGORY_ARRAY, /* type-category (array) */
+ TYPCATEGORY_ARRAY, /* type-category (array) */
false, /* array types are never preferred */
DEFAULT_TYPDELIM, /* array element delimiter */
F_ARRAY_IN, /* input procedure */
F_ARRAY_SEND, /* send procedure */
InvalidOid, /* typmodin procedure - none */
InvalidOid, /* typmodout procedure - none */
- F_ARRAY_TYPANALYZE, /* analyze procedure */
+ F_ARRAY_TYPANALYZE, /* analyze procedure */
typoid, /* element type ID */
true, /* yes this is an array type */
InvalidOid, /* no further array type */
pronargs[i]);
myself = ProcedureCreate(name, /* name: same as range type */
- namespace, /* namespace */
+ namespace, /* namespace */
false, /* replace */
false, /* returns set */
- rangeOid, /* return type */
+ rangeOid, /* return type */
BOOTSTRAP_SUPERUSERID, /* proowner */
INTERNALlanguageId, /* language */
- F_FMGR_INTERNAL_VALIDATOR, /* language validator */
- prosrc[i], /* prosrc */
+ F_FMGR_INTERNAL_VALIDATOR, /* language validator */
+ prosrc[i], /* prosrc */
NULL, /* probin */
false, /* isAgg */
false, /* isWindowFunc */
false, /* leakproof */
false, /* isStrict */
PROVOLATILE_IMMUTABLE, /* volatility */
- PROPARALLEL_SAFE, /* parallel safety */
- constructorArgTypesVector, /* parameterTypes */
+ PROPARALLEL_SAFE, /* parallel safety */
+ constructorArgTypesVector, /* parameterTypes */
PointerGetDatum(NULL), /* allParameterTypes */
PointerGetDatum(NULL), /* parameterModes */
PointerGetDatum(NULL), /* parameterNames */
ParseState *pstate;
Relation rel;
char *defaultValue;
- Node *defaultExpr = NULL; /* NULL if no default specified */
+ Node *defaultExpr = NULL; /* NULL if no default specified */
Datum new_record[Natts_pg_type];
bool new_record_nulls[Natts_pg_type];
bool new_record_repl[Natts_pg_type];
/* Rebuild dependencies */
GenerateTypeDependencies(typTup->typnamespace,
domainoid,
- InvalidOid, /* typrelid is n/a */
+ InvalidOid, /* typrelid is n/a */
0, /* relation kind is n/a */
typTup->typowner,
typTup->typinput,
typTup->typmodout,
typTup->typanalyze,
InvalidOid,
- false, /* a domain isn't an implicit array */
+ false, /* a domain isn't an implicit array */
typTup->typbasetype,
typTup->typcollation,
defaultExpr,
- true); /* Rebuild is true */
+ true); /* Rebuild is true */
InvokeObjectPostAlterHook(TypeRelationId, domainoid, 0);
false, /* Is Deferrable */
false, /* Is Deferred */
!constr->skip_validation, /* Is Validated */
- InvalidOid, /* not a relation constraint */
+ InvalidOid, /* not a relation constraint */
NULL,
0,
- domainOid, /* domain constraint */
- InvalidOid, /* no associated index */
- InvalidOid, /* Foreign key fields */
+ domainOid, /* domain constraint */
+ InvalidOid, /* no associated index */
+ InvalidOid, /* Foreign key fields */
NULL,
NULL,
NULL,
' ',
' ',
' ',
- NULL, /* not an exclusion constraint */
- expr, /* Tree form of check constraint */
+ NULL, /* not an exclusion constraint */
+ expr, /* Tree form of check constraint */
ccbin, /* Binary form of check constraint */
ccsrc, /* Source form of check constraint */
- true, /* is local */
+ true, /* is local */
0, /* inhcount */
false, /* connoinherit */
false); /* is_internal */
char *password = NULL; /* user password */
bool issuper = false; /* Make the user a superuser? */
bool inherit = true; /* Auto inherit privileges? */
- bool createrole = false; /* Can this user create roles? */
- bool createdb = false; /* Can the user create databases? */
- bool canlogin = false; /* Can this user login? */
+ bool createrole = false; /* Can this user create roles? */
+ bool createdb = false; /* Can the user create databases? */
+ bool canlogin = false; /* Can this user login? */
bool isreplication = false; /* Is this a replication role? */
- bool bypassrls = false; /* Is this a row security enabled
- * role? */
+ bool bypassrls = false; /* Is this a row security enabled role? */
int connlimit = -1; /* maximum connections allowed */
List *addroleto = NIL; /* roles to make this a member of */
- List *rolemembers = NIL; /* roles to be members of this role */
- List *adminmembers = NIL; /* roles to be admins of this role */
- char *validUntil = NULL; /* time the login is valid until */
- Datum validUntil_datum; /* same, as timestamptz Datum */
+ List *rolemembers = NIL; /* roles to be members of this role */
+ List *adminmembers = NIL; /* roles to be admins of this role */
+ char *validUntil = NULL; /* time the login is valid until */
+ Datum validUntil_datum; /* same, as timestamptz Datum */
bool validUntil_null;
DefElem *dpassword = NULL;
DefElem *dissuper = NULL;
int createrole = -1; /* Can this user create roles? */
int createdb = -1; /* Can the user create databases? */
int canlogin = -1; /* Can this user login? */
- int isreplication = -1; /* Is this a replication role? */
+ int isreplication = -1; /* Is this a replication role? */
int connlimit = -1; /* maximum connections allowed */
- List *rolemembers = NIL; /* roles to be added/removed */
- char *validUntil = NULL; /* time the login is valid until */
- Datum validUntil_datum; /* same, as timestamptz Datum */
+ List *rolemembers = NIL; /* roles to be added/removed */
+ char *validUntil = NULL; /* time the login is valid until */
+ Datum validUntil_datum; /* same, as timestamptz Datum */
bool validUntil_null;
int bypassrls = -1;
DefElem *dpassword = NULL;
* that the potential for improvement was great enough to merit the cost of
* supporting them.
*/
-#define VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL 20 /* ms */
-#define VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL 50 /* ms */
+#define VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL 20 /* ms */
+#define VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL 50 /* ms */
#define VACUUM_TRUNCATE_LOCK_TIMEOUT 5000 /* ms */
/*
BlockNumber old_rel_pages; /* previous value of pg_class.relpages */
BlockNumber rel_pages; /* total number of pages */
BlockNumber scanned_pages; /* number of pages we examined */
- BlockNumber pinskipped_pages; /* # of pages we skipped due to a pin */
+ BlockNumber pinskipped_pages; /* # of pages we skipped due to a pin */
BlockNumber frozenskipped_pages; /* # of frozen pages we skipped */
BlockNumber tupcount_pages; /* pages whose tuples we counted */
double scanned_tuples; /* counts only tuples on tupcount_pages */
* long as the CREATE command is consistent with that --- no explicit
* schema name.
*/
- view = copyObject(stmt->view); /* don't corrupt original command */
+ view = copyObject(stmt->view); /* don't corrupt original command */
if (view->relpersistence == RELPERSISTENCE_PERMANENT
&& isQueryUsingTempRelation(viewParse))
{
attnum = variable->varattno;
if (inputDesc == NULL)
- isSafeVar = true; /* can't check, just assume OK */
+ isSafeVar = true; /* can't check, just assume OK */
else if (attnum <= inputDesc->natts)
{
Form_pg_attribute attr = inputDesc->attrs[attnum - 1];
/* If WHEN result isn't true, jump to next CASE arm */
scratch.opcode = EEOP_JUMP_IF_NOT_TRUE;
- scratch.d.jump.jumpdone = -1; /* computed later */
+ scratch.d.jump.jumpdone = -1; /* computed later */
ExprEvalPushStep(state, &scratch);
whenstep = state->steps_len - 1;
/* Emit JUMP step to jump to end of CASE's code */
scratch.opcode = EEOP_JUMP;
- scratch.d.jump.jumpdone = -1; /* computed later */
+ scratch.d.jump.jumpdone = -1; /* computed later */
ExprEvalPushStep(state, &scratch);
/*
/* if it's not null, skip to end of COALESCE expr */
scratch.opcode = EEOP_JUMP_IF_NOT_NULL;
- scratch.d.jump.jumpdone = -1; /* adjust later */
+ scratch.d.jump.jumpdone = -1; /* adjust later */
ExprEvalPushStep(state, &scratch);
adjust_jumps = lappend_int(adjust_jumps,
*/
#ifdef HAVE_COMPUTED_GOTO
#define EEO_USE_COMPUTED_GOTO
-#endif /* HAVE_COMPUTED_GOTO */
+#endif /* HAVE_COMPUTED_GOTO */
/*
* Macros for opcode dispatch.
#define EEO_DISPATCH() goto starteval
#define EEO_OPCODE(opcode) (opcode)
-#endif /* EEO_USE_COMPUTED_GOTO */
+#endif /* EEO_USE_COMPUTED_GOTO */
#define EEO_NEXT() \
do { \
state->flags |= EEO_FLAG_DIRECT_THREADED;
}
-#endif /* EEO_USE_COMPUTED_GOTO */
+#endif /* EEO_USE_COMPUTED_GOTO */
state->evalfunc = ExecInterpExpr;
}
return PointerGetDatum(dispatch_table);
#else
Assert(state != NULL);
-#endif /* EEO_USE_COMPUTED_GOTO */
+#endif /* EEO_USE_COMPUTED_GOTO */
/* setup state */
op = state->steps;
TupleDesc slot_tupdesc = slot->tts_tupleDescriptor;
Form_pg_attribute attr;
- if (attnum > slot_tupdesc->natts) /* should never happen */
+ if (attnum > slot_tupdesc->natts) /* should never happen */
elog(ERROR, "attribute number %d exceeds number of columns %d",
attnum, slot_tupdesc->natts);
if (fieldnum <= 0) /* should never happen */
elog(ERROR, "unsupported reference to system column %d in FieldSelect",
fieldnum);
- if (fieldnum > tupDesc->natts) /* should never happen */
+ if (fieldnum > tupDesc->natts) /* should never happen */
elog(ERROR, "attribute number %d exceeds number of columns %d",
fieldnum, tupDesc->natts);
attr = tupDesc->attrs[fieldnum - 1];
index_insert(indexRelation, /* index relation */
values, /* array of index Datums */
isnull, /* null flags */
- tupleid, /* tid of heap tuple */
+ tupleid, /* tid of heap tuple */
heapRelation, /* heap relation */
checkUnique, /* type of uniqueness check to do */
indexInfo); /* index AM may need this */
break;
case LockWaitSkip:
if (!ConditionalXactLockTableWait(SnapshotDirty.xmax))
- return NULL; /* skip instead of waiting */
+ return NULL; /* skip instead of waiting */
break;
case LockWaitError:
if (!ConditionalXactLockTableWait(SnapshotDirty.xmax))
* --------------------------------
*/
void
-ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */
- TupleDesc tupdesc) /* new tuple descriptor */
+ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */
+ TupleDesc tupdesc) /* new tuple descriptor */
{
/* For safety, make sure slot is empty before changing it */
ExecClearTuple(slot);
* Initialize all fields of the Executor State structure
*/
estate->es_direction = ForwardScanDirection;
- estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */
+ estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */
estate->es_crosscheck_snapshot = InvalidSnapshot; /* no crosscheck */
estate->es_range_table = NIL;
estate->es_plannedstmt = NULL;
char *fname; /* function name (for error msgs) */
char *src; /* function body text (for error msgs) */
- SQLFunctionParseInfoPtr pinfo; /* data for parser callback hooks */
+ SQLFunctionParseInfoPtr pinfo; /* data for parser callback hooks */
Oid rettype; /* actual return type */
int16 typlen; /* length of the return type */
Anum_pg_proc_proargnames,
&isNull);
if (isNull)
- proargnames = PointerGetDatum(NULL); /* just to be sure */
+ proargnames = PointerGetDatum(NULL); /* just to be sure */
proargmodes = SysCacheGetAttr(PROCNAMEARGSNSP, procedureTuple,
Anum_pg_proc_proargmodes,
&isNull);
if (isNull)
- proargmodes = PointerGetDatum(NULL); /* just to be sure */
+ proargmodes = PointerGetDatum(NULL); /* just to be sure */
n_arg_names = get_func_input_arg_names(proargnames, proargmodes,
&pinfo->argnames);
if (IsPolymorphicType(rettype))
{
rettype = get_fn_expr_rettype(finfo);
- if (rettype == InvalidOid) /* this probably should not happen */
+ if (rettype == InvalidOid) /* this probably should not happen */
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("could not determine actual result type for function declared to return type %s",
AssertArg(!IsPolymorphicType(rettype));
if (modifyTargetList)
- *modifyTargetList = false; /* initialize for no change */
+ *modifyTargetList = false; /* initialize for no change */
if (junkFilter)
*junkFilter = NULL; /* initialize in case of VOID result */
InvalidOid,
sizeof(int32),
(Datum) 0,
- true, /* isnull */
+ true, /* isnull */
true /* byval */ );
newtlist = lappend(newtlist,
makeTargetEntry(null_expr,
FmgrInfo *eqfunctions; /* per-grouping-field equality fns */
int numCols; /* number of hash key columns */
int numhashGrpCols; /* number of columns in hash table */
- int largestGrpColIdx; /* largest col required for hashing */
- AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */
- AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */
+ int largestGrpColIdx; /* largest col required for hashing */
+ AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */
+ AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */
Agg *aggnode; /* original Agg node, for numGroups etc. */
} AggStatePerHashData;
firstSlot,
InvalidBuffer,
true);
- aggstate->grp_firstTuple = NULL; /* don't keep two
- * pointers */
+ aggstate->grp_firstTuple = NULL; /* don't keep two pointers */
/* set up for first advance_aggregates call */
tmpcontext->ecxt_outertuple = firstSlot;
node->prefetch_pages = 0;
node->prefetch_target = -1;
}
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
else
{
node->shared_prefetch_iterator =
tbm_attach_shared_iterate(dsa, pstate->prefetch_iterator);
}
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
node->initialized = true;
}
pstate->prefetch_target++;
SpinLockRelease(&pstate->mutex);
}
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
/*
tbm_shared_iterate(prefetch_iterator);
}
}
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
/*
pstate->prefetch_target++;
SpinLockRelease(&pstate->mutex);
}
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
/*
}
}
}
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
/*
if (node->biss_result)
{
tbm = node->biss_result;
- node->biss_result = NULL; /* reset for next time */
+ node->biss_result = NULL; /* reset for next time */
}
else
{
elog(ERROR, "unrecognized result from subplan");
if (result == NULL)
- result = subresult; /* first subplan */
+ result = subresult; /* first subplan */
else
{
tbm_union(result, subresult);
if (HeapTupleIsValid(tup))
{
- ExecStoreTuple(tup, /* tuple to store */
+ ExecStoreTuple(tup, /* tuple to store */
fslot, /* slot in which to store the tuple */
InvalidBuffer, /* buffer associated with this
* tuple */
ExecStoreTuple(tup, /* tuple to store */
gm_state->gm_slots[reader], /* slot in which to store the
* tuple */
- InvalidBuffer, /* buffer associated with this tuple */
+ InvalidBuffer, /* buffer associated with this tuple */
true); /* pfree this pointer if not from heap */
return true;
/* insert hashtable's tuple into exec slot */
inntuple = ExecStoreMinimalTuple(HJTUPLE_MINTUPLE(hashTuple),
hjstate->hj_HashTupleSlot,
- false); /* do not pfree */
+ false); /* do not pfree */
econtext->ecxt_innertuple = inntuple;
/*
econtext->ecxt_outertuple = slot;
if (ExecHashGetHashValue(hashtable, econtext,
hjstate->hj_OuterHashKeys,
- true, /* outer tuple */
+ true, /* outer tuple */
HJ_FILL_OUTER(hjstate),
hashvalue))
{
*/
ExecStoreTuple(tuple, /* tuple to store */
slot, /* slot to store in */
- scandesc->xs_cbuf, /* buffer containing tuple */
+ scandesc->xs_cbuf, /* buffer containing tuple */
false); /* don't pfree */
/*
*/
ExecStoreTuple(tuple, /* tuple to store */
slot, /* slot to store in */
- scandesc->xs_cbuf, /* buffer containing tuple */
+ scandesc->xs_cbuf, /* buffer containing tuple */
false); /* don't pfree */
/*
flags,
varattno, /* attribute number to scan */
op_strategy, /* op's strategy */
- op_righttype, /* strategy subtype */
+ op_righttype, /* strategy subtype */
((OpExpr *) clause)->inputcollid, /* collation */
opfuncid, /* reg proc to use */
scanvalue); /* constant */
*/
ScanKeyEntryInitialize(this_sub_key,
flags,
- varattno, /* attribute number */
- op_strategy, /* op's strategy */
+ varattno, /* attribute number */
+ op_strategy, /* op's strategy */
op_righttype, /* strategy subtype */
inputcollation, /* collation */
- opfuncid, /* reg proc to use */
- scanvalue); /* constant */
+ opfuncid, /* reg proc to use */
+ scanvalue); /* constant */
n_sub_key++;
}
flags,
varattno, /* attribute number to scan */
op_strategy, /* op's strategy */
- op_righttype, /* strategy subtype */
+ op_righttype, /* strategy subtype */
saop->inputcollid, /* collation */
opfuncid, /* reg proc to use */
scanvalue); /* constant */
ScanKeyEntryInitialize(this_scan_key,
flags,
varattno, /* attribute number to scan */
- InvalidStrategy, /* no strategy */
+ InvalidStrategy, /* no strategy */
InvalidOid, /* no strategy subtype */
InvalidOid, /* no collation */
InvalidOid, /* no reg proc for this */
break;
default:
elog(ERROR, "unsupported rowmark type");
- lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */
+ lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */
break;
}
&op_strategy,
&op_lefttype,
&op_righttype);
- if (op_strategy != BTEqualStrategyNumber) /* should not happen */
+ if (op_strategy != BTEqualStrategyNumber) /* should not happen */
elog(ERROR, "cannot merge using non-equality operator %u",
qual->opno);
*/
TupleTableSlot *result;
- node->mj_MatchedInner = true; /* do it only once */
+ node->mj_MatchedInner = true; /* do it only once */
result = MJFillInner(node);
if (result)
*/
TupleTableSlot *result;
- node->mj_MatchedOuter = true; /* do it only once */
+ node->mj_MatchedOuter = true; /* do it only once */
result = MJFillOuter(node);
if (result)
*/
TupleTableSlot *result;
- node->mj_MatchedOuter = true; /* do it only once */
+ node->mj_MatchedOuter = true; /* do it only once */
result = MJFillOuter(node);
if (result)
*/
TupleTableSlot *result;
- node->mj_MatchedInner = true; /* do it only once */
+ node->mj_MatchedInner = true; /* do it only once */
result = MJFillInner(node);
if (result)
*/
TupleTableSlot *result;
- node->mj_MatchedInner = true; /* do it only once */
+ node->mj_MatchedInner = true; /* do it only once */
result = MJFillInner(node);
if (result)
*/
TupleTableSlot *result;
- node->mj_MatchedOuter = true; /* do it only once */
+ node->mj_MatchedOuter = true; /* do it only once */
result = MJFillOuter(node);
if (result)
elog(ERROR, "ctid is NULL");
tupleid = (ItemPointer) DatumGetPointer(datum);
- tuple_ctid = *tupleid; /* be sure we don't free
- * ctid!! */
+ tuple_ctid = *tupleid; /* be sure we don't free ctid!! */
tupleid = &tuple_ctid;
}
root_rti = linitial_int(node->partitioned_rels);
root_oid = getrelid(root_rti, estate->es_range_table);
- rel = heap_open(root_oid, NoLock); /* locked by InitPlan */
+ rel = heap_open(root_oid, NoLock); /* locked by InitPlan */
}
else
rel = mtstate->resultRelInfo->ri_RelationDesc;
else
{
/* continue from previously returned page/tuple */
- blockno = scan->rs_cblock; /* current page */
+ blockno = scan->rs_cblock; /* current page */
}
/*
if (tuple)
ExecStoreTuple(tuple, /* tuple to store */
slot, /* slot to store in */
- scandesc->rs_cbuf, /* buffer associated with this
- * tuple */
+ scandesc->rs_cbuf, /* buffer associated with this
+ * tuple */
false); /* don't pfree this pointer */
else
ExecClearTuple(slot);
resultTupleSlot,
InvalidBuffer,
true);
- setopstate->grp_firstTuple = NULL; /* don't keep two pointers */
+ setopstate->grp_firstTuple = NULL; /* don't keep two pointers */
/* Initialize working state for a new input tuple group */
initialize_counts(pergroup);
* pointers onto disk pages and were not created with palloc() and
* so should not be pfree()'d.
*/
- ExecStoreTuple(tuple, /* tuple to store */
+ ExecStoreTuple(tuple, /* tuple to store */
slot, /* slot to store in */
- buffer, /* buffer associated with tuple */
- false); /* don't pfree */
+ buffer, /* buffer associated with tuple */
+ false); /* don't pfree */
/*
* At this point we have an extra pin on the buffer, because
currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);
tidstate->ss.ss_currentRelation = currentRelation;
- tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */
+ tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */
/*
* get the scan type from the relation descriptor.
AclResult aclresult;
int i;
- if (wfunc->winref != node->winref) /* planner screwed up? */
+ if (wfunc->winref != node->winref) /* planner screwed up? */
elog(ERROR, "WindowFunc with winref %u assigned to WindowAgg with winref %u",
wfunc->winref, node->winref);
/* build expression trees using actual argument & result types */
build_aggregate_transfn_expr(inputTypes,
numArguments,
- 0, /* no ordered-set window functions yet */
+ 0, /* no ordered-set window functions yet */
false, /* no variadic window functions yet */
aggtranstype,
wfunc->inputcollid,
static _SPI_connection *_SPI_stack = NULL;
static _SPI_connection *_SPI_current = NULL;
-static int _SPI_stack_depth = 0; /* allocated size of _SPI_stack */
+static int _SPI_stack_depth = 0; /* allocated size of _SPI_stack */
static int _SPI_connected = -1; /* current stack index */
static Portal SPI_cursor_open_internal(const char *name, SPIPlanPtr plan,
_SPI_current->lastoid = InvalidOid;
_SPI_current->tuptable = NULL;
slist_init(&_SPI_current->tuptables);
- _SPI_current->procCxt = NULL; /* in case we fail to create 'em */
+ _SPI_current->procCxt = NULL; /* in case we fail to create 'em */
_SPI_current->execCxt = NULL;
_SPI_current->connectSubid = GetCurrentSubTransactionId();
_SPI_current->queryEnv = NULL;
{
int res;
- res = _SPI_begin_call(false); /* live in procedure memory */
+ res = _SPI_begin_call(false); /* live in procedure memory */
if (res < 0)
return res;
return NULL;
}
- SPI_result = _SPI_begin_call(false); /* don't change context */
+ SPI_result = _SPI_begin_call(false); /* don't change context */
if (SPI_result < 0)
return NULL;
plan->parserSetup,
plan->parserSetupArg,
plan->cursor_options,
- false); /* not fixed result */
+ false); /* not fixed result */
plancache_list = lappend(plancache_list, plansource);
}
if (enr == NULL || enr->md.name == NULL)
return SPI_ERROR_ARGUMENT;
- res = _SPI_begin_call(false); /* keep current memory context */
+ res = _SPI_begin_call(false); /* keep current memory context */
if (res < 0)
return res;
if (name == NULL)
return SPI_ERROR_ARGUMENT;
- res = _SPI_begin_call(false); /* keep current memory context */
+ res = _SPI_begin_call(false); /* keep current memory context */
if (res < 0)
return res;
int16 typlen; /* array element type's storage properties */
bool typbyval;
char typalign;
- TupleRemapInfo *element_remap; /* array element type's remap info */
+ TupleRemapInfo *element_remap; /* array element type's remap info */
} ArrayRemapInfo;
typedef struct RangeRemapInfo
int32 localtypmod;
/* If no fields of the record require remapping, these are NULL: */
TupleDesc tupledesc; /* copy of record's tupdesc */
- TupleRemapInfo **field_remap; /* each field's remap info */
+ TupleRemapInfo **field_remap; /* each field's remap info */
} RecordRemapInfo;
struct TupleRemapInfo
;
}
-#endif /* ILIST_DEBUG */
+#endif /* ILIST_DEBUG */
static char *pam_passwd = NULL; /* Workaround for Solaris 2.6 brokenness */
static Port *pam_port_cludge; /* Workaround for passing "Port *port" into
* pam_passwd_conv_proc */
-#endif /* USE_PAM */
+#endif /* USE_PAM */
/*----------------------------------------------------------------
#include <bsd_auth.h>
static int CheckBSDAuth(Port *port, char *user);
-#endif /* USE_BSD_AUTH */
+#endif /* USE_BSD_AUTH */
/*----------------------------------------------------------------
#endif
static int CheckLDAPAuth(Port *port);
-#endif /* USE_LDAP */
+#endif /* USE_LDAP */
/*----------------------------------------------------------------
* Cert authentication
#endif
static int pg_GSS_recvauth(Port *port);
-#endif /* ENABLE_GSS */
+#endif /* ENABLE_GSS */
/*----------------------------------------------------------------
status = CheckPAMAuth(port, port->user_name, "");
#else
Assert(false);
-#endif /* USE_PAM */
+#endif /* USE_PAM */
break;
case uaBSD:
status = CheckBSDAuth(port, port->user_name);
#else
Assert(false);
-#endif /* USE_BSD_AUTH */
+#endif /* USE_BSD_AUTH */
break;
case uaLDAP:
}
initStringInfo(&buf);
- if (pq_getmessage(&buf, 1000)) /* receive password */
+ if (pq_getmessage(&buf, 1000)) /* receive password */
{
/* EOF - pq_getmessage already logged a suitable message */
pfree(buf.data);
return ret;
}
-#endif /* ENABLE_GSS */
+#endif /* ENABLE_GSS */
/*----------------------------------------------------------------
pfree(upname);
return STATUS_OK;
}
-#endif /* ENABLE_SSPI */
+#endif /* ENABLE_SSPI */
interpret_ident_response(const char *ident_response,
char *ident_user)
{
- const char *cursor = ident_response; /* Cursor into *ident_response */
+ const char *cursor = ident_response; /* Cursor into *ident_response */
/*
* Ident's response, in the telnet tradition, should end in crlf (\r\n).
{
int i; /* Index into *ident_user */
- cursor++; /* Go over colon */
+ cursor++; /* Go over colon */
while (pg_isblank(*cursor))
cursor++; /* skip blanks */
/* Rest of line is user name. Copy it over. */
const SockAddr remote_addr = port->raddr;
const SockAddr local_addr = port->laddr;
char ident_user[IDENT_USERNAME_MAX + 1];
- pgsocket sock_fd = PGINVALID_SOCKET; /* for talking to Ident server */
+ pgsocket sock_fd = PGINVALID_SOCKET; /* for talking to Ident server */
int rc; /* Return code from a locally called function */
bool ident_return;
char remote_addr_s[NI_MAXHOST];
return check_usermap(port->hba->usermap, port->user_name, ident_user, false);
}
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
/*----------------------------------------------------------------
* later used inside the PAM conversation to pass the password to the
* authentication module.
*/
- pam_passw_conv.appdata_ptr = (char *) password; /* from password above,
- * not allocated */
+ pam_passw_conv.appdata_ptr = (char *) password; /* from password above,
+ * not allocated */
/* Optionally, one can set the service name in pg_hba.conf */
if (port->hba->pamservice && port->hba->pamservice[0] != '\0')
return (retval == PAM_SUCCESS ? STATUS_OK : STATUS_ERROR);
}
-#endif /* USE_PAM */
+#endif /* USE_PAM */
/*----------------------------------------------------------------
return STATUS_OK;
}
-#endif /* USE_BSD_AUTH */
+#endif /* USE_BSD_AUTH */
/*----------------------------------------------------------------
return STATUS_OK;
}
-#endif /* USE_LDAP */
+#endif /* USE_LDAP */
/*----------------------------------------------------------------
memcpy(cryptvector + 4, packet->vector, RADIUS_VECTOR_LENGTH); /* request
* authenticator, from
* original packet */
- if (packetlength > RADIUS_HEADER_LENGTH) /* there may be no
- * attributes at all */
+ if (packetlength > RADIUS_HEADER_LENGTH) /* there may be no
+ * attributes at all */
memcpy(cryptvector + RADIUS_HEADER_LENGTH, receive_buffer + RADIUS_HEADER_LENGTH, packetlength - RADIUS_HEADER_LENGTH);
memcpy(cryptvector + packetlength, secret, strlen(secret));
if (loSize > offset)
{
if (nbytes >= 0 && nbytes <= loSize - offset)
- result_length = nbytes; /* request is wholly inside LO */
+ result_length = nbytes; /* request is wholly inside LO */
else
result_length = loSize - offset; /* adjust to end of LO */
}
return true;
}
-#endif /* HAVE_IPV6 */
+#endif /* HAVE_IPV6 */
/*
* Check whether host name matches pattern.
*err_msg = "hostssl record cannot match because SSL is not supported by this build";
#endif
}
- else if (token->string[4] == 'n') /* "hostnossl" */
+ else if (token->string[4] == 'n') /* "hostnossl" */
{
parsedline->conntype = ctHostNoSSL;
}
hbaline->ldapbasedn = pstrdup(urldata->lud_dn);
if (urldata->lud_attrs)
- hbaline->ldapsearchattribute = pstrdup(urldata->lud_attrs[0]); /* only use first one */
+ hbaline->ldapsearchattribute = pstrdup(urldata->lud_attrs[0]); /* only use first one */
hbaline->ldapscope = urldata->lud_scope;
if (urldata->lud_filter)
{
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("LDAP URLs not supported on this platform")));
*err_msg = "LDAP URLs not supported on this platform";
-#endif /* not OpenLDAP */
+#endif /* not OpenLDAP */
}
else if (strcmp(name, "ldaptls") == 0)
{
return 1;
}
-#endif /* HAVE_IPV6 */
+#endif /* HAVE_IPV6 */
/*
* pg_sockaddr_cidr_mask - make a network mask of the appropriate family
#define _SIZEOF_ADDR_IFREQ(ifr) \
sizeof (struct ifreq)
#endif
-#endif /* !_SIZEOF_ADDR_IFREQ */
+#endif /* !_SIZEOF_ADDR_IFREQ */
/*
* Enumerate the system's network interface addresses and call the callback
return 0;
}
-#endif /* !defined(SIOCGIFCONF) */
+#endif /* !defined(SIOCGIFCONF) */
-#endif /* !HAVE_GETIFADDRS */
+#endif /* !HAVE_GETIFADDRS */
#ifdef HAVE_UNIX_SOCKETS
static int Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath);
static int Setup_AF_UNIX(char *sock_path);
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
static PQcommMethods PqCommSocketMethods = {
socket_comm_reset,
if (MyProcPort->gss->cred != GSS_C_NO_CREDENTIAL)
gss_release_cred(&min_s, &MyProcPort->gss->cred);
-#endif /* ENABLE_GSS */
+#endif /* ENABLE_GSS */
/*
* GSS and SSPI share the port->gss struct. Since nowhere else does a
* BackendInitialize().
*/
free(MyProcPort->gss);
-#endif /* ENABLE_GSS || ENABLE_SSPI */
+#endif /* ENABLE_GSS || ENABLE_SSPI */
/*
* Cleanly shut down SSL layer. Nowhere else does a postmaster child
service = unixSocketPath;
}
else
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
{
snprintf(portNumberStr, sizeof(portNumberStr), "%d", portNumber);
service = portNumberStr;
}
return STATUS_OK;
}
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
/*
#else /* !HAVE_UTIME */
#ifdef HAVE_UTIMES
utimes(sock_path, NULL);
-#endif /* HAVE_UTIMES */
-#endif /* HAVE_UTIME */
+#endif /* HAVE_UTIMES */
+#endif /* HAVE_UTIME */
}
}
elog(LOG, "getsockopt(TCP_KEEPALIVE) failed: %m");
port->default_keepalives_idle = -1; /* don't know */
}
-#endif /* TCP_KEEPIDLE */
+#endif /* TCP_KEEPIDLE */
#else /* WIN32 */
/* We can't get the defaults on Windows, so return "don't know" */
port->default_keepalives_idle = -1;
-#endif /* WIN32 */
+#endif /* WIN32 */
}
return port->default_keepalives_idle;
if (pq_getkeepalivesidle(port) < 0)
{
if (idle == 0)
- return STATUS_OK; /* default is set but unknown */
+ return STATUS_OK; /* default is set but unknown */
else
return STATUS_ERROR;
}
&size) < 0)
{
elog(LOG, "getsockopt(TCP_KEEPINTVL) failed: %m");
- port->default_keepalives_interval = -1; /* don't know */
+ port->default_keepalives_interval = -1; /* don't know */
}
#else
/* We can't get the defaults on Windows, so return "don't know" */
port->default_keepalives_interval = -1;
-#endif /* WIN32 */
+#endif /* WIN32 */
}
return port->default_keepalives_interval;
if (pq_getkeepalivesinterval(port) < 0)
{
if (interval == 0)
- return STATUS_OK; /* default is set but unknown */
+ return STATUS_OK; /* default is set but unknown */
else
return STATUS_ERROR;
}
&size) < 0)
{
elog(LOG, "getsockopt(TCP_KEEPCNT) failed: %m");
- port->default_keepalives_count = -1; /* don't know */
+ port->default_keepalives_count = -1; /* don't know */
}
}
if (pq_getkeepalivescount(port) < 0)
{
if (count == 0)
- return STATUS_OK; /* default is set but unknown */
+ return STATUS_OK; /* default is set but unknown */
else
return STATUS_ERROR;
}
#endif
if (argc > 1 && strcmp(argv[1], "--boot") == 0)
- AuxiliaryProcessMain(argc, argv); /* does not return */
+ AuxiliaryProcessMain(argc, argv); /* does not return */
else if (argc > 1 && strcmp(argv[1], "--describe-config") == 0)
GucInfoMain(); /* does not return */
else if (argc > 1 && strcmp(argv[1], "--single") == 0)
NULL, /* no dbname */
strdup(get_user_name_or_exit(progname))); /* does not return */
else
- PostmasterMain(argc, argv); /* does not return */
+ PostmasterMain(argc, argv); /* does not return */
abort(); /* should not get here */
}
{
_set_FMA3_enable(0);
}
-#endif /* defined(_M_AMD64) && _MSC_VER == 1800 */
+#endif /* defined(_M_AMD64) && _MSC_VER == 1800 */
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
* Initialize dummy_spinlock, in case we are on a platform where we have
"more information on how to properly start the server.\n");
exit(1);
}
-#endif /* WIN32 */
+#endif /* WIN32 */
}
static bool
_equalAConst(const A_Const *a, const A_Const *b)
{
- if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
+ if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
return false;
COMPARE_LOCATION_FIELD(location);
}
#else
#define check_list_invariants(l)
-#endif /* USE_ASSERT_CHECKING */
+#endif /* USE_ASSERT_CHECKING */
/*
* Return a freshly allocated List. Since empty non-NIL lists are
funcexpr = makeNode(FuncExpr);
funcexpr->funcid = funcid;
funcexpr->funcresulttype = rettype;
- funcexpr->funcretset = false; /* only allowed case here */
- funcexpr->funcvariadic = false; /* only allowed case here */
+ funcexpr->funcretset = false; /* only allowed case here */
+ funcexpr->funcvariadic = false; /* only allowed case here */
funcexpr->funcformat = fformat;
funcexpr->funccollid = funccollid;
funcexpr->inputcollid = inputcollid;
((NullIfExpr *) expr)->opcollid = collation;
break;
case T_ScalarArrayOpExpr:
- Assert(!OidIsValid(collation)); /* result is always boolean */
+ Assert(!OidIsValid(collation)); /* result is always boolean */
break;
case T_BoolExpr:
- Assert(!OidIsValid(collation)); /* result is always boolean */
+ Assert(!OidIsValid(collation)); /* result is always boolean */
break;
case T_SubLink:
#ifdef USE_ASSERT_CHECKING
Assert(!OidIsValid(collation));
}
}
-#endif /* USE_ASSERT_CHECKING */
+#endif /* USE_ASSERT_CHECKING */
break;
case T_FieldSelect:
((FieldSelect *) expr)->resultcollid = collation;
break;
case T_FieldStore:
- Assert(!OidIsValid(collation)); /* result is always composite */
+ Assert(!OidIsValid(collation)); /* result is always composite */
break;
case T_RelabelType:
((RelabelType *) expr)->resultcollid = collation;
((ArrayCoerceExpr *) expr)->resultcollid = collation;
break;
case T_ConvertRowtypeExpr:
- Assert(!OidIsValid(collation)); /* result is always composite */
+ Assert(!OidIsValid(collation)); /* result is always composite */
break;
case T_CaseExpr:
((CaseExpr *) expr)->casecollid = collation;
((ArrayExpr *) expr)->array_collid = collation;
break;
case T_RowExpr:
- Assert(!OidIsValid(collation)); /* result is always composite */
+ Assert(!OidIsValid(collation)); /* result is always composite */
break;
case T_RowCompareExpr:
- Assert(!OidIsValid(collation)); /* result is always boolean */
+ Assert(!OidIsValid(collation)); /* result is always boolean */
break;
case T_CoalesceExpr:
((CoalesceExpr *) expr)->coalescecollid = collation;
((MinMaxExpr *) expr)->minmaxcollid = collation;
break;
case T_SQLValueFunction:
- Assert(!OidIsValid(collation)); /* no collatable results */
+ Assert(!OidIsValid(collation)); /* no collatable results */
break;
case T_XmlExpr:
Assert((((XmlExpr *) expr)->op == IS_XMLSERIALIZE) ?
(collation == InvalidOid));
break;
case T_NullTest:
- Assert(!OidIsValid(collation)); /* result is always boolean */
+ Assert(!OidIsValid(collation)); /* result is always boolean */
break;
case T_BooleanTest:
- Assert(!OidIsValid(collation)); /* result is always boolean */
+ Assert(!OidIsValid(collation)); /* result is always boolean */
break;
case T_CoerceToDomain:
((CoerceToDomain *) expr)->resultcollid = collation;
((SetToDefault *) expr)->collation = collation;
break;
case T_CurrentOfExpr:
- Assert(!OidIsValid(collation)); /* result is always boolean */
+ Assert(!OidIsValid(collation)); /* result is always boolean */
break;
case T_NextValueExpr:
- Assert(!OidIsValid(collation)); /* result is always an integer
- * type */
+ Assert(!OidIsValid(collation)); /* result is always an integer
+ * type */
break;
default:
elog(ERROR, "unrecognized node type: %d", (int) nodeTag(expr));
}
sz = add_size(sz, sizeof(Oid)); /* space for type OID */
- sz = add_size(sz, sizeof(uint16)); /* space for pflags */
+ sz = add_size(sz, sizeof(uint16)); /* space for pflags */
/* space for datum/isnull */
if (OidIsValid(typeOid))
{
READ_LOCALS(RangeVar);
- local_node->catalogname = NULL; /* not currently saved in output
- * format */
+ local_node->catalogname = NULL; /* not currently saved in output format */
READ_STRING_FIELD(schemaname);
READ_STRING_FIELD(relname);
token = pg_strtok(&length); /* skip :constvalue */
if (local_node->constisnull)
- token = pg_strtok(&length); /* skip "<>" */
+ token = pg_strtok(&length); /* skip "<>" */
else
local_node->constvalue = readDatum(local_node->constbyval);
*/
struct TBMSharedIterator
{
- TBMSharedIteratorState *state; /* shared state */
+ TBMSharedIteratorState *state; /* shared state */
PTEntryArray *ptbase; /* pagetable element array */
PTIterationArray *ptpages; /* sorted exact page index list */
PTIterationArray *ptchunks; /* sorted lossy page index list */
*/
nbuckets = maxbytes /
(sizeof(PagetableEntry) + sizeof(Pointer) + sizeof(Pointer));
- nbuckets = Min(nbuckets, INT_MAX - 1); /* safety limit */
- nbuckets = Max(nbuckets, 16); /* sanity limit */
+ nbuckets = Min(nbuckets, INT_MAX - 1); /* safety limit */
+ nbuckets = Max(nbuckets, 16); /* sanity limit */
tbm->maxentries = (int) nbuckets;
tbm->lossify_start = 0;
tbm->dsa = dsa;
return num_diffs;
}
-#endif /* defined(CX) */
+#endif /* defined(CX) */
return 0; /* to keep the compiler quiet */
}
-#endif /* defined(ERX) */
+#endif /* defined(ERX) */
fflush(fp);
}
-#endif /* GEQO_DEBUG */
+#endif /* GEQO_DEBUG */
}
}
-#endif /* defined(CX) */
+#endif /* defined(CX) */
}
-#endif /* defined(OX1) */
+#endif /* defined(OX1) */
}
-#endif /* defined(OX2) */
+#endif /* defined(OX2) */
pfree(check_list);
}
-#endif /* defined(PMX) */
+#endif /* defined(PMX) */
new_pool->data = (Chromosome *) palloc(pool_size * sizeof(Chromosome));
/* all gene */
- chromo = (Chromosome *) new_pool->data; /* vector of all chromos */
+ chromo = (Chromosome *) new_pool->data; /* vector of all chromos */
for (i = 0; i < pool_size; i++)
chromo[i].string = palloc((string_length + 1) * sizeof(Gene));
}
-#endif /* defined(PX) */
+#endif /* defined(PX) */
pfree(city_table);
}
-#endif /* CX || PX || OX1 || OX2 */
+#endif /* CX || PX || OX1 || OX2 */
if (brel == NULL)
continue;
- Assert(brel->relid == rti); /* sanity check on array */
+ Assert(brel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (brel->reloptkind != RELOPT_BASEREL)
if (rel == NULL)
continue;
- Assert(rel->relid == rti); /* sanity check on array */
+ Assert(rel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (rel->reloptkind != RELOPT_BASEREL)
if (rel == NULL)
continue;
- Assert(rel->relid == rti); /* sanity check on array */
+ Assert(rel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (rel->reloptkind != RELOPT_BASEREL)
fflush(stdout);
}
-#endif /* OPTIMIZER_DEBUG */
+#endif /* OPTIMIZER_DEBUG */
*/
typedef struct RangeQueryClause
{
- struct RangeQueryClause *next; /* next in linked list */
+ struct RangeQueryClause *next; /* next in linked list */
Node *var; /* The common variable of the clauses */
bool have_lobound; /* found a low-bound clause yet? */
bool have_hibound; /* found a high-bound clause yet? */
#ifdef SELECTIVITY_DEBUG
elog(DEBUG4, "clause_selectivity: s1 %f", s1);
-#endif /* SELECTIVITY_DEBUG */
+#endif /* SELECTIVITY_DEBUG */
return s1;
}
*/
ExecChooseHashTableSize(inner_path_rows,
inner_path->pathtarget->width,
- true, /* useskew */
+ true, /* useskew */
&numbuckets,
&numbatches,
&num_skew_mcvs);
nrows = rel->tuples *
clauselist_selectivity(root,
allclauses,
- rel->relid, /* do not use 0! */
+ rel->relid, /* do not use 0! */
JOIN_INNER,
NULL);
nrows = clamp_row_est(nrows);
{
EquivalenceMember *cur_em = (EquivalenceMember *) lfirst(lc2);
- Assert(!cur_em->em_is_child); /* no children yet */
+ Assert(!cur_em->em_is_child); /* no children yet */
/*
* If below an outer join, don't match constants: they're not as
{
EquivalenceMember *cur_em = (EquivalenceMember *) lfirst(lc2);
- Assert(!cur_em->em_is_child); /* no children yet */
+ Assert(!cur_em->em_is_child); /* no children yet */
if (equal(outervar, cur_em->em_expr))
{
match = true;
foreach(lc2, cur_ec->ec_members)
{
coal_em = (EquivalenceMember *) lfirst(lc2);
- Assert(!coal_em->em_is_child); /* no children yet */
+ Assert(!coal_em->em_is_child); /* no children yet */
if (IsA(coal_em->em_expr, CoalesceExpr))
{
CoalesceExpr *cexpr = (CoalesceExpr *) coal_em->em_expr;
Index var2varno = fkinfo->ref_relid;
AttrNumber var2attno = fkinfo->confkey[colno];
Oid eqop = fkinfo->conpfeqop[colno];
- List *opfamilies = NIL; /* compute only if needed */
+ List *opfamilies = NIL; /* compute only if needed */
ListCell *lc1;
foreach(lc1, root->eq_classes)
List *clauses, List *other_clauses)
{
List *result = NIL;
- List *all_clauses = NIL; /* not computed till needed */
+ List *all_clauses = NIL; /* not computed till needed */
ListCell *lc;
foreach(lc, rel->indexlist)
Assert(npaths > 0); /* else caller error */
if (npaths == 1)
- return (Path *) linitial(paths); /* easy case */
+ return (Path *) linitial(paths); /* easy case */
/*
* In theory we should consider every nonempty subset of the given paths.
apath.path.pathtype = T_BitmapAnd;
apath.path.parent = rel;
apath.path.pathtarget = rel->reltarget;
- apath.path.param_info = NULL; /* not used in bitmap trees */
+ apath.path.param_info = NULL; /* not used in bitmap trees */
apath.path.pathkeys = NIL;
apath.bitmapquals = paths;
cost_bitmap_and_node(&apath, root);
outer_rel = root->simple_rel_array[outer_relid];
if (outer_rel == NULL)
continue;
- Assert(outer_rel->relid == outer_relid); /* sanity check on array */
+ Assert(outer_rel->relid == outer_relid); /* sanity check on array */
/* Other relation could be proven empty, if so ignore */
if (IS_DUMMY_REL(outer_rel))
return;
}
- *orderby_clauses_p = orderby_clauses; /* success! */
+ *orderby_clauses_p = orderby_clauses; /* success! */
*clause_columns_p = clause_columns;
}
if (match_index_to_operand(rexpr, c, ind))
{
- matched = true; /* column is unique */
+ matched = true; /* column is unique */
break;
}
}
if (!var_on_left)
{
expr_op = get_commutator(expr_op);
- if (!OidIsValid(expr_op)) /* should not happen */
+ if (!OidIsValid(expr_op)) /* should not happen */
elog(ERROR, "could not find commutator of member %d(%u,%u) of opfamily %u",
op_strategy, lefttype, righttype, opfam);
}
}
num_sortkeys = list_length(innersortkeys);
if (num_sortkeys > 1 && !useallclauses)
- trialsortkeys = list_copy(innersortkeys); /* need modifiable copy */
+ trialsortkeys = list_copy(innersortkeys); /* need modifiable copy */
else
trialsortkeys = innersortkeys; /* won't really truncate */
if (outerpath == cheapest_startup_outer &&
innerpath == cheapest_total_inner)
- continue; /* already tried it */
+ continue; /* already tried it */
try_hashjoin_path(root,
joinrel,
opcintype,
opcintype,
BTEqualStrategyNumber);
- if (!OidIsValid(equality_op)) /* shouldn't happen */
+ if (!OidIsValid(equality_op)) /* shouldn't happen */
elog(ERROR, "could not find equality operator for opfamily %u",
opfamily);
opfamilies = get_mergejoin_opfamilies(equality_op);
* ressortgroupref labels. This is passed down by parent nodes such as Sort
* and Group, which need these values to be available in their inputs.
*/
-#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */
-#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */
-#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */
+#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */
+#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */
+#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */
static Plan *create_plan_recurse(PlannerInfo *root, Path *best_path,
* for the IN clause operators' RHS datatype.
*/
eqop = get_equality_op_for_ordering_op(sortop, NULL);
- if (!OidIsValid(eqop)) /* shouldn't happen */
+ if (!OidIsValid(eqop)) /* shouldn't happen */
elog(ERROR, "could not find equality operator for ordering operator %u",
sortop);
plan->total_cost = opath->path.total_cost;
plan->plan_rows =
clamp_row_est(opath->bitmapselectivity * opath->path.parent->tuples);
- plan->plan_width = 0; /* meaningless */
+ plan->plan_width = 0; /* meaningless */
plan->parallel_aware = false;
plan->parallel_safe = opath->path.parallel_safe;
}
if (!cteroot) /* shouldn't happen */
elog(ERROR, "bad levelsup for CTE \"%s\"", rte->ctename);
}
- if (cteroot->wt_param_id < 0) /* shouldn't happen */
+ if (cteroot->wt_param_id < 0) /* shouldn't happen */
elog(ERROR, "could not find param ID for CTE \"%s\"", rte->ctename);
/* Sort clauses into best execution order */
NULL,
true);
tlist = lappend(tlist, tle);
- lefttree->targetlist = tlist; /* just in case NIL before */
+ lefttree->targetlist = tlist; /* just in case NIL before */
}
/*
node->partitioned_rels = partitioned_rels;
node->resultRelations = resultRelations;
node->resultRelIndex = -1; /* will be set correctly in setrefs.c */
- node->rootResultRelIndex = -1; /* will be set correctly in setrefs.c */
+ node->rootResultRelIndex = -1; /* will be set correctly in setrefs.c */
node->plans = subplans;
if (!onconflict)
{
if (brel == NULL)
continue;
- Assert(brel->relid == rti); /* sanity check on array */
+ Assert(brel->relid == rti); /* sanity check on array */
/*
* This bit is less obvious than it might look. We ignore appendrel
if (brel == NULL)
continue;
- Assert(brel->relid == rti); /* sanity check on array */
+ Assert(brel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (brel->reloptkind != RELOPT_BASEREL)
/* JOIN_RIGHT was eliminated during reduce_outer_joins() */
elog(ERROR, "unrecognized join type: %d",
(int) j->jointype);
- nonnullable_rels = NULL; /* keep compiler quiet */
+ nonnullable_rels = NULL; /* keep compiler quiet */
nullable_rels = NULL;
leftjoinlist = rightjoinlist = NIL;
break;
{
sjinfo->min_lefthand = bms_copy(left_rels);
sjinfo->min_righthand = bms_copy(right_rels);
- sjinfo->lhs_strict = false; /* don't care about this */
+ sjinfo->lhs_strict = false; /* don't care about this */
return sjinfo;
}
static bool
check_outerjoin_delay(PlannerInfo *root,
Relids *relids_p, /* in/out parameter */
- Relids *nullable_relids_p, /* output parameter */
+ Relids *nullable_relids_p, /* output parameter */
bool is_pushed_down)
{
Relids relids;
* original (this is necessary in case there are subselects in there...)
*/
clause = make_opclause(opno,
- BOOLOID, /* opresulttype */
- false, /* opretset */
+ BOOLOID, /* opresulttype */
+ false, /* opretset */
copyObject(item1),
copyObject(item2),
InvalidOid,
* original (this is necessary in case there are subselects in there...)
*/
clause = make_opclause(opno,
- BOOLOID, /* opresulttype */
- false, /* opretset */
+ BOOLOID, /* opresulttype */
+ false, /* opretset */
copyObject(item1),
copyObject(item2),
InvalidOid,
* Build the RestrictInfo node itself.
*/
restrictinfo = make_restrictinfo(clause,
- true, /* is_pushed_down */
- false, /* outerjoin_delayed */
- false, /* pseudoconstant */
+ true, /* is_pushed_down */
+ false, /* outerjoin_delayed */
+ false, /* pseudoconstant */
security_level, /* security_level */
qualscope, /* required_relids */
- NULL, /* outer_relids */
+ NULL, /* outer_relids */
nullable_relids); /* nullable_relids */
/* Set mergejoinability/hashjoinability flags */
if (!parse->hasAggs)
return;
- Assert(!parse->setOperations); /* shouldn't get here if a setop */
- Assert(parse->rowMarks == NIL); /* nor if FOR UPDATE */
+ Assert(!parse->setOperations); /* shouldn't get here if a setop */
+ Assert(parse->rowMarks == NIL); /* nor if FOR UPDATE */
/*
* Reject unoptimizable cases.
if (brel == NULL)
continue;
- Assert(brel->relid == rti); /* sanity check on array */
+ Assert(brel->relid == rti); /* sanity check on array */
if (IS_SIMPLE_REL(brel))
total_pages += (double) brel->pages;
newrc->markType = select_rowmark_type(rte, LCS_NONE);
newrc->allMarkTypes = (1 << newrc->markType);
newrc->strength = LCS_NONE;
- newrc->waitPolicy = LockWaitBlock; /* doesn't matter */
+ newrc->waitPolicy = LockWaitBlock; /* doesn't matter */
newrc->isParent = false;
prowmarks = lappend(prowmarks, newrc);
break;
}
elog(ERROR, "unrecognized LockClauseStrength %d", (int) strength);
- return ROW_MARK_EXCLUSIVE; /* keep compiler quiet */
+ return ROW_MARK_EXCLUSIVE; /* keep compiler quiet */
}
}
{
*count_est = DatumGetInt64(((Const *) est)->constvalue);
if (*count_est <= 0)
- *count_est = 1; /* force to at least 1 */
+ *count_est = 1; /* force to at least 1 */
}
}
else
/* both fractional, so add them together */
tuple_fraction += limit_fraction;
if (tuple_fraction >= 1.0)
- tuple_fraction = 0.0; /* assume fetch all */
+ tuple_fraction = 0.0; /* assume fetch all */
}
}
}
RelOptInfo *grouped_rel;
PathTarget *partial_grouping_target = NULL;
AggClauseCosts agg_partial_costs; /* parallel only */
- AggClauseCosts agg_final_costs; /* parallel only */
+ AggClauseCosts agg_final_costs; /* parallel only */
Size hashaggtablesize;
double dNumGroups;
double dNumPartialGroups = 0;
/* Shouldn't get here unless query has ORDER BY */
Assert(parse->sortClause);
- *have_postponed_srfs = false; /* default result */
+ *have_postponed_srfs = false; /* default result */
/* Inspect tlist and collect per-column information */
ncols = list_length(final_target->exprs);
if (rel != NULL)
{
- Assert(rel->relid == rti); /* sanity check on array */
+ Assert(rel->relid == rti); /* sanity check on array */
/*
* The subquery might never have been planned at all, if it
}
else
{
- newvar->varnoold = 0; /* wasn't ever a plain Var */
+ newvar->varnoold = 0; /* wasn't ever a plain Var */
newvar->varoattno = 0;
}
Var *newvar;
newvar = makeVarFromTargetEntry(newvarno, tle);
- newvar->varnoold = 0; /* wasn't ever a plain Var */
+ newvar->varnoold = 0; /* wasn't ever a plain Var */
newvar->varoattno = 0;
return newvar;
}
RangeTblEntry *target_rte; /* RTE of subquery */
Relids relids; /* relids within subquery, as numbered after
* pullup (set only if target_rte->lateral) */
- bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */
+ bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */
int varno; /* varno of subquery */
bool need_phvs; /* do we need PlaceHolderVars? */
bool wrap_non_vars; /* do we need 'em on *all* non-Vars? */
if (deletion_ok && !have_undeleted_child)
{
/* OK to delete this FromExpr entirely */
- root->hasDeletedRTEs = true; /* probably is set already */
+ root->hasDeletedRTEs = true; /* probably is set already */
return NULL;
}
}
&colnames, &fields);
/* Adjust the generated per-field Vars, but don't insert PHVs */
rcon->need_phvs = false;
- context->sublevels_up = 0; /* to match the expandRTE output */
+ context->sublevels_up = 0; /* to match the expandRTE output */
fields = (List *) replace_rte_variables_mutator((Node *) fields,
context);
rcon->need_phvs = save_need_phvs;
if (right_state->contains_outer)
{
- if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */
+ if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */
{
/* pass appropriate constraints, per comment above */
pass_nonnullable_rels = local_nonnullable_rels;
attcollation,
att_tup->attlen,
(Datum) 0,
- true, /* isnull */
+ true, /* isnull */
att_tup->attbyval);
new_expr = coerce_to_domain(new_expr,
InvalidOid, -1,
InvalidOid,
sizeof(int32),
(Datum) 0,
- true, /* isnull */
+ true, /* isnull */
true /* byval */ );
}
break;
InvalidOid,
sizeof(int32),
(Datum) 0,
- true, /* isnull */
+ true, /* isnull */
true /* byval */ );
}
break;
return contain_context_dependent_node_walker(clause, &flags);
}
-#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */
+#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */
static bool
contain_context_dependent_node_walker(Node *node, int *flags)
{
eval_const_expressions_context context;
- context.boundParams = root->glob->boundParams; /* bound Params */
+ context.boundParams = root->glob->boundParams; /* bound Params */
/* we do not need to mark the plan as depending on inlined functions */
context.root = NULL;
context.active_fns = NIL; /* nothing being recursively simplified */
* Need to get OID of underlying function. Okay to
* scribble on input to this extent.
*/
- set_opfuncid((OpExpr *) expr); /* rely on struct
- * equivalence */
+ set_opfuncid((OpExpr *) expr); /* rely on struct
+ * equivalence */
/*
* Code for op/func reduction is pretty bulky, so split it
if (newarg && IsA(newarg, Const))
{
context->case_val = newarg;
- newarg = NULL; /* not needed anymore, see above */
+ newarg = NULL; /* not needed anymore, see above */
}
else
context->case_val = NULL;
default:
elog(ERROR, "unrecognized nulltesttype: %d",
(int) ntest->nulltesttype);
- result = false; /* keep compiler quiet */
+ result = false; /* keep compiler quiet */
break;
}
default:
elog(ERROR, "unrecognized booltesttype: %d",
(int) btest->booltesttype);
- result = false; /* keep compiler quiet */
+ result = false; /* keep compiler quiet */
break;
}
newexpr->funcretset = false;
newexpr->funcvariadic = funcvariadic;
newexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
- newexpr->funccollid = result_collid; /* doesn't matter */
+ newexpr->funccollid = result_collid; /* doesn't matter */
newexpr->inputcollid = input_collid;
newexpr->args = args;
newexpr->location = -1;
if (rel == NULL)
continue;
- Assert(rel->relid == rti); /* sanity check on array */
+ Assert(rel->relid == rti); /* sanity check on array */
/* ignore RTEs that are "other rels" */
if (rel->reloptkind != RELOPT_BASEREL)
void
add_path(RelOptInfo *parent_rel, Path *new_path)
{
- bool accept_new = true; /* unless we find a superior old path */
+ bool accept_new = true; /* unless we find a superior old path */
ListCell *insert_after = NULL; /* where to insert new item */
List *new_path_pathkeys;
ListCell *p1;
outercmp == BMS_SUBSET1) &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
}
else if (keyscmp == PATHKEYS_BETTER2)
{
outercmp == BMS_SUBSET2) &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
}
else /* keyscmp == PATHKEYS_EQUAL */
{
else if (outercmp == BMS_SUBSET1 &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
else if (outercmp == BMS_SUBSET2 &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
/* else different parameterizations, keep both */
}
break;
outercmp == BMS_SUBSET1) &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
}
break;
case COSTS_BETTER2:
outercmp == BMS_SUBSET2) &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
}
break;
case COSTS_DIFFERENT:
void
add_partial_path(RelOptInfo *parent_rel, Path *new_path)
{
- bool accept_new = true; /* unless we find a superior old path */
+ bool accept_new = true; /* unless we find a superior old path */
ListCell *insert_after = NULL; /* where to insert new item */
ListCell *p1;
ListCell *p1_prev;
pathnode->path.parallel_aware = parallel_degree > 0 ? true : false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_degree;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapqual = bitmapqual;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapquals = bitmapquals;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapquals = bitmapquals;
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->tidquals = tidquals;
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_workers;
- pathnode->path.pathkeys = NIL; /* result is always considered
- * unsorted */
+ pathnode->path.pathkeys = NIL; /* result is always considered unsorted */
pathnode->partitioned_rels = list_copy(partitioned_rels);
pathnode->subpaths = subpaths;
else
{
/* We'll need to insert a Sort node, so include cost for that */
- Path sort_path; /* dummy for result of cost_sort */
+ Path sort_path; /* dummy for result of cost_sort */
cost_sort(&sort_path,
root,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = false;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* Gather has unordered result */
+ pathnode->path.pathkeys = NIL; /* Gather has unordered result */
pathnode->subpath = subpath;
pathnode->num_workers = subpath->parallel_workers;
}
else
{
- Path sort_path; /* dummy for result of cost_sort */
- Path agg_path; /* dummy for result of cost_agg */
+ Path sort_path; /* dummy for result of cost_sort */
+ Path agg_path; /* dummy for result of cost_agg */
if (rollup->is_hashed || is_first_sort)
{
rels_used = pull_varnos((Node *) phv->phexpr);
phinfo->ph_lateral = bms_difference(rels_used, phv->phrels);
if (bms_is_empty(phinfo->ph_lateral))
- phinfo->ph_lateral = NULL; /* make it exactly NULL if empty */
+ phinfo->ph_lateral = NULL; /* make it exactly NULL if empty */
phinfo->ph_eval_at = bms_int_members(rels_used, phv->phrels);
/* If no contained vars, force evaluation at syntactic location */
if (bms_is_empty(phinfo->ph_eval_at))
/* Build targetlist using the completed indexprs data */
info->indextlist = build_index_tlist(root, info, relation);
- info->indrestrictinfo = NIL; /* set later, in indxpath.c */
- info->predOK = false; /* set later, in indxpath.c */
+ info->indrestrictinfo = NIL; /* set later, in indxpath.c */
+ info->predOK = false; /* set later, in indxpath.c */
info->unique = index->indisunique;
info->immediate = index->indimmediate;
info->hypothetical = false;
List *idxExprs)
{
AttrNumber natt;
- Oid inferopfamily = InvalidOid; /* OID of opclass opfamily */
+ Oid inferopfamily = InvalidOid; /* OID of opclass opfamily */
Oid inferopcinputtype = InvalidOid; /* OID of opclass input type */
int nplain = 0; /* # plain attrs observed */
iterate_end(pred_info);
if (!presult)
{
- result = false; /* doesn't imply any of B's */
+ result = false; /* doesn't imply any of B's */
break;
}
}
iterate_end(pred_info);
if (!presult)
{
- result = false; /* citem refutes nothing */
+ result = false; /* citem refutes nothing */
break;
}
}
* The predicate operator:
* LT LE EQ GE GT NE
*/
- {TRUE, TRUE, none, none, none, TRUE}, /* LT */
- {none, TRUE, none, none, none, none}, /* LE */
- {none, TRUE, TRUE, TRUE, none, none}, /* EQ */
- {none, none, none, TRUE, none, none}, /* GE */
- {none, none, none, TRUE, TRUE, TRUE}, /* GT */
- {none, none, none, none, none, TRUE} /* NE */
+ {TRUE, TRUE, none, none, none, TRUE}, /* LT */
+ {none, TRUE, none, none, none, none}, /* LE */
+ {none, TRUE, TRUE, TRUE, none, none}, /* EQ */
+ {none, none, none, TRUE, none, none}, /* GE */
+ {none, none, none, TRUE, TRUE, TRUE}, /* GT */
+ {none, none, none, none, none, TRUE} /* NE */
};
static const bool BT_refutes_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
- {none, none, TRUE, TRUE, TRUE, none}, /* LT */
- {none, none, none, none, TRUE, none}, /* LE */
- {TRUE, none, none, none, TRUE, TRUE}, /* EQ */
- {TRUE, none, none, none, none, none}, /* GE */
- {TRUE, TRUE, TRUE, none, none, none}, /* GT */
- {none, none, TRUE, none, none, none} /* NE */
+ {none, none, TRUE, TRUE, TRUE, none}, /* LT */
+ {none, none, none, none, TRUE, none}, /* LE */
+ {TRUE, none, none, none, TRUE, TRUE}, /* EQ */
+ {TRUE, none, none, none, none, none}, /* GE */
+ {TRUE, TRUE, TRUE, none, none, none}, /* GT */
+ {none, none, TRUE, none, none, none} /* NE */
};
static const StrategyNumber BT_implic_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
- {BTGE, BTGE, none, none, none, BTGE}, /* LT */
- {BTGT, BTGE, none, none, none, BTGT}, /* LE */
- {BTGT, BTGE, BTEQ, BTLE, BTLT, BTNE}, /* EQ */
- {none, none, none, BTLE, BTLT, BTLT}, /* GE */
- {none, none, none, BTLE, BTLE, BTLE}, /* GT */
- {none, none, none, none, none, BTEQ} /* NE */
+ {BTGE, BTGE, none, none, none, BTGE}, /* LT */
+ {BTGT, BTGE, none, none, none, BTGT}, /* LE */
+ {BTGT, BTGE, BTEQ, BTLE, BTLT, BTNE}, /* EQ */
+ {none, none, none, BTLE, BTLT, BTLT}, /* GE */
+ {none, none, none, BTLE, BTLE, BTLE}, /* GT */
+ {none, none, none, none, none, BTEQ} /* NE */
};
static const StrategyNumber BT_refute_table[6][6] = {
* The predicate operator:
* LT LE EQ GE GT NE
*/
- {none, none, BTGE, BTGE, BTGE, none}, /* LT */
- {none, none, BTGT, BTGT, BTGE, none}, /* LE */
- {BTLE, BTLT, BTNE, BTGT, BTGE, BTEQ}, /* EQ */
- {BTLE, BTLT, BTLT, none, none, none}, /* GE */
- {BTLE, BTLE, BTLE, none, none, none}, /* GT */
- {none, none, BTEQ, none, none, none} /* NE */
+ {none, none, BTGE, BTGE, BTGE, none}, /* LT */
+ {none, none, BTGT, BTGT, BTGE, none}, /* LE */
+ {BTLE, BTLT, BTNE, BTGT, BTGE, BTEQ}, /* EQ */
+ {BTLE, BTLT, BTLT, none, none, none}, /* GE */
+ {BTLE, BTLE, BTLE, none, none, none}, /* GT */
+ {none, none, BTEQ, none, none, none} /* NE */
};
rel->rows = 0;
/* cheap startup cost is interesting iff not all tuples to be retrieved */
rel->consider_startup = (root->tuple_fraction > 0);
- rel->consider_param_startup = false; /* might get changed later */
- rel->consider_parallel = false; /* might get changed later */
+ rel->consider_param_startup = false; /* might get changed later */
+ rel->consider_parallel = false; /* might get changed later */
rel->reltarget = create_empty_pathtarget();
rel->pathlist = NIL;
rel->ppilist = NIL;
rel->allvisfrac = 0;
rel->subroot = NULL;
rel->subplan_params = NIL;
- rel->rel_parallel_workers = -1; /* set up in get_relation_info */
+ rel->rel_parallel_workers = -1; /* set up in get_relation_info */
rel->serverid = InvalidOid;
rel->userid = rte->checkAsUser;
rel->useridiscurrent = false;
/* cheap startup cost is interesting iff not all tuples to be retrieved */
upperrel->consider_startup = (root->tuple_fraction > 0);
upperrel->consider_param_startup = false;
- upperrel->consider_parallel = false; /* might get changed later */
+ upperrel->consider_parallel = false; /* might get changed later */
upperrel->reltarget = create_empty_pathtarget();
upperrel->pathlist = NIL;
upperrel->cheapest_startup_path = NULL;
restrictinfo->is_pushed_down = is_pushed_down;
restrictinfo->outerjoin_delayed = outerjoin_delayed;
restrictinfo->pseudoconstant = pseudoconstant;
- restrictinfo->can_join = false; /* may get set below */
+ restrictinfo->can_join = false; /* may get set below */
restrictinfo->security_level = security_level;
restrictinfo->outer_relids = outer_relids;
restrictinfo->nullable_relids = nullable_relids;
if (security_level > 0)
restrictinfo->leakproof = !contain_leaked_vars((Node *) clause);
else
- restrictinfo->leakproof = false; /* really, "don't know" */
+ restrictinfo->leakproof = false; /* really, "don't know" */
/*
* If it's a binary opclause, set up left/right relids info. In any case
/* Workspace for split_pathtarget_walker */
typedef struct
{
- List *input_target_exprs; /* exprs available from input */
+ List *input_target_exprs; /* exprs available from input */
List *level_srfs; /* list of lists of SRF exprs */
- List *level_input_vars; /* vars needed by SRFs of each level */
- List *level_input_srfs; /* SRFs needed by SRFs of each level */
- List *current_input_vars; /* vars needed in current subexpr */
- List *current_input_srfs; /* SRFs needed in current subexpr */
+ List *level_input_vars; /* vars needed by SRFs of each level */
+ List *level_input_srfs; /* SRFs needed by SRFs of each level */
+ List *current_input_vars; /* vars needed in current subexpr */
+ List *current_input_srfs; /* SRFs needed in current subexpr */
int current_depth; /* max SRF depth in current subexpr */
} split_pathtarget_context;
{
TargetEntry *tle;
- tle = makeTargetEntry(copyObject(expr), /* copy needed?? */
+ tle = makeTargetEntry(copyObject(expr), /* copy needed?? */
next_resno++,
NULL,
false);
{
PlannerInfo *root;
int sublevels_up;
- bool possible_sublink; /* could aliases include a SubLink? */
- bool inserted_sublink; /* have we inserted a SubLink? */
+ bool possible_sublink; /* could aliases include a SubLink? */
+ bool inserted_sublink; /* have we inserted a SubLink? */
} flatten_join_alias_vars_context;
static bool pull_varnos_walker(Node *node,
default:
break;
}
-#endif /* RAW_EXPRESSION_COVERAGE_TEST */
+#endif /* RAW_EXPRESSION_COVERAGE_TEST */
switch (nodeTag(parseTree))
{
grpcl->tleSortGroupRef = 0;
grpcl->eqop = eqop;
grpcl->sortop = sortop;
- grpcl->nulls_first = false; /* OK with or without sortop */
+ grpcl->nulls_first = false; /* OK with or without sortop */
grpcl->hashable = hashable;
op->groupClauses = lappend(op->groupClauses, grpcl);
rescolnode->collation = rescolcoll;
rescolnode->location = bestlocation;
restle = makeTargetEntry((Expr *) rescolnode,
- 0, /* no need to set resno */
+ 0, /* no need to set resno */
NULL,
false);
*targetlist = lappend(*targetlist, restle);
void
CheckSelectLocking(Query *qry, LockClauseStrength strength)
{
- Assert(strength != LCS_NONE); /* else caller error */
+ Assert(strength != LCS_NONE); /* else caller error */
if (qry->setOperations)
ereport(ERROR,
{
RowMarkClause *rc;
- Assert(strength != LCS_NONE); /* else caller error */
+ Assert(strength != LCS_NONE); /* else caller error */
/* If it's an explicit clause, make sure hasForUpdate gets set */
if (!pushedDown)
context);
}
-#endif /* RAW_EXPRESSION_COVERAGE_TEST */
+#endif /* RAW_EXPRESSION_COVERAGE_TEST */
gvar->varno == var->varno &&
gvar->varattno == var->varattno &&
gvar->varlevelsup == 0)
- return false; /* acceptable, we're okay */
+ return false; /* acceptable, we're okay */
}
}
ListCell *lx,
*rx;
- Assert(j->usingClause == NIL); /* shouldn't have USING() too */
+ Assert(j->usingClause == NIL); /* shouldn't have USING() too */
foreach(lx, l_colnames)
{
grpcl->tleSortGroupRef = assignSortGroupRef(tle, targetlist);
grpcl->eqop = eqop;
grpcl->sortop = sortop;
- grpcl->nulls_first = false; /* OK with or without sortop */
+ grpcl->nulls_first = false; /* OK with or without sortop */
grpcl->hashable = hashable;
grouplist = lappend(grouplist, grpcl);
/* accept if target is polymorphic, for now */
if (IsPolymorphicType(targetTypeId))
{
- have_generics = true; /* do more checking later */
+ have_generics = true; /* do more checking later */
continue;
}
{
if (actual_type == UNKNOWNOID)
continue;
- actual_type = getBaseType(actual_type); /* flatten domains */
+ actual_type = getBaseType(actual_type); /* flatten domains */
if (OidIsValid(array_typeid) && actual_type != array_typeid)
return false;
array_typeid = actual_type;
{
if (actual_type == UNKNOWNOID)
continue;
- actual_type = getBaseType(actual_type); /* flatten domains */
+ actual_type = getBaseType(actual_type); /* flatten domains */
if (OidIsValid(range_typeid) && actual_type != range_typeid)
return false;
range_typeid = actual_type;
}
if (allow_poly && decl_type == actual_type)
continue; /* no new information here */
- actual_type = getBaseType(actual_type); /* flatten domains */
+ actual_type = getBaseType(actual_type); /* flatten domains */
if (OidIsValid(array_typeid) && actual_type != array_typeid)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
}
if (allow_poly && decl_type == actual_type)
continue; /* no new information here */
- actual_type = getBaseType(actual_type); /* flatten domains */
+ actual_type = getBaseType(actual_type); /* flatten domains */
if (OidIsValid(range_typeid) && actual_type != range_typeid)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
/* Node's result type isn't collatable. */
collation = InvalidOid;
strength = COLLATE_NONE;
- location = -1; /* won't be used */
+ location = -1; /* won't be used */
}
}
break;
/* Node's result type isn't collatable. */
collation = InvalidOid;
strength = COLLATE_NONE;
- location = -1; /* won't be used */
+ location = -1; /* won't be used */
}
/*
/* Node's result type isn't collatable. */
collation = InvalidOid;
strength = COLLATE_NONE;
- location = -1; /* won't be used */
+ location = -1; /* won't be used */
}
/*
lctypmod = lnext(lctypmod);
lccoll = lnext(lccoll);
}
- if (lctyp != NULL || lctypmod != NULL || lccoll != NULL) /* shouldn't happen */
+ if (lctyp != NULL || lctypmod != NULL || lccoll != NULL) /* shouldn't happen */
elog(ERROR, "wrong number of output columns in WITH");
}
}
CommonTableExpr *cte = cstate->items[i].cte;
SelectStmt *stmt = (SelectStmt *) cte->ctequery;
- Assert(!IsA(stmt, Query)); /* not analyzed yet */
+ Assert(!IsA(stmt, Query)); /* not analyzed yet */
/* Ignore items that weren't found to be recursive */
if (!cte->cterecursive)
* Node-type groups for operator precedence warnings
* We use zero for everything not otherwise classified
*/
-#define PREC_GROUP_POSTFIX_IS 1 /* postfix IS tests (NullTest, etc) */
-#define PREC_GROUP_INFIX_IS 2 /* infix IS (IS DISTINCT FROM, etc) */
-#define PREC_GROUP_LESS 3 /* < > */
-#define PREC_GROUP_EQUAL 4 /* = */
-#define PREC_GROUP_LESS_EQUAL 5 /* <= >= <> */
-#define PREC_GROUP_LIKE 6 /* LIKE ILIKE SIMILAR */
-#define PREC_GROUP_BETWEEN 7 /* BETWEEN */
-#define PREC_GROUP_IN 8 /* IN */
-#define PREC_GROUP_NOT_LIKE 9 /* NOT LIKE/ILIKE/SIMILAR */
-#define PREC_GROUP_NOT_BETWEEN 10 /* NOT BETWEEN */
-#define PREC_GROUP_NOT_IN 11 /* NOT IN */
-#define PREC_GROUP_POSTFIX_OP 12 /* generic postfix operators */
-#define PREC_GROUP_INFIX_OP 13 /* generic infix operators */
-#define PREC_GROUP_PREFIX_OP 14 /* generic prefix operators */
+#define PREC_GROUP_POSTFIX_IS 1 /* postfix IS tests (NullTest, etc) */
+#define PREC_GROUP_INFIX_IS 2 /* infix IS (IS DISTINCT FROM, etc) */
+#define PREC_GROUP_LESS 3 /* < > */
+#define PREC_GROUP_EQUAL 4 /* = */
+#define PREC_GROUP_LESS_EQUAL 5 /* <= >= <> */
+#define PREC_GROUP_LIKE 6 /* LIKE ILIKE SIMILAR */
+#define PREC_GROUP_BETWEEN 7 /* BETWEEN */
+#define PREC_GROUP_IN 8 /* IN */
+#define PREC_GROUP_NOT_LIKE 9 /* NOT LIKE/ILIKE/SIMILAR */
+#define PREC_GROUP_NOT_BETWEEN 10 /* NOT BETWEEN */
+#define PREC_GROUP_NOT_IN 11 /* NOT IN */
+#define PREC_GROUP_POSTFIX_OP 12 /* generic postfix operators */
+#define PREC_GROUP_INFIX_OP 13 /* generic infix operators */
+#define PREC_GROUP_PREFIX_OP 14 /* generic prefix operators */
/*
* Map precedence groupings to old precedence ordering
break;
}
default:
- crerr = CRERR_TOO_MANY; /* too many dotted names */
+ crerr = CRERR_TOO_MANY; /* too many dotted names */
break;
}
* If so, replace the raw name reference with a parameter reference. (This
* is a hack for the convenience of plpgsql.)
*/
- if (cexpr->cursor_name != NULL) /* in case already transformed */
+ if (cexpr->cursor_name != NULL) /* in case already transformed */
{
ColumnRef *cref = makeNode(ColumnRef);
Node *node = NULL;
int catDirectArgs;
tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcid));
- if (!HeapTupleIsValid(tup)) /* should not happen */
+ if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for aggregate %u", funcid);
classForm = (Form_pg_aggregate) GETSTRUCT(tup);
aggkind = classForm->aggkind;
aggref->aggfnoid = funcid;
aggref->aggtype = rettype;
/* aggcollid and inputcollid will be set by parse_collate.c */
- aggref->aggtranstype = InvalidOid; /* will be set by planner */
+ aggref->aggtranstype = InvalidOid; /* will be set by planner */
/* aggargtypes will be set by transformAggregateCall */
/* aggdirectargs and args will be set by transformAggregateCall */
/* aggorder and aggdistinct will be set by transformAggregateCall */
aggref->aggvariadic = func_variadic;
aggref->aggkind = aggkind;
/* agglevelsup will be set by transformAggregateCall */
- aggref->aggsplit = AGGSPLIT_SIMPLE; /* planner might change this */
+ aggref->aggsplit = AGGSPLIT_SIMPLE; /* planner might change this */
aggref->location = location;
/*
WindowFunc *wfunc = makeNode(WindowFunc);
Assert(over); /* lack of this was checked above */
- Assert(!agg_within_group); /* also checked above */
+ Assert(!agg_within_group); /* also checked above */
wfunc->winfnoid = funcid;
wfunc->wintype = rettype;
func_match_argtypes(int nargs,
Oid *input_typeids,
FuncCandidateList raw_candidates,
- FuncCandidateList *candidates) /* return value */
+ FuncCandidateList *candidates) /* return value */
{
FuncCandidateList current_candidate;
FuncCandidateList next_candidate;
if (input_base_typeids[i] != UNKNOWNOID)
continue;
- resolved_unknowns = true; /* assume we can do it */
+ resolved_unknowns = true; /* assume we can do it */
slot_category[i] = TYPCATEGORY_INVALID;
slot_has_preferred_type[i] = false;
have_conflict = false;
{
if (input_base_typeids[i] == UNKNOWNOID)
continue;
- if (known_type == UNKNOWNOID) /* first known arg? */
+ if (known_type == UNKNOWNOID) /* first known arg? */
known_type = input_base_typeids[i];
else if (known_type != input_base_typeids[i])
{
bool *retset, /* return value */
int *nvargs, /* return value */
Oid *vatype, /* return value */
- Oid **true_typeids, /* return value */
- List **argdefaults) /* optional return value */
+ Oid **true_typeids, /* return value */
+ List **argdefaults) /* optional return value */
{
FuncCandidateList raw_candidates;
FuncCandidateList best_candidate;
sizeof(int32),
Int32GetDatum(1),
false,
- true); /* pass by value */
+ true); /* pass by value */
}
else
{
typeid = INT8OID;
typelen = sizeof(int64);
- typebyval = FLOAT8PASSBYVAL; /* int8 and float8 alike */
+ typebyval = FLOAT8PASSBYVAL; /* int8 and float8 alike */
}
}
else
oper_select_candidate(int nargs,
Oid *input_typeids,
FuncCandidateList candidates,
- Oid *operOid) /* output argument */
+ Oid *operOid) /* output argument */
{
int ncandidates;
rte->inFromCl = inFromCl;
rte->requiredPerms = ACL_SELECT;
- rte->checkAsUser = InvalidOid; /* not set-uid by default, either */
+ rte->checkAsUser = InvalidOid; /* not set-uid by default, either */
rte->selectedCols = NULL;
rte->insertedCols = NULL;
rte->updatedCols = NULL;
rte->inFromCl = inFromCl;
rte->requiredPerms = ACL_SELECT;
- rte->checkAsUser = InvalidOid; /* not set-uid by default, either */
+ rte->checkAsUser = InvalidOid; /* not set-uid by default, either */
rte->selectedCols = NULL;
rte->insertedCols = NULL;
rte->updatedCols = NULL;
rtfunc->funccoltypes = NIL;
rtfunc->funccoltypmods = NIL;
rtfunc->funccolcollations = NIL;
- rtfunc->funcparams = NULL; /* not set until planning */
+ rtfunc->funcparams = NULL; /* not set until planning */
/*
* Now determine if the function returns a simple or composite type.
markVarForSelectPriv(pstate, varnode, rte);
}
- Assert(name == NULL && var == NULL); /* lists not the same length? */
+ Assert(name == NULL && var == NULL); /* lists not the same length? */
return te_list;
}
tp = SearchSysCache2(ATTNUM,
ObjectIdGetDatum(rte->relid),
Int16GetDatum(attnum));
- if (!HeapTupleIsValid(tp)) /* shouldn't happen */
+ if (!HeapTupleIsValid(tp)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, rte->relid);
att_tup = (Form_pg_attribute) GETSTRUCT(tp);
tp = SearchSysCache2(ATTNUM,
ObjectIdGetDatum(rte->relid),
Int16GetDatum(attnum));
- if (!HeapTupleIsValid(tp)) /* shouldn't happen */
+ if (!HeapTupleIsValid(tp)) /* shouldn't happen */
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
attnum, rte->relid);
att_tup = (Form_pg_attribute) GETSTRUCT(tp);
* the table */
IndexStmt *pkey; /* PRIMARY KEY index, if any */
bool ispartitioned; /* true if table is partitioned */
- PartitionBoundSpec *partbound; /* transformed FOR VALUES */
+ PartitionBoundSpec *partbound; /* transformed FOR VALUES */
} CreateStmtContext;
/* State shared by transformCreateSchemaStmt and its subroutines */
tuple = typenameType(NULL, ofTypename, NULL);
check_of_type(tuple);
ofTypeId = HeapTupleGetOid(tuple);
- ofTypename->typeOid = ofTypeId; /* cached for later */
+ ofTypename->typeOid = ofTypeId; /* cached for later */
tupdesc = lookup_rowtype_tupdesc(ofTypeId, -1);
for (i = 0; i < tupdesc->natts; i++)
assign_expr_collations(pstate, *whereClause);
/* this is probably dead code without add_missing_from: */
- if (list_length(pstate->p_rtable) != 2) /* naughty, naughty... */
+ if (list_length(pstate->p_rtable) != 2) /* naughty, naughty... */
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("rule WHERE condition cannot contain references to other relations")));
nothing_qry->commandType = CMD_NOTHING;
nothing_qry->rtable = pstate->p_rtable;
- nothing_qry->jointree = makeFromExpr(NIL, NULL); /* no join wanted */
+ nothing_qry->jointree = makeFromExpr(NIL, NULL); /* no join wanted */
*actions = list_make1(nothing_qry);
}
S_UNLOCK((slock_t *) &ptr->sema);
}
-#endif /* PG_HAVE_ATOMIC_FLAG_SIMULATION */
+#endif /* PG_HAVE_ATOMIC_FLAG_SIMULATION */
#ifdef PG_HAVE_ATOMIC_U32_SIMULATION
void
return oldval;
}
-#endif /* PG_HAVE_ATOMIC_U32_SIMULATION */
+#endif /* PG_HAVE_ATOMIC_U32_SIMULATION */
#ifdef PG_HAVE_ATOMIC_U64_SIMULATION
return oldval;
}
-#endif /* PG_HAVE_ATOMIC_U64_SIMULATION */
+#endif /* PG_HAVE_ATOMIC_U64_SIMULATION */
#define PORT_PROTOS_H
#include <dlfcn.h>
-#include "utils/dynamic_loader.h" /* pgrminclude ignore */
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
#define pg_dlclose(h) dlclose(h)
#define pg_dlerror() dlerror()
-#endif /* PORT_PROTOS_H */
+#endif /* PORT_PROTOS_H */
#define PORT_PROTOS_H
#include <dlfcn.h>
-#include "utils/dynamic_loader.h" /* pgrminclude ignore */
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
#define pg_dlclose dlclose
#define pg_dlerror dlerror
-#endif /* PORT_PROTOS_H */
+#endif /* PORT_PROTOS_H */
return (char *) errorString;
}
-#endif /* HAVE_DLOPEN */
+#endif /* HAVE_DLOPEN */
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91";
-#endif /* LIBC_SCCS and not lint */
+#endif /* LIBC_SCCS and not lint */
#include "postgres.h"
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
-#endif /* !__ELF__ */
+#endif /* !__ELF__ */
if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
#include <link.h>
#include <dlfcn.h>
-#include "utils/dynamic_loader.h" /* pgrminclude ignore */
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on NetBSD 1.0.
void *BSD44_derived_dlsym(void *handle, const char *name);
void BSD44_derived_dlclose(void *handle);
-#endif /* PORT_PROTOS_H */
+#endif /* PORT_PROTOS_H */
#endif
}
-#endif /* !HAVE_DLOPEN */
+#endif /* !HAVE_DLOPEN */
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
-#include "utils/dynamic_loader.h" /* pgrminclude ignore */
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
#ifdef HAVE_DLOPEN
#include <dlfcn.h>
#endif
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
-#endif /* HAVE_DLOPEN */
+#endif /* HAVE_DLOPEN */
-#endif /* PORT_PROTOS_H */
+#endif /* PORT_PROTOS_H */
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91";
-#endif /* LIBC_SCCS and not lint */
+#endif /* LIBC_SCCS and not lint */
#include "postgres.h"
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
-#endif /* !__ELF__ */
+#endif /* !__ELF__ */
if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
#include <link.h>
#include <dlfcn.h>
-#include "utils/dynamic_loader.h" /* pgrminclude ignore */
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on NetBSD 1.0.
void *BSD44_derived_dlsym(void *handle, const char *name);
void BSD44_derived_dlclose(void *handle);
-#endif /* PORT_PROTOS_H */
+#endif /* PORT_PROTOS_H */
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91";
-#endif /* LIBC_SCCS and not lint */
+#endif /* LIBC_SCCS and not lint */
#include "postgres.h"
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
-#endif /* !__ELF__ */
+#endif /* !__ELF__ */
if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
#include <link.h>
#include <dlfcn.h>
-#include "utils/dynamic_loader.h" /* pgrminclude ignore */
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* Dynamic Loader on NetBSD 1.0.
void *BSD44_derived_dlsym(void *handle, const char *name);
void BSD44_derived_dlclose(void *handle);
-#endif /* PORT_PROTOS_H */
+#endif /* PORT_PROTOS_H */
#define PORT_PROTOS_H
#include <dlfcn.h>
-#include "utils/dynamic_loader.h" /* pgrminclude ignore */
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
#define pg_dlclose dlclose
#define pg_dlerror dlerror
-#endif /* PORT_PROTOS_H */
+#endif /* PORT_PROTOS_H */
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
-#include "utils/dynamic_loader.h" /* pgrminclude ignore */
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
#define pg_dlopen(f) dlopen((f), 1)
#define pg_dlsym dlsym
void *dlsym(void *handle, const char *symbol);
void *dlopen(const char *path, int mode);
-#endif /* PORT_PROTOS_H */
+#endif /* PORT_PROTOS_H */
if (sem_init(sem, 1, 1) < 0)
elog(FATAL, "sem_init failed: %m");
}
-#endif /* USE_NAMED_POSIX_SEMAPHORES */
+#endif /* USE_NAMED_POSIX_SEMAPHORES */
/*
static PGSemaphore sharedSemas; /* array of PGSemaphoreData in shared memory */
static int numSharedSemas; /* number of PGSemaphoreDatas used so far */
static int maxSharedSemas; /* allocated size of PGSemaphoreData array */
-static IpcSemaphoreId *mySemaSets; /* IDs of sema sets acquired so far */
+static IpcSemaphoreId *mySemaSets; /* IDs of sema sets acquired so far */
static int numSemaSets; /* number of sema sets acquired so far */
static int maxSemaSets; /* allocated size of mySemaSets array */
-static IpcSemaphoreKey nextSemaKey; /* next key to try using */
+static IpcSemaphoreKey nextSemaKey; /* next key to try using */
static int nextSemaNumber; /* next free sem num in last sema set */
elog(PANIC, "out of memory");
numSemaSets = 0;
nextSemaKey = port * 1000;
- nextSemaNumber = SEMAS_PER_SET; /* force sema set alloc on 1st call */
+ nextSemaNumber = SEMAS_PER_SET; /* force sema set alloc on 1st call */
on_shmem_exit(ReleaseSemaphores, 0);
}
FreeFile(fp);
}
}
-#endif /* __linux__ */
+#endif /* __linux__ */
}
-#endif /* MAP_HUGETLB */
+#endif /* MAP_HUGETLB */
/*
* Creates an anonymous mmap()ed shared memory segment.
}
}
-#endif /* USE_ANONYMOUS_SHMEM */
+#endif /* USE_ANONYMOUS_SHMEM */
/*
* PGSharedMemoryCreate
UsedShmemSegID = 0;
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
/*
* PGSharedMemoryDetach
elog(FATAL, "could not get size for full pathname of datadir %s: error code %lu",
DataDir, GetLastError());
- retptr = malloc(bufsize + 18); /* 18 for Global\PostgreSQL: */
+ retptr = malloc(bufsize + 18); /* 18 for Global\PostgreSQL: */
if (retptr == NULL)
elog(FATAL, "could not allocate memory for shared memory name");
hmap = CreateFileMapping(INVALID_HANDLE_VALUE, /* Use the pagefile */
NULL, /* Default security attrs */
- PAGE_READWRITE, /* Memory is Read/Write */
- size_high, /* Size Upper 32 Bits */
- size_low, /* Size Lower 32 bits */
+ PAGE_READWRITE, /* Memory is Read/Write */
+ size_high, /* Size Upper 32 Bits */
+ size_low, /* Size Lower 32 bits */
szShareMem);
if (!hmap)
#define STATS_READ_DELAY 1000
/* the minimum allowed time between two awakenings of the launcher */
-#define MIN_AUTOVAC_SLEEPTIME 100.0 /* milliseconds */
-#define MAX_AUTOVAC_SLEEPTIME 300 /* seconds */
+#define MIN_AUTOVAC_SLEEPTIME 100.0 /* milliseconds */
+#define MAX_AUTOVAC_SLEEPTIME 300 /* seconds */
/* Flags to tell if we are in an autovacuum process */
static bool am_autovacuum_launcher = false;
/* Forget any pending QueryCancel or timeout request */
disable_all_timeouts(false);
- QueryCancelPending = false; /* second to avoid race condition */
+ QueryCancelPending = false; /* second to avoid race condition */
/* Report the error to the server log */
EmitErrorReport();
static void
bgworker_quickdie(SIGNAL_ARGS)
{
- sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
+ sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
PG_SETMASK(&BlockSig);
/*
if (!slot->in_use)
{
memcpy(&slot->worker, worker, sizeof(BackgroundWorker));
- slot->pid = InvalidPid; /* indicates not started yet */
+ slot->pid = InvalidPid; /* indicates not started yet */
slot->generation++;
slot->terminate = false;
generation = slot->generation;
*/
pqsignal(SIGHUP, BgSigHupHandler); /* set flag to read config file */
pqsignal(SIGINT, SIG_IGN);
- pqsignal(SIGTERM, ReqShutdownHandler); /* shutdown */
- pqsignal(SIGQUIT, bg_quickdie); /* hard crash time */
+ pqsignal(SIGTERM, ReqShutdownHandler); /* shutdown */
+ pqsignal(SIGQUIT, bg_quickdie); /* hard crash time */
pqsignal(SIGALRM, SIG_IGN);
pqsignal(SIGPIPE, SIG_IGN);
pqsignal(SIGUSR1, bgwriter_sigusr1_handler);
typedef struct
{
- pid_t checkpointer_pid; /* PID (0 if not started) */
+ pid_t checkpointer_pid; /* PID (0 if not started) */
slock_t ckpt_lck; /* protects all the ckpt_* fields */
int ckpt_flags; /* checkpoint flags, as defined in xlog.h */
- uint32 num_backend_writes; /* counts user backend buffer writes */
- uint32 num_backend_fsync; /* counts user backend fsync calls */
+ uint32 num_backend_writes; /* counts user backend buffer writes */
+ uint32 num_backend_fsync; /* counts user backend fsync calls */
int num_requests; /* current # of requests */
int max_requests; /* allocated array size */
* want to wait for the backends to exit, whereupon the postmaster will
* tell us it's okay to shut down (via SIGUSR2).
*/
- pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config
- * file */
- pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */
+ pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config file */
+ pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */
pqsignal(SIGTERM, SIG_IGN); /* ignore SIGTERM */
pqsignal(SIGQUIT, chkpt_quickdie); /* hard crash time */
pqsignal(SIGALRM, SIG_IGN);
pqsignal(SIGPIPE, SIG_IGN);
pqsignal(SIGUSR1, chkpt_sigusr1_handler);
- pqsignal(SIGUSR2, ReqShutdownHandler); /* request shutdown */
+ pqsignal(SIGUSR2, ReqShutdownHandler); /* request shutdown */
/*
* Reset some signals that are accepted by postmaster but not here
return result;
}
-#endif /* ! WIN32 */
+#endif /* ! WIN32 */
* Timer definitions.
* ----------
*/
-#define PGARCH_AUTOWAKE_INTERVAL 60 /* How often to force a poll of the
- * archive status directory; in
- * seconds. */
-#define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a
- * failed archiver; in seconds. */
+#define PGARCH_AUTOWAKE_INTERVAL 60 /* How often to force a poll of the
+ * archive status directory; in seconds. */
+#define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a
+ * failed archiver; in seconds. */
#define NUM_ARCHIVE_RETRIES 3
return postmaster_forkexec(ac, av);
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
/*
* Timer definitions.
* ----------
*/
-#define PGSTAT_STAT_INTERVAL 500 /* Minimum time between stats file
- * updates; in milliseconds. */
+#define PGSTAT_STAT_INTERVAL 500 /* Minimum time between stats file
+ * updates; in milliseconds. */
-#define PGSTAT_RETRY_DELAY 10 /* How long to wait between checks for
- * a new file; in milliseconds. */
+#define PGSTAT_RETRY_DELAY 10 /* How long to wait between checks for a
+ * new file; in milliseconds. */
#define PGSTAT_MAX_WAIT_TIME 10000 /* Maximum time to wait for a stats
* file update; in milliseconds. */
-#define PGSTAT_INQ_INTERVAL 640 /* How often to ping the collector for
- * a new file; in milliseconds. */
+#define PGSTAT_INQ_INTERVAL 640 /* How often to ping the collector for a
+ * new file; in milliseconds. */
-#define PGSTAT_RESTART_INTERVAL 60 /* How often to attempt to restart a
- * failed statistics collector; in
- * seconds. */
+#define PGSTAT_RESTART_INTERVAL 60 /* How often to attempt to restart a
+ * failed statistics collector; in
+ * seconds. */
#define PGSTAT_POLL_LOOP_COUNT (PGSTAT_MAX_WAIT_TIME / PGSTAT_RETRY_DELAY)
#define PGSTAT_INQ_LOOP_COUNT (PGSTAT_INQ_INTERVAL / PGSTAT_RETRY_DELAY)
{
int nest_level; /* subtransaction nest level */
struct PgStat_SubXactStatus *prev; /* higher-level subxact if any */
- PgStat_TableXactStatus *first; /* head of list for this subxact */
+ PgStat_TableXactStatus *first; /* head of list for this subxact */
} PgStat_SubXactStatus;
static PgStat_SubXactStatus *pgStatXactStack = NULL;
/* Record that's written to 2PC state file when pgstat state is persisted */
typedef struct TwoPhasePgStatRecord
{
- PgStat_Counter tuples_inserted; /* tuples inserted in xact */
- PgStat_Counter tuples_updated; /* tuples updated in xact */
- PgStat_Counter tuples_deleted; /* tuples deleted in xact */
+ PgStat_Counter tuples_inserted; /* tuples inserted in xact */
+ PgStat_Counter tuples_updated; /* tuples updated in xact */
+ PgStat_Counter tuples_deleted; /* tuples deleted in xact */
PgStat_Counter inserted_pre_trunc; /* tuples inserted prior to truncate */
PgStat_Counter updated_pre_trunc; /* tuples updated prior to truncate */
PgStat_Counter deleted_pre_trunc; /* tuples deleted prior to truncate */
return postmaster_forkexec(ac, av);
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
/*
msg.m_databaseid = MyDatabaseId;
pgstat_send(&msg, len);
}
-#endif /* NOT_USED */
+#endif /* NOT_USED */
/* ----------
/* Length of said timeout */
#define SIGKILL_CHILDREN_AFTER_SECS 5
-static bool ReachedNormalRunning = false; /* T if we've reached PM_RUN */
+static bool ReachedNormalRunning = false; /* T if we've reached PM_RUN */
-bool ClientAuthInProgress = false; /* T during new-client
- * authentication */
+bool ClientAuthInProgress = false; /* T during new-client
+ * authentication */
bool redirection_done = false; /* stderr redirected for syslogger? */
HANDLE procHandle;
DWORD procId;
} win32_deadchild_waitinfo;
-#endif /* WIN32 */
+#endif /* WIN32 */
static pid_t backend_forkexec(Port *port);
static pid_t internal_forkexec(int argc, char *argv[], Port *port);
static void ShmemBackendArrayAdd(Backend *bn);
static void ShmemBackendArrayRemove(Backend *bn);
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
#define StartupDataBase() StartChildProcess(StartupProcess)
#define StartBackgroundWriter() StartChildProcess(BgWriterProcess)
pqinitmask();
PG_SETMASK(&BlockSig);
- pqsignal_no_restart(SIGHUP, SIGHUP_handler); /* reread config file
- * and have children do
- * same */
+ pqsignal_no_restart(SIGHUP, SIGHUP_handler); /* reread config file and
+ * have children do same */
pqsignal_no_restart(SIGINT, pmdie); /* send SIGTERM and shut down */
- pqsignal_no_restart(SIGQUIT, pmdie); /* send SIGQUIT and die */
- pqsignal_no_restart(SIGTERM, pmdie); /* wait for children and shut
- * down */
+ pqsignal_no_restart(SIGQUIT, pmdie); /* send SIGQUIT and die */
+ pqsignal_no_restart(SIGTERM, pmdie); /* wait for children and shut down */
pqsignal(SIGALRM, SIG_IGN); /* ignored */
pqsignal(SIGPIPE, SIG_IGN); /* ignored */
- pqsignal_no_restart(SIGUSR1, sigusr1_handler); /* message from child
- * process */
- pqsignal_no_restart(SIGUSR2, dummy_handler); /* unused, reserve for
- * children */
- pqsignal_no_restart(SIGCHLD, reaper); /* handle child termination */
+ pqsignal_no_restart(SIGUSR1, sigusr1_handler); /* message from child
+ * process */
+ pqsignal_no_restart(SIGUSR2, dummy_handler); /* unused, reserve for
+ * children */
+ pqsignal_no_restart(SIGCHLD, reaper); /* handle child termination */
pqsignal(SIGTTIN, SIG_IGN); /* ignored */
pqsignal(SIGTTOU, SIG_IGN); /* ignored */
/* ignore SIGXFSZ, so that ulimit violations work like disk full */
rw->rw_backend = NULL;
rw->rw_pid = 0;
rw->rw_child_slot = 0;
- ReportBackgroundWorkerExit(&iter); /* report child death */
+ ReportBackgroundWorkerExit(&iter); /* report child death */
LogChildExit(EXIT_STATUS_0(exitstatus) ? DEBUG1 : LOG,
namebuf, pid, exitstatus);
/* And run the backend */
BackendRun(port);
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
if (pid < 0)
{
* of backends.
*/
bn->pid = pid;
- bn->bkend_type = BACKEND_TYPE_NORMAL; /* Can change later to WALSND */
+ bn->bkend_type = BACKEND_TYPE_NORMAL; /* Can change later to WALSND */
dlist_push_head(&BackendList, &bn->elem);
#ifdef EXEC_BACKEND
* Must do this now because authentication uses libpq to send messages.
*/
pq_init(); /* initialize libpq to talk to client */
- whereToSendOutput = DestRemote; /* now safe to ereport to client */
+ whereToSendOutput = DestRemote; /* now safe to ereport to client */
/*
* We arrange for a simple exit(1) if we receive SIGTERM or SIGQUIT or
return pi.dwProcessId;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
/* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0);
- AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
+ AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
}
if (strcmp(argv[1], "--forkavlauncher") == 0)
{
/* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0);
- AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
+ AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
}
if (strcmp(argv[1], "--forkavworker") == 0)
{
{
/* Do not want to attach to shared memory */
- PgArchiverMain(argc, argv); /* does not return */
+ PgArchiverMain(argc, argv); /* does not return */
}
if (strcmp(argv[1], "--forkcol") == 0)
{
/* Do not want to attach to shared memory */
- PgstatCollectorMain(argc, argv); /* does not return */
+ PgstatCollectorMain(argc, argv); /* does not return */
}
if (strcmp(argv[1], "--forklog") == 0)
{
/* Do not want to attach to shared memory */
- SysLoggerMain(argc, argv); /* does not return */
+ SysLoggerMain(argc, argv); /* does not return */
}
abort(); /* shouldn't get here */
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
/*
AuxiliaryProcessMain(ac, av);
ExitPostmaster(0);
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
if (pid < 0)
{
/* Mark the slot as empty */
ShmemBackendArray[i].pid = 0;
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
#ifdef WIN32
/* Queue SIGCHLD signal */
pg_queue_signal(SIGCHLD);
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
* Initialize one and only handle for monitoring postmaster death.
ereport(FATAL,
(errmsg_internal("could not duplicate postmaster handle: error code %lu",
GetLastError())));
-#endif /* WIN32 */
+#endif /* WIN32 */
}
*/
pqsignal(SIGHUP, StartupProcSigHupHandler); /* reload config file */
pqsignal(SIGINT, SIG_IGN); /* ignore query cancel */
- pqsignal(SIGTERM, StartupProcShutdownHandler); /* request shutdown */
+ pqsignal(SIGTERM, StartupProcShutdownHandler); /* request shutdown */
pqsignal(SIGQUIT, startupproc_quickdie); /* hard crash time */
InitializeTimeouts(); /* establishes SIGALRM handler */
pqsignal(SIGPIPE, SIG_IGN);
#ifdef EXEC_BACKEND
syslogger_parseArgs(argc, argv);
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
am_syslogger = true;
threadHandle = (HANDLE) _beginthreadex(NULL, 0, pipeThread, NULL, 0, NULL);
if (threadHandle == 0)
elog(FATAL, "could not create syslogger data transfer thread: %m");
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
* Remember active logfile's name. We recompute this from the reference
WAIT_EVENT_SYSLOGGER_MAIN);
EnterCriticalSection(&sysloggerSection);
-#endif /* WIN32 */
+#endif /* WIN32 */
if (pipe_eof_seen)
{
(long) _get_osfhandle(_fileno(syslogFile)));
else
strcpy(filenobuf, "0");
-#endif /* WIN32 */
+#endif /* WIN32 */
av[ac++] = filenobuf;
av[ac] = NULL;
setvbuf(syslogFile, NULL, PG_IOLBF, 0);
}
}
-#endif /* WIN32 */
+#endif /* WIN32 */
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
/* --------------------------------
_endthread();
return 0;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
* Open the csv log file - we do this opportunistically, because
csvlogFile = logfile_open(filename, "a", false);
- if (last_csv_file_name != NULL) /* probably shouldn't happen */
+ if (last_csv_file_name != NULL) /* probably shouldn't happen */
pfree(last_csv_file_name);
last_csv_file_name = filename;
* reasonable to treat like SIGTERM.
*/
pqsignal(SIGHUP, WalSigHupHandler); /* set flag to read config file */
- pqsignal(SIGINT, WalShutdownHandler); /* request shutdown */
- pqsignal(SIGTERM, WalShutdownHandler); /* request shutdown */
+ pqsignal(SIGINT, WalShutdownHandler); /* request shutdown */
+ pqsignal(SIGTERM, WalShutdownHandler); /* request shutdown */
pqsignal(SIGQUIT, wal_quickdie); /* hard crash time */
pqsignal(SIGALRM, SIG_IGN);
pqsignal(SIGPIPE, SIG_IGN);
* sleep time so as to reduce the server's idle power consumption.
*/
if (left_till_hibernate > 0)
- cur_timeout = WalWriterDelay; /* in ms */
+ cur_timeout = WalWriterDelay; /* in ms */
else
cur_timeout = WalWriterDelay * HIBERNATE_FACTOR;
low = middle + 1;
else
{
- rownum = cmr->rownum; /* found a match */
+ rownum = cmr->rownum; /* found a match */
break;
}
}
colorcomplement(struct nfa *nfa,
struct colormap *cm,
int type,
- struct state *of, /* complements of this guy's PLAIN
- * outarcs */
+ struct state *of, /* complements of this guy's PLAIN outarcs */
struct state *from,
struct state *to)
{
fprintf(f, "\\u%04lx", (long) c);
}
-#endif /* REG_DEBUG */
+#endif /* REG_DEBUG */
FAILW(REG_BADRPT);
switch (*v->now++)
{
- case CHR(':'): /* non-capturing paren */
+ case CHR(':'): /* non-capturing paren */
RETV('(', 0);
break;
- case CHR('#'): /* comment */
+ case CHR('#'): /* comment */
while (!ATEOS() && *v->now != CHR(')'))
v->now++;
if (!ATEOS())
assert(v->nexttype == v->lasttype);
return next(v);
break;
- case CHR('='): /* positive lookahead */
+ case CHR('='): /* positive lookahead */
NOTE(REG_ULOOKAROUND);
RETV(LACON, LATYPE_AHEAD_POS);
break;
- case CHR('!'): /* negative lookahead */
+ case CHR('!'): /* negative lookahead */
NOTE(REG_ULOOKAROUND);
RETV(LACON, LATYPE_AHEAD_NEG);
break;
FAILW(REG_BADRPT);
switch (*v->now++)
{
- case CHR('='): /* positive lookbehind */
+ case CHR('='): /* positive lookbehind */
NOTE(REG_ULOOKAROUND);
RETV(LACON, LATYPE_BEHIND_POS);
break;
- case CHR('!'): /* negative lookbehind */
+ case CHR('!'): /* negative lookbehind */
NOTE(REG_ULOOKAROUND);
RETV(LACON, LATYPE_BEHIND_NEG);
break;
break;
case CHR('x'):
NOTE(REG_UUNPORT);
- c = lexdigits(v, 16, 1, 255); /* REs >255 long outside spec */
+ c = lexdigits(v, 16, 1, 255); /* REs >255 long outside spec */
if (ISERR() || !CHR_IS_IN_RANGE(c))
FAILW(REG_EESCAPE);
RETV(PLAIN, c);
case CHR('9'):
save = v->now;
v->now--; /* put first digit back */
- c = lexdigits(v, 10, 1, 255); /* REs >255 long outside spec */
+ c = lexdigits(v, 10, 1, 255); /* REs >255 long outside spec */
if (ISERR())
FAILW(REG_EESCAPE);
/* ugly heuristic (first test is "exactly 1 digit?") */
* stop at embedded NULs!
*/
static int /* 0 for equal, nonzero for unequal */
-casecmp(const chr *x, const chr *y, /* strings to compare */
+casecmp(const chr *x, const chr *y, /* strings to compare */
size_t len) /* exact length of comparison */
{
for (; len > 0; len--, x++, y++)
nfa->eos[0] = nfa->eos[1] = COLORLESS;
nfa->parent = parent; /* Precedes newfstate so parent is valid. */
nfa->post = newfstate(nfa, '@'); /* number 0 */
- nfa->pre = newfstate(nfa, '>'); /* number 1 */
+ nfa->pre = newfstate(nfa, '>'); /* number 1 */
nfa->init = newstate(nfa); /* may become invalid later */
nfa->final = newstate(nfa);
}
assert(s->no != FREESTATE); /* we're still here */
- assert(s == leftend || s->nins != 0); /* and still reachable */
+ assert(s == leftend || s->nins != 0); /* and still reachable */
assert(s->nouts == 0); /* but have no outarcs */
s->tmp = NULL; /* we're done here */
if (NISERR())
return 0;
copyouts(nfa, to, s); /* duplicate outarcs */
- cparc(nfa, con, from, s); /* move constraint arc */
+ cparc(nfa, con, from, s); /* move constraint arc */
freearc(nfa, con);
if (NISERR())
return 0;
case CA('$', '$'):
case CA(AHEAD, AHEAD):
case CA(BEHIND, BEHIND):
- if (con->co == a->co) /* true duplication */
+ if (con->co == a->co) /* true duplication */
return SATISFIED;
return INCOMPATIBLE;
break;
static void
markreachable(struct nfa *nfa,
struct state *s,
- struct state *okay, /* consider only states with this mark */
- struct state *mark) /* the value to mark with */
+ struct state *okay, /* consider only states with this mark */
+ struct state *mark) /* the value to mark with */
{
struct arc *a;
if (aa == NULL)
fprintf(f, "?!?"); /* missing from in-chain */
}
-#endif /* REG_DEBUG */
+#endif /* REG_DEBUG */
/*
* dumpcnfa - dump a compacted NFA in human-readable form
fflush(f);
}
-#endif /* REG_DEBUG */
+#endif /* REG_DEBUG */
pg_regex_strategy = PG_REGEX_LOCALE_WIDE;
}
else
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
{
if (pg_regex_locale)
pg_regex_strategy = PG_REGEX_LOCALE_1BYTE_L;
/* parsing macros; most know that `v' is the struct vars pointer */
#define NEXT() (next(v)) /* advance by one token */
#define SEE(t) (v->nexttype == (t)) /* is next token this? */
-#define EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */
+#define EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */
#define VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */
#define ISERR() VISERR(v)
#define VERR(vv,e) ((vv)->nexttype = EOS, \
assert((size_t) subno < v->nsubs);
}
else
- atomtype = PLAIN; /* something that's not '(' */
+ atomtype = PLAIN; /* something that's not '(' */
NEXT();
/* need new endpoints because tree will contain pointers */
s = newstate(v->nfa);
/* if it's a backref, now is the time to replicate the subNFA */
if (atomtype == BACKREF)
{
- assert(atom->begin->nouts == 1); /* just the EMPTY */
+ assert(atom->begin->nouts == 1); /* just the EMPTY */
delsub(v->nfa, atom->begin, atom->end);
assert(v->subs[subno] != NULL);
if (atomtype == BACKREF)
{
/* special case: backrefs have internal quantifiers */
- EMPTYARC(s, atom->begin); /* empty prefix */
+ EMPTYARC(s, atom->begin); /* empty prefix */
/* just stuff everything into atom */
repeat(v, atom->begin, atom->end, m, n);
atom->min = (short) m;
else if (m == 1 && n == 1)
{
/* no/vacuous quantifier: done */
- EMPTYARC(s, atom->begin); /* empty prefix */
+ EMPTYARC(s, atom->begin); /* empty prefix */
/* rest of branch can be strung starting from atom->end */
s2 = atom->end;
}
assert(m >= 1 && m != DUPINF && n >= 1);
repeat(v, s, atom->begin, m - 1, (n == DUPINF) ? n : n - 1);
f = COMBINE(qprefer, atom->flags);
- t = subre(v, '.', f, s, atom->end); /* prefix and atom */
+ t = subre(v, '.', f, s, atom->end); /* prefix and atom */
NOERR();
t->left = subre(v, '=', PREF(f), s, atom->begin);
NOERR();
*/
static void
processlacon(struct vars *v,
- struct state *begin, /* start of parsed LACON sub-re */
+ struct state *begin, /* start of parsed LACON sub-re */
struct state *end, /* end of parsed LACON sub-re */
int latype,
struct state *lp, /* left state to hang it on */
sprintf(buf, "%p", t);
return buf;
}
-#endif /* REG_DEBUG */
+#endif /* REG_DEBUG */
#include "regc_lex.c"
matchuntil(struct vars *v,
struct dfa *d,
chr *probe, /* we want to know if a match ends here */
- struct sset **lastcss, /* state storage across calls */
+ struct sset **lastcss, /* state storage across calls */
chr **lastcp) /* state storage across calls */
{
chr *cp = *lastcp;
for (ca = cnfa->states[i]; ca->co != COLORLESS; ca++)
{
if (ca->co < cnfa->ncolors)
- continue; /* not a LACON arc */
+ continue; /* not a LACON arc */
if (ISBSET(d->work, ca->to))
- continue; /* arc would be a no-op anyway */
- sawlacons = 1; /* this LACON affects our result */
+ continue; /* arc would be a no-op anyway */
+ sawlacons = 1; /* this LACON affects our result */
if (!lacon(v, cnfa, cp, ca->co))
{
if (ISERR())
return NULL;
- continue; /* LACON arc cannot be traversed */
+ continue; /* LACON arc cannot be traversed */
}
if (ISERR())
return NULL;
FDEBUG(("zapping c%d's %ld outarc\n", (int) (p - d->ssets), (long) co));
p->outs[co] = NULL;
ap = p->inchain[co];
- p->inchain[co].ss = NULL; /* paranoia */
+ p->inchain[co].ss = NULL; /* paranoia */
}
ss->ins.ss = NULL;
{
const struct rerr *r;
const char *msg;
- char convbuf[sizeof(unk) + 50]; /* 50 = plenty for int */
+ char convbuf[sizeof(unk) + 50]; /* 50 = plenty for int */
size_t len;
int icode;
msg = convbuf;
break;
case REG_ITOA: /* convert number to name */
- icode = atoi(errbuf); /* not our problem if this fails */
+ icode = atoi(errbuf); /* not our problem if this fails */
for (r = rerrs; r->code >= 0; r++)
if (r->code == icode)
break;
v->details->rm_extend.rm_so = OFF(cold);
else
v->details->rm_extend.rm_so = OFF(v->stop);
- v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */
+ v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */
}
if (close == NULL) /* not found */
return REG_NOMATCH;
v->details->rm_extend.rm_so = OFF(cold);
else
v->details->rm_extend.rm_so = OFF(v->stop);
- v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */
+ v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */
}
if (v->nmatch == 1) /* no need for submatches */
return REG_OKAY;
v->details->rm_extend.rm_so = OFF(cold);
else
v->details->rm_extend.rm_so = OFF(v->stop);
- v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */
+ v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */
}
return ret;
}
break;
case '.': /* concatenation */
assert(t->left != NULL && t->right != NULL);
- if (t->left->flags & SHORTER) /* reverse scan */
+ if (t->left->flags & SHORTER) /* reverse scan */
er = crevcondissect(v, t, begin, end);
else
er = ccondissect(v, t, begin, end);
break;
case '*': /* iteration */
assert(t->left != NULL);
- if (t->left->flags & SHORTER) /* reverse scan */
+ if (t->left->flags & SHORTER) /* reverse scan */
er = creviterdissect(v, t, begin, end);
else
er = citerdissect(v, t, begin, end);
if (co <= 0 || co > cm->max) /* we reject 0 which is WHITE */
return -1;
- if (cm->cd[co].flags & PSEUDO) /* also pseudocolors (BOS etc) */
+ if (cm->cd[co].flags & PSEUDO) /* also pseudocolors (BOS etc) */
return -1;
/*
#include <unistd.h>
#include <time.h>
-#include "access/xlog_internal.h" /* for pg_start/stop_backup */
+#include "access/xlog_internal.h" /* for pg_start/stop_backup */
#include "catalog/catalog.h"
#include "catalog/pg_type.h"
#include "lib/stringinfo.h"
/* Send CopyOutResponse message */
pq_beginmessage(&buf, 'H');
- pq_sendbyte(&buf, 0); /* overall format */
- pq_sendint(&buf, 0, 2); /* natts */
+ pq_sendbyte(&buf, 0); /* overall format */
+ pq_sendint(&buf, 0, 2); /* natts */
pq_endmessage(&buf);
if (ti->path == NULL)
Assert(lnext(lc) == NULL);
}
else
- pq_putemptymessage('c'); /* CopyDone */
+ pq_putemptymessage('c'); /* CopyDone */
}
}
PG_END_ENSURE_ERROR_CLEANUP(base_backup_cleanup, (Datum) 0);
pq_sendstring(&buf, "recptr");
pq_sendint(&buf, 0, 4); /* table oid */
pq_sendint(&buf, 0, 2); /* attnum */
- pq_sendint(&buf, TEXTOID, 4); /* type oid */
+ pq_sendint(&buf, TEXTOID, 4); /* type oid */
pq_sendint(&buf, -1, 2);
pq_sendint(&buf, 0, 4);
pq_sendint(&buf, 0, 2);
* int8 may seem like a surprising data type for this, but in theory int4
* would not be wide enough for this, as TimeLineID is unsigned.
*/
- pq_sendint(&buf, INT8OID, 4); /* type oid */
+ pq_sendint(&buf, INT8OID, 4); /* type oid */
pq_sendint(&buf, -1, 2);
pq_sendint(&buf, 0, 4);
pq_sendint(&buf, 0, 2);
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("tablespaces are not supported on this platform")));
continue;
-#endif /* HAVE_READLINK */
+#endif /* HAVE_READLINK */
}
else if (S_ISDIR(statbuf.st_mode))
{
if (err)
elog(ERROR, "%s", err);
if (!record)
- elog(ERROR, "no record found"); /* shouldn't happen */
+ elog(ERROR, "no record found"); /* shouldn't happen */
startptr = InvalidXLogRecPtr;
/* Push callback + info on the error context stack */
state.ctx = ctx;
state.callback_name = "commit";
- state.report_location = txn->final_lsn; /* beginning of commit record */
+ state.report_location = txn->final_lsn; /* beginning of commit record */
errcallback.callback = output_plugin_error_callback;
errcallback.arg = (void *) &state;
errcallback.previous = error_context_stack;
} ReplicationStateCtl;
/* external variables */
-RepOriginId replorigin_session_origin = InvalidRepOriginId; /* assumed identity */
+RepOriginId replorigin_session_origin = InvalidRepOriginId; /* assumed identity */
XLogRecPtr replorigin_session_origin_lsn = InvalidXLogRecPtr;
TimestampTz replorigin_session_origin_timestamp = 0;
if (oldtuple != NULL)
{
if (rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL)
- pq_sendbyte(out, 'O'); /* old tuple follows */
+ pq_sendbyte(out, 'O'); /* old tuple follows */
else
- pq_sendbyte(out, 'K'); /* old key follows */
+ pq_sendbyte(out, 'K'); /* old key follows */
logicalrep_write_tuple(out, rel, oldtuple);
}
if (isnull[i])
{
- pq_sendbyte(out, 'n'); /* null column */
+ pq_sendbyte(out, 'n'); /* null column */
continue;
}
else if (att->attlen == -1 && VARATT_IS_EXTERNAL_ONDISK(values[i]))
{
- pq_sendbyte(out, 'u'); /* unchanged toast column */
+ pq_sendbyte(out, 'u'); /* unchanged toast column */
continue;
}
#include "replication/logical.h"
#include "replication/reorderbuffer.h"
#include "replication/slot.h"
-#include "replication/snapbuild.h" /* just for SnapBuildSnapDecRefcount */
+#include "replication/snapbuild.h" /* just for SnapBuildSnapDecRefcount */
#include "storage/bufmgr.h"
#include "storage/fd.h"
#include "storage/sinval.h"
Size num_chunks; /* number of chunks we've already seen */
Size size; /* combined size of chunks seen */
dlist_head chunks; /* linked list of chunks */
- struct varlena *reconstructed; /* reconstructed varlena now pointed
- * to in main tup */
+ struct varlena *reconstructed; /* reconstructed varlena now pointed to in
+ * main tup */
} ReorderBufferToastEnt;
/* Disk serialization support datastructures */
* major bottleneck, especially when spilling to disk while decoding batch
* workloads.
*/
-static const Size max_cached_tuplebufs = 4096 * 2; /* ~8MB */
+static const Size max_cached_tuplebufs = 4096 * 2; /* ~8MB */
/* ---------------------------------------
* primary reorderbuffer support routines
TransactionId was_xmax;
size_t was_xcnt; /* number of used xip entries */
- size_t was_xcnt_space; /* allocated size of xip */
+ size_t was_xcnt_space; /* allocated size of xip */
TransactionId *was_xip; /* running xacts array, xidComparator-sorted */
} was_running;
/* Other struct members initialized by zeroing via palloc0 above */
builder->committed.xcnt = 0;
- builder->committed.xcnt_space = 128; /* arbitrary number */
+ builder->committed.xcnt_space = 128; /* arbitrary number */
builder->committed.xip =
palloc0(builder->committed.xcnt_space * sizeof(TransactionId));
builder->committed.includes_all_transactions = true;
builder->start_decoding_at = lsn + 1;
/* As no transactions were running xmin/xmax can be trivially set. */
- builder->xmin = running->nextXid; /* < are finished */
- builder->xmax = running->nextXid; /* >= are running */
+ builder->xmin = running->nextXid; /* < are finished */
+ builder->xmax = running->nextXid; /* >= are running */
/* so we can safely use the faster comparisons */
Assert(TransactionIdIsNormal(builder->xmin));
* currently running transactions have finished. We'll update both
* while waiting for the pending transactions to finish.
*/
- builder->xmin = running->nextXid; /* < are finished */
- builder->xmax = running->nextXid; /* >= are running */
+ builder->xmin = running->nextXid; /* < are finished */
+ builder->xmax = running->nextXid; /* >= are running */
/* so we can safely use the faster comparisons */
Assert(TransactionIdIsNormal(builder->xmin));
* NAMEDATALEN on the remote that matters, but this scheme will also work
* reasonably if that is different.)
*/
- StaticAssertStmt(NAMEDATALEN >= 32, "NAMEDATALEN too small"); /* for sanity */
+ StaticAssertStmt(NAMEDATALEN >= 32, "NAMEDATALEN too small"); /* for sanity */
slotname = psprintf("%.*s_%u_sync_%u",
NAMEDATALEN - 28,
MySubscription->slotname,
resetStringInfo(reply_message);
pq_sendbyte(reply_message, 'r');
- pq_sendint64(reply_message, recvpos); /* write */
- pq_sendint64(reply_message, flushpos); /* flush */
- pq_sendint64(reply_message, writepos); /* apply */
+ pq_sendint64(reply_message, recvpos); /* write */
+ pq_sendint64(reply_message, flushpos); /* flush */
+ pq_sendint64(reply_message, writepos); /* apply */
pq_sendint64(reply_message, now); /* sendTime */
pq_sendbyte(reply_message, requestReply); /* replyRequested */
#define ReplicationSlotOnDiskV2Size \
sizeof(ReplicationSlotOnDisk) - ReplicationSlotOnDiskConstantSize
-#define SLOT_MAGIC 0x1051CA1 /* format identifier */
+#define SLOT_MAGIC 0x1051CA1 /* format identifier */
#define SLOT_VERSION 2 /* version for new files */
/* Control array for replication slot management */
* Create logical decoding context, to build the initial snapshot.
*/
ctx = CreateInitDecodingContext(NameStr(*plugin), NIL,
- false, /* do not build snapshot */
+ false, /* do not build snapshot */
logical_read_local_xlog_page, NULL, NULL,
NULL);
if (list_length(result) == SyncRepConfig->num_sync)
{
list_free(pending);
- return result; /* Exit if got enough sync standbys */
+ return result; /* Exit if got enough sync standbys */
}
/*
walrcv->latch = &MyProc->procLatch;
/* Properly accept or ignore signals the postmaster might send us */
- pqsignal(SIGHUP, WalRcvSigHupHandler); /* set flag to read config
- * file */
+ pqsignal(SIGHUP, WalRcvSigHupHandler); /* set flag to read config file */
pqsignal(SIGINT, SIG_IGN);
pqsignal(SIGTERM, WalRcvShutdownHandler); /* request shutdown */
pqsignal(SIGQUIT, WalRcvQuickDieHandler); /* hard crash time */
WalSnd *MyWalSnd = NULL;
/* Global state */
-bool am_walsender = false; /* Am I a walsender process? */
-bool am_cascading_walsender = false; /* Am I cascading WAL to
- * another standby? */
+bool am_walsender = false; /* Am I a walsender process? */
+bool am_cascading_walsender = false; /* Am I cascading WAL to another
+ * standby? */
bool am_db_walsender = false; /* Connected to a database? */
/* User-settable parameters for walsender */
int max_wal_senders = 0; /* the maximum number of concurrent
* walsenders */
-int wal_sender_timeout = 60 * 1000; /* maximum time to send one
- * WAL data message */
+int wal_sender_timeout = 60 * 1000; /* maximum time to send one WAL
+ * data message */
bool log_replication_commands = false;
/*
pq_sendstring(&buf, "filename"); /* col name */
pq_sendint(&buf, 0, 4); /* table oid */
pq_sendint(&buf, 0, 2); /* attnum */
- pq_sendint(&buf, TEXTOID, 4); /* type oid */
+ pq_sendint(&buf, TEXTOID, 4); /* type oid */
pq_sendint(&buf, -1, 2); /* typlen */
pq_sendint(&buf, 0, 4); /* typmod */
pq_sendint(&buf, 0, 2); /* format code */
/* second field */
- pq_sendstring(&buf, "content"); /* col name */
+ pq_sendstring(&buf, "content"); /* col name */
pq_sendint(&buf, 0, 4); /* table oid */
pq_sendint(&buf, 0, 2); /* attnum */
- pq_sendint(&buf, BYTEAOID, 4); /* type oid */
+ pq_sendint(&buf, BYTEAOID, 4); /* type oid */
pq_sendint(&buf, -1, 2); /* typlen */
pq_sendint(&buf, 0, 4); /* typmod */
pq_sendint(&buf, 0, 2); /* format code */
writePtr = pq_getmsgint64(&reply_message);
flushPtr = pq_getmsgint64(&reply_message);
applyPtr = pq_getmsgint64(&reply_message);
- (void) pq_getmsgint64(&reply_message); /* sendTime; not used ATM */
+ (void) pq_getmsgint64(&reply_message); /* sendTime; not used ATM */
replyRequested = pq_getmsgbyte(&reply_message);
elog(DEBUG2, "write %X/%X flush %X/%X apply %X/%X%s",
* byte. See XLogWalRcvSendHSFeedback() in walreceiver.c for the creation
* of this message.
*/
- (void) pq_getmsgint64(&reply_message); /* sendTime; not used ATM */
+ (void) pq_getmsgint64(&reply_message); /* sendTime; not used ATM */
feedbackXmin = pq_getmsgint(&reply_message, 4);
feedbackEpoch = pq_getmsgint(&reply_message, 4);
feedbackCatalogXmin = pq_getmsgint(&reply_message, 4);
* XXX: It might make sense to generalize the ephemeral slot concept and
* always use the slot mechanism to handle the feedback xmin.
*/
- if (MyReplicationSlot != NULL) /* XXX: persistency configurable? */
+ if (MyReplicationSlot != NULL) /* XXX: persistency configurable? */
PhysicalReplicationSlotNewXmin(feedbackXmin, feedbackCatalogXmin);
else
{
static long
WalSndComputeSleeptime(TimestampTz now)
{
- long sleeptime = 10000; /* 10 s */
+ long sleeptime = 10000; /* 10 s */
if (wal_sender_timeout > 0 && last_reply_timestamp > 0)
{
returning_flag);
rule_action->querySource = qsrc;
- rule_action->canSetTag = false; /* might change later */
+ rule_action->canSetTag = false; /* might change later */
results = lappend(results, rule_action);
}
updatable_cols = bms_int_members(updatable_cols, include_cols);
if (bms_is_empty(updatable_cols))
- auto_events = (1 << CMD_DELETE); /* May support DELETE */
+ auto_events = (1 << CMD_DELETE); /* May support DELETE */
else
- auto_events = ALL_EVENTS; /* May support all events */
+ auto_events = ALL_EVENTS; /* May support all events */
/*
* The base relation must also support these update commands.
* slightly more expensive than the previous checks.
*/
if (dependency_is_fully_matched(dependency, attnums))
- strongest = dependency; /* save new best match */
+ strongest = dependency; /* save new best match */
}
return strongest;
* not clear that there's enough of a problem to justify that.
*/
}
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
{
BufferTag newTag; /* identity of requested block */
uint32 newHash; /* hash value for newTag */
- LWLock *newPartitionLock; /* buffer partition lock for it */
+ LWLock *newPartitionLock; /* buffer partition lock for it */
BufferTag oldTag; /* previous identity of selected buffer */
uint32 oldHash; /* hash value for oldTag */
- LWLock *oldPartitionLock; /* buffer partition lock for it */
+ LWLock *oldPartitionLock; /* buffer partition lock for it */
uint32 oldFlags;
int buf_id;
BufferDesc *buf;
{
BufferTag oldTag;
uint32 oldHash; /* hash value for oldTag */
- LWLock *oldPartitionLock; /* buffer partition lock for it */
+ LWLock *oldPartitionLock; /* buffer partition lock for it */
uint32 oldFlags;
uint32 buf_state;
if (nnodes == 0)
return;
- nodes = palloc(sizeof(RelFileNode) * nnodes); /* non-local relations */
+ nodes = palloc(sizeof(RelFileNode) * nnodes); /* non-local relations */
/* If it's a local relation, it's localbuf.c's problem. */
for (i = 0; i < nnodes; i++)
/* Not in buffers, so initiate prefetch */
smgrprefetch(smgr, forkNum, blockNum);
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
getrlimit_status = getrlimit(RLIMIT_NOFILE, &rlim);
#else /* but BSD doesn't ... */
getrlimit_status = getrlimit(RLIMIT_OFILE, &rlim);
-#endif /* RLIMIT_NOFILE */
+#endif /* RLIMIT_NOFILE */
if (getrlimit_status != 0)
ereport(WARNING, (errmsg("getrlimit failed: %m")));
-#endif /* HAVE_GETRLIMIT */
+#endif /* HAVE_GETRLIMIT */
/* dup until failure or probe limit reached */
for (;;)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "LEAST");
elog(LOG, "%s", buf);
}
-#endif /* FDDEBUG */
+#endif /* FDDEBUG */
static void
Delete(File file)
if (SizeVfdCache > 0)
{
- Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */
+ Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */
for (i = 1; i < SizeVfdCache; i++)
{
if (!FileIsNotOpen(i))
*/
if (isProcExit || have_xact_temporary_files)
{
- Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */
+ Assert(FileIsNotOpen(0)); /* Make sure ring not corrupted */
for (i = 1; i < SizeVfdCache; i++)
{
unsigned short fdstate = VfdCache[i].fdstate;
(void) CloseTransientFile(fd);
}
-#endif /* PG_FLUSH_DATA_WORKS */
+#endif /* PG_FLUSH_DATA_WORKS */
static void
datadir_fsync_fname(const char *fname, bool isdir, int elevel)
hmap = CreateFileMapping(INVALID_HANDLE_VALUE, /* Use the pagefile */
NULL, /* Default security attrs */
- PAGE_READWRITE, /* Memory is read/write */
- size_high, /* Upper 32 bits of size */
- size_low, /* Lower 32 bits of size */
+ PAGE_READWRITE, /* Memory is read/write */
+ size_high, /* Upper 32 bits of size */
+ size_low, /* Lower 32 bits of size */
name);
errcode = GetLastError();
/* Private function prototypes */
static void sendSelfPipeByte(void);
static void drainSelfPipe(void);
-#endif /* WIN32 */
+#endif /* WIN32 */
#if defined(WAIT_USE_EPOLL)
static void WaitEventAdjustEpoll(WaitEventSet *set, WaitEvent *event, int action);
latch->event = CreateEvent(NULL, TRUE, FALSE, NULL);
if (latch->event == NULL)
elog(ERROR, "CreateEvent failed: error code %lu", GetLastError());
-#endif /* WIN32 */
+#endif /* WIN32 */
}
/*
elog(ERROR, "epoll_create failed: %m");
if (fcntl(set->epoll_fd, F_SETFD, FD_CLOEXEC) == -1)
elog(ERROR, "fcntl(F_SETFD) failed on epoll descriptor: %m");
-#endif /* EPOLL_CLOEXEC */
+#endif /* EPOLL_CLOEXEC */
#elif defined(WAIT_USE_WIN32)
/*
if (waiting)
sendSelfPipeByte();
}
-#endif /* !WIN32 */
+#endif /* !WIN32 */
/* Send one byte to the self-pipe, to wake up WaitLatch */
#ifndef WIN32
return;
}
}
-#endif /* !WIN32 */
+#endif /* !WIN32 */
/*
* Read all available data from the self-pipe
/* else buffer wasn't big enough, so read again */
}
}
-#endif /* !WIN32 */
+#endif /* !WIN32 */
return false;
#else /* WIN32 */
return (WaitForSingleObject(PostmasterHandle, 0) == WAIT_TIMEOUT);
-#endif /* WIN32 */
+#endif /* WIN32 */
}
int numKnownAssignedXids; /* current # of valid entries */
int tailKnownAssignedXids; /* index of oldest valid element */
int headKnownAssignedXids; /* index of newest element, + 1 */
- slock_t known_assigned_xids_lck; /* protects head/tail pointers */
+ slock_t known_assigned_xids_lck; /* protects head/tail pointers */
/*
* Highest subxid that has been removed from KnownAssignedXids array to
#define xc_by_known_assigned_inc() ((void) 0)
#define xc_no_overflow_inc() ((void) 0)
#define xc_slow_answer_inc() ((void) 0)
-#endif /* XIDCACHE_DEBUG */
+#endif /* XIDCACHE_DEBUG */
/* Primitives for KnownAssignedXids array handling for standby */
static void KnownAssignedXidsCompress(bool force);
/* Keep the PGPROC array sorted. See notes above */
memmove(&arrayP->pgprocnos[index], &arrayP->pgprocnos[index + 1],
(arrayP->numProcs - index - 1) * sizeof(int));
- arrayP->pgprocnos[arrayP->numProcs - 1] = -1; /* for debugging */
+ arrayP->pgprocnos[arrayP->numProcs - 1] = -1; /* for debugging */
arrayP->numProcs--;
LWLockRelease(ProcArrayLock);
return;