/* 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
#include
-#endif /* DMETAPHONE_MAIN */
+#endif /* DMETAPHONE_MAIN */
#include
* 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
#include
#include
-#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
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 "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 "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
-#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
#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
-#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
-#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 "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
#include
-#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;
pgxact->xmin = InvalidTransactionId;
/* must be cleared with xid/xmin: */
pgxact->vacuumFlags &= ~PROC_VACUUM_STATE_MASK;
- pgxact->delayChkpt = false; /* be sure this is cleared in abort */
+ pgxact->delayChkpt = false; /* be sure this is cleared in abort */
proc->recoveryConflictPending = false;
Assert(pgxact->nxids == 0);
if (allDbs ||
proc->databaseId == MyDatabaseId ||
- proc->databaseId == 0) /* always include WalSender */
+ proc->databaseId == 0) /* always include WalSender */
{
/* Fetch xid just once - see GetNewTransactionId */
TransactionId xid = pgxact->xid;
xc_no_overflow,
xc_slow_answer);
}
-#endif /* XIDCACHE_DEBUG */
+#endif /* XIDCACHE_DEBUG */
/* ----------------------------------------------
/* shared memory global variables */
-static PGShmemHeader *ShmemSegHdr; /* shared mem segment header */
+static PGShmemHeader *ShmemSegHdr; /* shared mem segment header */
static void *ShmemBase; /* start address of shared memory */
* for NULL.
*/
HTAB *
-ShmemInitHash(const char *name, /* table string name for shmem index */
+ShmemInitHash(const char *name, /* table string name for shmem index */
long init_size, /* initial table size */
long max_size, /* max size of the table */
HASHCTL *infoP, /* info about key and bucket size */
/* Mark all backends inactive, and initialize nextLXID */
for (i = 0; i < shmInvalBuffer->maxBackends; i++)
{
- shmInvalBuffer->procState[i].procPid = 0; /* inactive */
+ shmInvalBuffer->procState[i].procPid = 0; /* inactive */
shmInvalBuffer->procState[i].proc = NULL;
shmInvalBuffer->procState[i].nextMsgNum = 0; /* meaningless */
shmInvalBuffer->procState[i].resetState = false;
/* Look for a free entry in the procState array */
for (index = 0; index < segP->lastBackend; index++)
{
- if (segP->procState[index].procPid == 0) /* inactive slot? */
+ if (segP->procState[index].procPid == 0) /* inactive slot? */
{
stateP = &segP->procState[index];
break;
{
if ((oldtuple = systable_getnext_ordered(sd, ForwardScanDirection)) != NULL)
{
- if (HeapTupleHasNulls(oldtuple)) /* paranoia */
+ if (HeapTupleHasNulls(oldtuple)) /* paranoia */
elog(ERROR, "null field found in pg_largeobject");
olddata = (Form_pg_largeobject) GETSTRUCT(oldtuple);
Assert(olddata->pageno >= pageno);
olddata = NULL;
if ((oldtuple = systable_getnext_ordered(sd, ForwardScanDirection)) != NULL)
{
- if (HeapTupleHasNulls(oldtuple)) /* paranoia */
+ if (HeapTupleHasNulls(oldtuple)) /* paranoia */
elog(ERROR, "null field found in pg_largeobject");
olddata = (Form_pg_largeobject) GETSTRUCT(oldtuple);
Assert(olddata->pageno >= pageno);
FindLockCycleRecurseMember(PGPROC *checkProc,
PGPROC *checkProcLeader,
int depth,
- EDGE *softEdges, /* output argument */
- int *nSoftEdges) /* output argument */
+ EDGE *softEdges, /* output argument */
+ int *nSoftEdges) /* output argument */
{
PGPROC *proc;
LOCK *lock = checkProc->waitLock;
#define LOCK_PRINT(where, lock, type) ((void) 0)
#define PROCLOCK_PRINT(where, proclockP) ((void) 0)
-#endif /* not LOCK_DEBUG */
+#endif /* not LOCK_DEBUG */
static uint32 proclock_hash(const void *key, Size keysize);
/*
* Find the LOCALLOCK entry for this lock and lockmode
*/
- MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */
+ MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */
localtag.lock = *locktag;
localtag.mode = lockmode;
/*
* Find or create a LOCALLOCK entry for this lock and lockmode
*/
- MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */
+ MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */
localtag.lock = *locktag;
localtag.mode = lockmode;
}
}
}
-#endif /* CHECK_DEADLOCK_RISK */
+#endif /* CHECK_DEADLOCK_RISK */
}
/*
/*
* Find the LOCALLOCK entry for this lock and lockmode
*/
- MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */
+ MemSet(&localtag, 0, sizeof(localtag)); /* must clear padding */
localtag.lock = *locktag;
localtag.mode = lockmode;
elog(LOG, "DumpAllLocks: proclock->tag.myLock = NULL");
}
}
-#endif /* LOCK_DEBUG */
+#endif /* LOCK_DEBUG */
/*
* LOCK 2PC resource manager's routines
#else /* not LOCK_DEBUG */
#define PRINT_LWDEBUG(a,b,c) ((void)0)
#define LOG_LWDEBUG(a,b,c) ((void)0)
-#endif /* LOCK_DEBUG */
+#endif /* LOCK_DEBUG */
#ifdef LWLOCK_STATS
}
return lwstats;
}
-#endif /* LWLOCK_STATS */
+#endif /* LWLOCK_STATS */
/*
lwstats->ex_acquire_count++;
else
lwstats->sh_acquire_count++;
-#endif /* LWLOCK_STATS */
+#endif /* LWLOCK_STATS */
/*
* We can't wait if we haven't got a PGPROC. This should only occur
* attempt to degrade performance (mostly as false positive serialization
* failure) gracefully in the face of memory pressurel
*/
-int max_predicate_locks_per_xact; /* set by guc.c */
+int max_predicate_locks_per_xact; /* set by guc.c */
int max_predicate_locks_per_relation; /* set by guc.c */
-int max_predicate_locks_per_page; /* set by guc.c */
+int max_predicate_locks_per_page; /* set by guc.c */
/*
* This provides a list of objects in order to track transactions
heapId = relation->rd_index->indrelid;
}
Assert(heapId != InvalidOid);
- Assert(transfer || !isIndex); /* index OID only makes sense with
- * transfer */
+ Assert(transfer || !isIndex); /* index OID only makes sense with
+ * transfer */
/* Retrieve first time needed, then keep. */
heaptargettaghash = 0;
if (++(status->delays) > NUM_DELAYS)
s_lock_stuck(status->file, status->line, status->func);
- if (status->cur_delay == 0) /* first time to delay? */
+ if (status->cur_delay == 0) /* first time to delay? */
status->cur_delay = MIN_DELAY_USEC;
pg_usleep(status->cur_delay);
_success: \n\
moveq #0,d0 \n\
rts \n"
-#endif /* __NetBSD__ && __ELF__ */
+#endif /* __NetBSD__ && __ELF__ */
);
}
-#endif /* __m68k__ && !__linux__ */
-#endif /* not __GNUC__ */
-#endif /* HAVE_SPINLOCKS */
+#endif /* __m68k__ && !__linux__ */
+#endif /* not __GNUC__ */
+#endif /* HAVE_SPINLOCKS */
return 1;
}
-#endif /* S_LOCK_TEST */
+#endif /* S_LOCK_TEST */
return !PGSemaphoreTryLock(SpinlockSemaArray[lockndx - 1]);
}
-#endif /* !HAVE_SPINLOCKS */
+#endif /* !HAVE_SPINLOCKS */
else
{
if (offsetNumber < limit)
- needshuffle = true; /* need to move existing linp's */
+ needshuffle = true; /* need to move existing linp's */
}
}
else
}
else
{
- itemidptr->offsetindex = nused; /* where it will go */
+ itemidptr->offsetindex = nused; /* where it will go */
itemidptr->itemoff = offset;
itemidptr->alignedlen = MAXALIGN(size);
totallen += itemidptr->alignedlen;
static HTAB *pendingOpsTable = NULL;
static List *pendingUnlinks = NIL;
-static MemoryContext pendingOpsCxt; /* context for the above */
+static MemoryContext pendingOpsCxt; /* context for the above */
static CycleCtr mdsync_cycle_ctr = 0;
static CycleCtr mdckpt_cycle_ctr = 0;
Assert(seekpos < (off_t) BLCKSZ * RELSEG_SIZE);
(void) FilePrefetch(v->mdfd_vfd, seekpos, BLCKSZ, WAIT_EVENT_DATA_FILE_PREFETCH);
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
/*
typedef struct f_smgr
{
void (*smgr_init) (void); /* may be NULL */
- void (*smgr_shutdown) (void); /* may be NULL */
+ void (*smgr_shutdown) (void); /* may be NULL */
void (*smgr_close) (SMgrRelation reln, ForkNumber forknum);
void (*smgr_create) (SMgrRelation reln, ForkNumber forknum,
bool isRedo);
void (*smgr_truncate) (SMgrRelation reln, ForkNumber forknum,
BlockNumber nblocks);
void (*smgr_immedsync) (SMgrRelation reln, ForkNumber forknum);
- void (*smgr_pre_ckpt) (void); /* may be NULL */
+ void (*smgr_pre_ckpt) (void); /* may be NULL */
void (*smgr_sync) (void); /* may be NULL */
- void (*smgr_post_ckpt) (void); /* may be NULL */
+ void (*smgr_post_ckpt) (void); /* may be NULL */
} f_smgr;
Oid namespace; /* other stuff from pg_proc */
Oid rettype;
Oid argtypes[FUNC_MAX_ARGS];
- char fname[NAMEDATALEN]; /* function name for logging */
+ char fname[NAMEDATALEN]; /* function name for logging */
};
if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
(void) pq_getmsgstring(msgBuf); /* dummy string */
- fid = (Oid) pq_getmsgint(msgBuf, 4); /* function oid */
+ fid = (Oid) pq_getmsgint(msgBuf, 4); /* function oid */
/*
* There used to be a lame attempt at caching lookup info here. Now we
/* assorted command-line switches */
static const char *userDoption = NULL; /* -D switch */
static bool EchoQuery = false; /* -E switch */
-static bool UseSemiNewlineNewline = false; /* -j switch */
+static bool UseSemiNewlineNewline = false; /* -j switch */
/* whether or not, and why, we were canceled by conflict with recovery */
static bool RecoveryConflictPending = false;
Query *query;
List *querytree_list;
- Assert(query_string != NULL); /* required as of 8.4 */
+ Assert(query_string != NULL); /* required as of 8.4 */
TRACE_POSTGRESQL_QUERY_REWRITE_START(query_string);
*/
static void
exec_parse_message(const char *query_string, /* string to execute */
- const char *stmt_name, /* name for prepared stmt */
- Oid *paramTypes, /* parameter types */
- int numParams) /* number of parameters */
+ const char *stmt_name, /* name for prepared stmt */
+ Oid *paramTypes, /* parameter types */
+ int numParams) /* number of parameters */
{
MemoryContext unnamed_stmt_context = NULL;
MemoryContext oldcontext;
}
else
{
- pbuf.data = NULL; /* keep compiler quiet */
+ pbuf.data = NULL; /* keep compiler quiet */
csave = 0;
}
if (pstring && pstring != pbuf.data)
pfree(pstring);
}
- else if (pformat == 1) /* binary mode */
+ else if (pformat == 1) /* binary mode */
{
Oid typreceive;
Oid typioparam;
void
quickdie(SIGNAL_ARGS)
{
- sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
+ sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
PG_SETMASK(&BlockSig);
/*
if (ProcDiePending)
{
ProcDiePending = false;
- QueryCancelPending = false; /* ProcDie trumps QueryCancel */
+ QueryCancelPending = false; /* ProcDie trumps QueryCancel */
LockErrorCleanup();
/* As in quickdie, don't risk sending to client during auth */
if (ClientAuthInProgress && whereToSendOutput == DestRemote)
}
if (ClientConnectionLost)
{
- QueryCancelPending = false; /* lost connection trumps QueryCancel */
+ QueryCancelPending = false; /* lost connection trumps QueryCancel */
LockErrorCleanup();
/* don't send to client, we already know the connection to be dead. */
whereToSendOutput = DestNone;
*/
if (RecoveryConflictPending && DoingCommandRead)
{
- QueryCancelPending = false; /* this trumps QueryCancel */
+ QueryCancelPending = false; /* this trumps QueryCancel */
RecoveryConflictPending = false;
LockErrorCleanup();
pgstat_report_recovery_conflict(RecoveryConflictReason);
*/
if (lock_timeout_occurred && stmt_timeout_occurred &&
get_timeout_finish_time(STATEMENT_TIMEOUT) < get_timeout_finish_time(LOCK_TIMEOUT))
- lock_timeout_occurred = false; /* report stmt timeout */
+ lock_timeout_occurred = false; /* report stmt timeout */
if (lock_timeout_occurred)
{
return ret;
}
#endif
-#endif /* IA64 */
+#endif /* IA64 */
/*
if (stack_depth > max_stack_depth_bytes &&
register_stack_base_ptr != NULL)
return true;
-#endif /* IA64 */
+#endif /* IA64 */
return false;
}
switch (arg[0])
{
case 'p':
- if (optarg[1] == 'a') /* "parser" */
+ if (optarg[1] == 'a') /* "parser" */
return "log_parser_stats";
else if (optarg[1] == 'l') /* "planner" */
return "log_planner_stats";
}
else
{
- gucsource = PGC_S_CLIENT; /* switches came from client */
+ gucsource = PGC_S_CLIENT; /* switches came from client */
}
#ifdef HAVE_INT_OPTERR
WalSndSignals();
else
{
- pqsignal(SIGHUP, PostgresSigHupHandler); /* set flag to read
- * config file */
- pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */
+ pqsignal(SIGHUP, PostgresSigHupHandler); /* set flag to read config
+ * file */
+ pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */
pqsignal(SIGTERM, die); /* cancel current query and exit */
/*
* rather than quickdie().
*/
if (IsUnderPostmaster)
- pqsignal(SIGQUIT, quickdie); /* hard crash time */
+ pqsignal(SIGQUIT, quickdie); /* hard crash time */
else
- pqsignal(SIGQUIT, die); /* cancel current query and exit */
+ pqsignal(SIGQUIT, die); /* cancel current query and exit */
InitializeTimeouts(); /* establishes SIGALRM handler */
/*
* Reset some signals that are accepted by postmaster but not by
* backend
*/
- pqsignal(SIGCHLD, SIG_DFL); /* system() requires this on some
- * platforms */
+ pqsignal(SIGCHLD, SIG_DFL); /* system() requires this on some
+ * platforms */
}
pqinitmask();
* forgetting a timeout cancel.
*/
disable_all_timeouts(false);
- QueryCancelPending = false; /* second to avoid race condition */
+ QueryCancelPending = false; /* second to avoid race condition */
/* Not reading from the client anymore. */
DoingCommandRead = false;
}
if (whereToSendOutput == DestRemote)
- pq_putemptymessage('3'); /* CloseComplete */
+ pq_putemptymessage('3'); /* CloseComplete */
}
break;
r.ru_nvcsw - Save_r.ru_nvcsw,
r.ru_nivcsw - Save_r.ru_nivcsw,
r.ru_nvcsw, r.ru_nivcsw);
-#endif /* HAVE_GETRUSAGE */
+#endif /* HAVE_GETRUSAGE */
/* remove trailing newline */
if (str.data[str.len - 1] == '\n')
QueryDesc *qd = (QueryDesc *) palloc(sizeof(QueryDesc));
qd->operation = plannedstmt->commandType; /* operation */
- qd->plannedstmt = plannedstmt; /* plan */
+ qd->plannedstmt = plannedstmt; /* plan */
qd->sourceText = sourceText; /* query text */
qd->snapshot = RegisterSnapshot(snapshot); /* snapshot */
/* RI check snapshot */
qd->dest = dest; /* output dest */
qd->params = params; /* parameter values passed into query */
qd->queryEnv = queryEnv;
- qd->instrument_options = instrument_options; /* instrumentation
- * wanted? */
+ qd->instrument_options = instrument_options; /* instrumentation wanted? */
/* null these fields until set by ExecutorStart */
qd->tupDesc = NULL;
if (!ScanDirectionIsNoMovement(direction))
{
if (nprocessed > 0)
- portal->atStart = false; /* OK to go backward now */
+ portal->atStart = false; /* OK to go backward now */
if (count == 0 || nprocessed < (uint64) count)
portal->atEnd = true; /* we retrieved 'em all */
portal->portalPos += nprocessed;
*/
switch (stmt->subtype)
{
- case 'T': /* ALTER DOMAIN DEFAULT */
+ case 'T': /* ALTER DOMAIN DEFAULT */
/*
* Recursively alter column default for table and,
AlterDomainDefault(stmt->typeName,
stmt->def);
break;
- case 'N': /* ALTER DOMAIN DROP NOT NULL */
+ case 'N': /* ALTER DOMAIN DROP NOT NULL */
address =
AlterDomainNotNull(stmt->typeName,
false);
break;
- case 'O': /* ALTER DOMAIN SET NOT NULL */
+ case 'O': /* ALTER DOMAIN SET NOT NULL */
address =
AlterDomainNotNull(stmt->typeName,
true);
break;
- case 'C': /* ADD CONSTRAINT */
+ case 'C': /* ADD CONSTRAINT */
address =
AlterDomainAddConstraint(stmt->typeName,
stmt->def,
&secondaryObject);
break;
- case 'X': /* DROP CONSTRAINT */
+ case 'X': /* DROP CONSTRAINT */
address =
AlterDomainDropConstraint(stmt->typeName,
stmt->name,
stmt->behavior,
stmt->missing_ok);
break;
- case 'V': /* VALIDATE CONSTRAINT */
+ case 'V': /* VALIDATE CONSTRAINT */
address =
AlterDomainValidateConstraint(stmt->typeName,
stmt->name);
/* ... and do it */
EventTriggerAlterTableStart(parsetree);
address =
- DefineIndex(relid, /* OID of heap relation */
+ DefineIndex(relid, /* OID of heap relation */
stmt,
InvalidOid, /* no predefined OID */
- false, /* is_alter_table */
- true, /* check_rights */
- true, /* check_not_in_use */
- false, /* skip_build */
- false); /* quiet */
+ false, /* is_alter_table */
+ true, /* check_rights */
+ true, /* check_not_in_use */
+ false, /* skip_build */
+ false); /* quiet */
/*
* Add the CREATE INDEX node itself to stash right away;
}
break;
- case T_CreateEnumStmt: /* CREATE TYPE AS ENUM */
+ case T_CreateEnumStmt: /* CREATE TYPE AS ENUM */
address = DefineEnum((CreateEnumStmt *) parsetree);
break;
- case T_CreateRangeStmt: /* CREATE TYPE AS RANGE */
+ case T_CreateRangeStmt: /* CREATE TYPE AS RANGE */
address = DefineRange((CreateRangeStmt *) parsetree);
break;
- case T_AlterEnumStmt: /* ALTER TYPE (enum) */
+ case T_AlterEnumStmt: /* ALTER TYPE (enum) */
address = AlterEnum((AlterEnumStmt *) parsetree);
break;
address = CreatePolicy((CreatePolicyStmt *) parsetree);
break;
- case T_AlterPolicyStmt: /* ALTER POLICY */
+ case T_AlterPolicyStmt: /* ALTER POLICY */
address = AlterPolicy((AlterPolicyStmt *) parsetree);
break;
return false;
portal = GetPortalByName(stmt->portalname);
if (!PortalIsValid(portal))
- return false; /* not our business to raise error */
+ return false; /* not our business to raise error */
return portal->tupDesc ? true : false;
}
entry = FetchPreparedStatement(stmt->name, false);
if (!entry)
- return false; /* not our business to raise error */
+ return false; /* not our business to raise error */
if (entry->plansource->resultDesc)
return true;
return false;
case T_SelectStmt:
if (((SelectStmt *) parsetree)->intoClause)
- lev = LOGSTMT_DDL; /* SELECT INTO */
+ lev = LOGSTMT_DDL; /* SELECT INTO */
else
lev = LOGSTMT_ALL;
break;
{
TSLexeme *ptr;
- if (strcmp(d->wrds[i].lexeme, "?") == 0) /* Is stop word marker? */
+ if (strcmp(d->wrds[i].lexeme, "?") == 0) /* Is stop word marker? */
newwrds = addCompiledLexeme(newwrds, &nnw, &tnm, NULL, d->wrds[i].entries, 0);
else
{
*next = '\0';
- return (state == PAE_INMASK); /* OK if we got a nonempty field */
+ return (state == PAE_INMASK); /* OK if we got a nonempty field */
}
/*
{
int clen = pg_mblen(ptr);
wchar_t character[2];
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
if (clen == 1 || lc_ctype_is_c(collation))
{
int clen = pg_mblen(ptr);
wchar_t character[2];
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
if (clen == 1 || lc_ctype_is_c(collation))
{
int clen = pg_mblen(ptr);
wchar_t character[2];
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
if (clen == 1 || lc_ctype_is_c(collation))
{
int clen = pg_mblen(ptr);
wchar_t character[2];
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
if (clen == 1 || lc_ctype_is_c(collation))
return iswprint((wint_t) character[0]);
}
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
/*
char *out;
#ifdef USE_WIDE_UPPER_LOWER
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
#endif
Assert(wlen < len);
}
else
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
{
const char *ptr = str;
char *outptr;
stats->stats_valid = true;
stats->stanullfrac = 1.0;
stats->stawidth = 0; /* "unknown" */
- stats->stadistinct = 0.0; /* "unknown" */
+ stats->stadistinct = 0.0; /* "unknown" */
}
/*
/* forward declaration */
struct TParser;
-typedef int (*TParserCharTest) (struct TParser *); /* any p_is* functions
- * except p_iseq */
-typedef void (*TParserSpecial) (struct TParser *); /* special handler for
- * special cases... */
+typedef int (*TParserCharTest) (struct TParser *); /* any p_is* functions
+ * except p_iseq */
+typedef void (*TParserSpecial) (struct TParser *); /* special handler for
+ * special cases... */
typedef struct
{
if (prs->charmaxlen > 1)
{
Oid collation = DEFAULT_COLLATION_OID; /* TODO */
- pg_locale_t mylocale = 0; /* TODO */
+ pg_locale_t mylocale = 0; /* TODO */
prs->usewide = true;
if (lc_ctype_is_c(collation))
p_iswhat(alnum)
p_iswhat(alpha)
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
p_iswhat(digit)
p_iswhat(lower)
*/
typedef struct
{
- const TParserStateActionItem *action; /* the actual state info */
+ const TParserStateActionItem *action; /* the actual state info */
TParserState state; /* only for Assert crosscheck */
#ifdef WPARSER_TRACE
const char *state_name; /* only for debug printout */
break;
default:
elog(ERROR, "unrecognized objtype: %d", (int) objtype);
- world_default = ACL_NO_RIGHTS; /* keep compiler quiet */
+ world_default = ACL_NO_RIGHTS; /* keep compiler quiet */
owner_default = ACL_NO_RIGHTS;
break;
}
/*
* Now safe to assign to state variable
*/
- cached_privs_role = InvalidOid; /* just paranoia */
+ cached_privs_role = InvalidOid; /* just paranoia */
list_free(cached_privs_roles);
cached_privs_roles = new_cached_privs_roles;
cached_privs_role = roleid;
else
{
if (cmp == 0)
- match = true; /* mcelem is found */
+ match = true; /* mcelem is found */
break;
}
}
array_in(PG_FUNCTION_ARGS)
{
char *string = PG_GETARG_CSTRING(0); /* external form */
- Oid element_type = PG_GETARG_OID(1); /* type of an array
- * element */
+ Oid element_type = PG_GETARG_OID(1); /* type of an array
+ * element */
int32 typmod = PG_GETARG_INT32(2); /* typmod for array elements */
int typlen;
bool typbyval;
/* count data plus backslashes; detect chars needing quotes */
if (values[i][0] == '\0')
- needquote = true; /* force quotes for empty string */
+ needquote = true; /* force quotes for empty string */
else if (pg_strcasecmp(values[i], "NULL") == 0)
- needquote = true; /* force quotes for literal NULL */
+ needquote = true; /* force quotes for literal NULL */
else
needquote = false;
dim[0] += addedbefore;
lb[0] = indx[0];
if (addedbefore > 1)
- newhasnulls = true; /* will insert nulls */
+ newhasnulls = true; /* will insert nulls */
}
if (indx[0] >= (dim[0] + lb[0]))
{
addedafter = indx[0] - (dim[0] + lb[0]) + 1;
dim[0] += addedafter;
if (addedafter > 1)
- newhasnulls = true; /* will insert nulls */
+ newhasnulls = true; /* will insert nulls */
}
}
else
lb[0] = indx[0];
dimschanged = true;
if (addedbefore > 1)
- newhasnulls = true; /* will insert nulls */
+ newhasnulls = true; /* will insert nulls */
}
if (indx[0] >= (dim[0] + lb[0]))
{
dim[0] += addedafter;
dimschanged = true;
if (addedafter > 1)
- newhasnulls = true; /* will insert nulls */
+ newhasnulls = true; /* will insert nulls */
}
}
else
if (lowerIndx[0] < lb[0])
{
if (upperIndx[0] < lb[0] - 1)
- newhasnulls = true; /* will insert nulls */
+ newhasnulls = true; /* will insert nulls */
addedbefore = lb[0] - lowerIndx[0];
dim[0] += addedbefore;
lb[0] = lowerIndx[0];
if (upperIndx[0] >= (dim[0] + lb[0]))
{
if (lowerIndx[0] > (dim[0] + lb[0]))
- newhasnulls = true; /* will insert nulls */
+ newhasnulls = true; /* will insert nulls */
addedafter = upperIndx[0] - (dim[0] + lb[0]) + 1;
dim[0] += addedafter;
}
ndim, dim, lb,
lowerIndx, upperIndx,
elmlen, elmbyval, elmalign);
- lenbefore = lenafter = 0; /* keep compiler quiet */
+ lenbefore = lenafter = 0; /* keep compiler quiet */
itemsbefore = itemsafter = nolditems = 0;
}
else
MemoryContextAlloc(arr_context, sizeof(ArrayBuildState));
astate->mcontext = arr_context;
astate->private_cxt = subcontext;
- astate->alen = (subcontext ? 64 : 8); /* arbitrary starting array
- * size */
+ astate->alen = (subcontext ? 64 : 8); /* arbitrary starting array size */
astate->dvalues = (Datum *)
MemoryContextAlloc(arr_context, astate->alen * sizeof(Datum));
astate->dnulls = (bool *)
bool subcontext)
{
ArrayBuildStateArr *astate;
- MemoryContext arr_context = rcontext; /* by default use the parent
- * ctx */
+ MemoryContext arr_context = rcontext; /* by default use the parent ctx */
/* Lookup element type, unless element_type already provided */
if (!OidIsValid(element_type))
static text *
encode_to_ascii(text *data, int enc)
{
- pg_to_ascii((unsigned char *) VARDATA(data), /* src */
- (unsigned char *) (data) + VARSIZE(data), /* src end */
- (unsigned char *) VARDATA(data), /* dest */
+ pg_to_ascii((unsigned char *) VARDATA(data), /* src */
+ (unsigned char *) (data) + VARSIZE(data), /* src end */
+ (unsigned char *) VARDATA(data), /* dest */
enc); /* encoding */
return data;
val = (uint64) value;
m0 = val % INT64CONST(100); /* cents */
- m1 = (val / INT64CONST(100)) % 1000; /* hundreds */
- m2 = (val / INT64CONST(100000)) % 1000; /* thousands */
+ m1 = (val / INT64CONST(100)) % 1000; /* hundreds */
+ m2 = (val / INT64CONST(100000)) % 1000; /* thousands */
m3 = (val / INT64CONST(100000000)) % 1000; /* millions */
- m4 = (val / INT64CONST(100000000000)) % 1000; /* billions */
+ m4 = (val / INT64CONST(100000000000)) % 1000; /* billions */
m5 = (val / INT64CONST(100000000000000)) % 1000; /* trillions */
m6 = (val / INT64CONST(100000000000000000)) % 1000; /* quadrillions */
DateADT result;
if (DATE_NOT_FINITE(dateVal))
- PG_RETURN_DATEADT(dateVal); /* can't change infinity */
+ PG_RETURN_DATEADT(dateVal); /* can't change infinity */
result = dateVal + days;
DateADT result;
if (DATE_NOT_FINITE(dateVal))
- PG_RETURN_DATEADT(dateVal); /* can't change infinity */
+ PG_RETURN_DATEADT(dateVal); /* can't change infinity */
result = dateVal - days;
/* token, type, value */
{EARLY, RESERV, DTK_EARLY}, /* "-infinity" reserved for "early time" */
{DA_D, ADBC, AD}, /* "ad" for years > 0 */
- {"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */
+ {"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */
{"am", AMPM, AM},
{"apr", MONTH, 4},
{"april", MONTH, 4},
{"friday", DOW, 5},
{"h", UNITS, DTK_HOUR}, /* "hour" */
{LATE, RESERV, DTK_LATE}, /* "infinity" reserved for "late time" */
- {INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */
- {"isodow", UNITS, DTK_ISODOW}, /* ISO day of week, Sunday == 7 */
+ {INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */
+ {"isodow", UNITS, DTK_ISODOW}, /* ISO day of week, Sunday == 7 */
{"isoyear", UNITS, DTK_ISOYEAR}, /* year in terms of the ISO week date */
{"j", UNITS, DTK_JULIAN},
{"jan", MONTH, 1},
{"@", IGNORE_DTF, 0}, /* postgres relative prefix */
{DAGO, AGO, 0}, /* "ago" indicates negative time offset */
{"c", UNITS, DTK_CENTURY}, /* "century" relative */
- {"cent", UNITS, DTK_CENTURY}, /* "century" relative */
+ {"cent", UNITS, DTK_CENTURY}, /* "century" relative */
{"centuries", UNITS, DTK_CENTURY}, /* "centuries" relative */
- {DCENTURY, UNITS, DTK_CENTURY}, /* "century" relative */
+ {DCENTURY, UNITS, DTK_CENTURY}, /* "century" relative */
{"d", UNITS, DTK_DAY}, /* "day" relative */
{DDAY, UNITS, DTK_DAY}, /* "day" relative */
{"days", UNITS, DTK_DAY}, /* "days" relative */
{"dec", UNITS, DTK_DECADE}, /* "decade" relative */
- {DDECADE, UNITS, DTK_DECADE}, /* "decade" relative */
- {"decades", UNITS, DTK_DECADE}, /* "decades" relative */
+ {DDECADE, UNITS, DTK_DECADE}, /* "decade" relative */
+ {"decades", UNITS, DTK_DECADE}, /* "decades" relative */
{"decs", UNITS, DTK_DECADE}, /* "decades" relative */
{"h", UNITS, DTK_HOUR}, /* "hour" relative */
{DHOUR, UNITS, DTK_HOUR}, /* "hour" relative */
{"hours", UNITS, DTK_HOUR}, /* "hours" relative */
{"hr", UNITS, DTK_HOUR}, /* "hour" relative */
{"hrs", UNITS, DTK_HOUR}, /* "hours" relative */
- {INVALID, RESERV, DTK_INVALID}, /* reserved for invalid time */
+ {INVALID, RESERV, DTK_INVALID}, /* reserved for invalid time */
{"m", UNITS, DTK_MINUTE}, /* "minute" relative */
- {"microsecon", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
- {"mil", UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
- {"millennia", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */
- {DMILLENNIUM, UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
- {"millisecon", UNITS, DTK_MILLISEC}, /* relative */
+ {"microsecon", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
+ {"mil", UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
+ {"millennia", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */
+ {DMILLENNIUM, UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
+ {"millisecon", UNITS, DTK_MILLISEC}, /* relative */
{"mils", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */
{"min", UNITS, DTK_MINUTE}, /* "minute" relative */
{"mins", UNITS, DTK_MINUTE}, /* "minutes" relative */
- {DMINUTE, UNITS, DTK_MINUTE}, /* "minute" relative */
- {"minutes", UNITS, DTK_MINUTE}, /* "minutes" relative */
+ {DMINUTE, UNITS, DTK_MINUTE}, /* "minute" relative */
+ {"minutes", UNITS, DTK_MINUTE}, /* "minutes" relative */
{"mon", UNITS, DTK_MONTH}, /* "months" relative */
{"mons", UNITS, DTK_MONTH}, /* "months" relative */
{DMONTH, UNITS, DTK_MONTH}, /* "month" relative */
{"mseconds", UNITS, DTK_MILLISEC},
{"msecs", UNITS, DTK_MILLISEC},
{"qtr", UNITS, DTK_QUARTER}, /* "quarter" relative */
- {DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */
+ {DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */
{"s", UNITS, DTK_SECOND},
{"sec", UNITS, DTK_SECOND},
{DSECOND, UNITS, DTK_SECOND},
{"secs", UNITS, DTK_SECOND},
{DTIMEZONE, UNITS, DTK_TZ}, /* "timezone" time offset */
{"timezone_h", UNITS, DTK_TZ_HOUR}, /* timezone hour units */
- {"timezone_m", UNITS, DTK_TZ_MINUTE}, /* timezone minutes units */
+ {"timezone_m", UNITS, DTK_TZ_MINUTE}, /* timezone minutes units */
{"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */
{"us", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
- {"usec", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
+ {"usec", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
{DMICROSEC, UNITS, DTK_MICROSEC}, /* "microsecond" relative */
{"useconds", UNITS, DTK_MICROSEC}, /* "microseconds" relative */
- {"usecs", UNITS, DTK_MICROSEC}, /* "microseconds" relative */
+ {"usecs", UNITS, DTK_MICROSEC}, /* "microseconds" relative */
{"w", UNITS, DTK_WEEK}, /* "week" relative */
{DWEEK, UNITS, DTK_WEEK}, /* "week" relative */
{"weeks", UNITS, DTK_WEEK}, /* "weeks" relative */
if (flen >= 3 && *is2digits)
{
/* Guess that first numeric field is day was wrong */
- *tmask = DTK_M(DAY); /* YEAR is already set */
+ *tmask = DTK_M(DAY); /* YEAR is already set */
tm->tm_mday = tm->tm_year;
tm->tm_year = val;
*is2digits = FALSE;
/* Configurable GUC parameter */
-int extra_float_digits = 0; /* Added to DBL_DIG or FLT_DIG */
+int extra_float_digits = 0; /* Added to DBL_DIG or FLT_DIG */
/* Cached constants for degree-based trig functions */
static bool degree_consts_set = false;
*/
#define cbrt my_cbrt
static double cbrt(double x);
-#endif /* HAVE_CBRT */
+#endif /* HAVE_CBRT */
/*
if (endptr != num && endptr[-1] == '\0')
endptr--;
}
-#endif /* HAVE_BUGGY_SOLARIS_STRTOD */
+#endif /* HAVE_BUGGY_SOLARIS_STRTOD */
/* skip trailing whitespace */
while (*endptr != '\0' && isspace((unsigned char) *endptr))
if (endptr != num && endptr[-1] == '\0')
endptr--;
}
-#endif /* HAVE_BUGGY_SOLARIS_STRTOD */
+#endif /* HAVE_BUGGY_SOLARIS_STRTOD */
/* skip trailing whitespace */
while (*endptr != '\0' && isspace((unsigned char) *endptr))
return isneg ? -tmpres : tmpres;
}
-#endif /* !HAVE_CBRT */
+#endif /* !HAVE_CBRT */
* Maximal length of one node
* ----------
*/
-#define DCH_MAX_ITEM_SIZ 12 /* max localized day name */
-#define NUM_MAX_ITEM_SIZ 8 /* roman number (RN has 15 chars) */
+#define DCH_MAX_ITEM_SIZ 12 /* max localized day name */
+#define NUM_MAX_ITEM_SIZ 8 /* roman number (RN has 15 chars) */
/* ----------
* More is in float.c
{"AM", 2, DCH_AM, FALSE, FROM_CHAR_DATE_NONE},
{"B.C.", 4, DCH_B_C, FALSE, FROM_CHAR_DATE_NONE}, /* B */
{"BC", 2, DCH_BC, FALSE, FROM_CHAR_DATE_NONE},
- {"CC", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* C */
+ {"CC", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* C */
{"DAY", 3, DCH_DAY, FALSE, FROM_CHAR_DATE_NONE}, /* D */
{"DDD", 3, DCH_DDD, TRUE, FROM_CHAR_DATE_GREGORIAN},
{"DD", 2, DCH_DD, TRUE, FROM_CHAR_DATE_GREGORIAN},
{"Day", 3, DCH_Day, FALSE, FROM_CHAR_DATE_NONE},
{"Dy", 2, DCH_Dy, FALSE, FROM_CHAR_DATE_NONE},
{"D", 1, DCH_D, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"FX", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* F */
+ {"FX", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* F */
{"HH24", 4, DCH_HH24, TRUE, FROM_CHAR_DATE_NONE}, /* H */
{"HH12", 4, DCH_HH12, TRUE, FROM_CHAR_DATE_NONE},
{"HH", 2, DCH_HH, TRUE, FROM_CHAR_DATE_NONE},
- {"IDDD", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* I */
+ {"IDDD", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* I */
{"ID", 2, DCH_ID, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"IW", 2, DCH_IW, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"IYYY", 4, DCH_IYYY, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"IY", 2, DCH_IY, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"I", 1, DCH_I, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"J", 1, DCH_J, TRUE, FROM_CHAR_DATE_NONE}, /* J */
- {"MI", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* M */
+ {"MI", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* M */
{"MM", 2, DCH_MM, TRUE, FROM_CHAR_DATE_GREGORIAN},
{"MONTH", 5, DCH_MONTH, FALSE, FROM_CHAR_DATE_GREGORIAN},
{"MON", 3, DCH_MON, FALSE, FROM_CHAR_DATE_GREGORIAN},
{"MS", 2, DCH_MS, TRUE, FROM_CHAR_DATE_NONE},
{"Month", 5, DCH_Month, FALSE, FROM_CHAR_DATE_GREGORIAN},
{"Mon", 3, DCH_Mon, FALSE, FROM_CHAR_DATE_GREGORIAN},
- {"OF", 2, DCH_OF, FALSE, FROM_CHAR_DATE_NONE}, /* O */
+ {"OF", 2, DCH_OF, FALSE, FROM_CHAR_DATE_NONE}, /* O */
{"P.M.", 4, DCH_P_M, FALSE, FROM_CHAR_DATE_NONE}, /* P */
{"PM", 2, DCH_PM, FALSE, FROM_CHAR_DATE_NONE},
{"Q", 1, DCH_Q, TRUE, FROM_CHAR_DATE_NONE}, /* Q */
{"RM", 2, DCH_RM, FALSE, FROM_CHAR_DATE_GREGORIAN}, /* R */
{"SSSS", 4, DCH_SSSS, TRUE, FROM_CHAR_DATE_NONE}, /* S */
{"SS", 2, DCH_SS, TRUE, FROM_CHAR_DATE_NONE},
- {"TZ", 2, DCH_TZ, FALSE, FROM_CHAR_DATE_NONE}, /* T */
- {"US", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* U */
+ {"TZ", 2, DCH_TZ, FALSE, FROM_CHAR_DATE_NONE}, /* T */
+ {"US", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* U */
{"WW", 2, DCH_WW, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* W */
{"W", 1, DCH_W, TRUE, FROM_CHAR_DATE_GREGORIAN},
{"Y,YYY", 5, DCH_Y_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* Y */
{"am", 2, DCH_am, FALSE, FROM_CHAR_DATE_NONE},
{"b.c.", 4, DCH_b_c, FALSE, FROM_CHAR_DATE_NONE}, /* b */
{"bc", 2, DCH_bc, FALSE, FROM_CHAR_DATE_NONE},
- {"cc", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* c */
+ {"cc", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* c */
{"day", 3, DCH_day, FALSE, FROM_CHAR_DATE_NONE}, /* d */
{"ddd", 3, DCH_DDD, TRUE, FROM_CHAR_DATE_GREGORIAN},
{"dd", 2, DCH_DD, TRUE, FROM_CHAR_DATE_GREGORIAN},
{"dy", 2, DCH_dy, FALSE, FROM_CHAR_DATE_NONE},
{"d", 1, DCH_D, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"fx", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* f */
+ {"fx", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* f */
{"hh24", 4, DCH_HH24, TRUE, FROM_CHAR_DATE_NONE}, /* h */
{"hh12", 4, DCH_HH12, TRUE, FROM_CHAR_DATE_NONE},
{"hh", 2, DCH_HH, TRUE, FROM_CHAR_DATE_NONE},
- {"iddd", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* i */
+ {"iddd", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* i */
{"id", 2, DCH_ID, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"iw", 2, DCH_IW, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"iyyy", 4, DCH_IYYY, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"iy", 2, DCH_IY, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"i", 1, DCH_I, TRUE, FROM_CHAR_DATE_ISOWEEK},
{"j", 1, DCH_J, TRUE, FROM_CHAR_DATE_NONE}, /* j */
- {"mi", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* m */
+ {"mi", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* m */
{"mm", 2, DCH_MM, TRUE, FROM_CHAR_DATE_GREGORIAN},
{"month", 5, DCH_month, FALSE, FROM_CHAR_DATE_GREGORIAN},
{"mon", 3, DCH_mon, FALSE, FROM_CHAR_DATE_GREGORIAN},
{"rm", 2, DCH_rm, FALSE, FROM_CHAR_DATE_GREGORIAN}, /* r */
{"ssss", 4, DCH_SSSS, TRUE, FROM_CHAR_DATE_NONE}, /* s */
{"ss", 2, DCH_SS, TRUE, FROM_CHAR_DATE_NONE},
- {"tz", 2, DCH_tz, FALSE, FROM_CHAR_DATE_NONE}, /* t */
- {"us", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* u */
+ {"tz", 2, DCH_tz, FALSE, FROM_CHAR_DATE_NONE}, /* t */
+ {"us", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* u */
{"ww", 2, DCH_WW, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* w */
{"w", 1, DCH_W, TRUE, FROM_CHAR_DATE_GREGORIAN},
{"y,yyy", 5, DCH_Y_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* y */
elog(DEBUG_elog_output, "%d:\t unknown NODE!", a);
}
}
-#endif /* DEBUG */
+#endif /* DEBUG */
/*****************************************************************************
* Private utils
NULL, locale, pErrorCode);
}
-#endif /* USE_ICU */
+#endif /* USE_ICU */
/*
* If the system provides the needed functions for wide-character manipulation
wchar2char(result, workspace, result_size, mylocale);
pfree(workspace);
}
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
else
{
char *p;
wchar2char(result, workspace, result_size, mylocale);
pfree(workspace);
}
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
else
{
char *p;
wchar2char(result, workspace, result_size, mylocale);
pfree(workspace);
}
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
else
{
char *p;
elog(DEBUG_elog_output, "\n\t\tUsed positions: %d,\n\t\tFree positions: %d",
count, free_i);
}
-#endif /* DEBUG */
+#endif /* DEBUG */
/* ----------
* Return TRUE if next format picture is not digit value
if (*Np->inout_p == '-' || (IS_BRACKET(Np->Num) &&
*Np->inout_p == '<'))
{
- *Np->number = '-'; /* set - */
+ *Np->number = '-'; /* set - */
Np->inout_p++;
}
else if (*Np->inout_p == '+')
{
- *Np->number = '+'; /* set + */
+ *Np->number = '+'; /* set + */
Np->inout_p++;
}
}
{
if (!IS_FILLMODE(Np->Num))
{
- *Np->inout_p = ' '; /* Write + */
+ *Np->inout_p = ' '; /* Write + */
++Np->inout_p;
}
Np->sign_wrote = TRUE;
*/
if (!IS_FILLMODE(Np->Num))
{
- *Np->inout_p = ' '; /* Write ' ' */
+ *Np->inout_p = ' '; /* Write ' ' */
++Np->inout_p;
}
}
}
else
{
- *Np->inout_p = *Np->number_p; /* Write DIGIT */
+ *Np->inout_p = *Np->number_p; /* Write DIGIT */
++Np->inout_p;
Np->num_in = TRUE;
}
if (Np->is_to_char)
{
NUM_numpart_to_char(Np, n->key->id);
- continue; /* for() */
+ continue; /* for() */
}
else
{
{
if (!p1->closed)
continue;
- iprev = p1->npts - 1; /* include the closure segment */
+ iprev = p1->npts - 1; /* include the closure segment */
}
for (j = 0; j < p2->npts; j++)
{
if (!p1->closed)
continue;
- iprev = p1->npts - 1; /* include the closure segment */
+ iprev = p1->npts - 1; /* include the closure segment */
}
for (j = 0; j < p2->npts; j++)
{
if (!path->closed)
continue;
- iprev = path->npts - 1; /* include the closure segment */
+ iprev = path->npts - 1; /* include the closure segment */
}
result += point_dt(&path->p[iprev], &path->p[i]);
{
if (!path->closed)
continue;
- iprev = path->npts - 1; /* include the closure segment */
+ iprev = path->npts - 1; /* include the closure segment */
}
statlseg_construct(&lseg, &path->p[iprev], &path->p[i]);
xh = lseg->p[0].x < lseg->p[1].x;
yh = lseg->p[0].y < lseg->p[1].y;
- if (FPeq(lseg->p[0].x, lseg->p[1].x)) /* vertical? */
+ if (FPeq(lseg->p[0].x, lseg->p[1].x)) /* vertical? */
{
#ifdef GEODEBUG
printf("close_ps- segment is vertical\n");
*/
invm = -1.0 / point_sl(&(lseg->p[0]), &(lseg->p[1]));
- tmp = line_construct_pm(&lseg->p[!yh], invm); /* lower edge of the
- * "band" */
+ tmp = line_construct_pm(&lseg->p[!yh], invm); /* lower edge of the
+ * "band" */
if (pt->y < (tmp->A * pt->x + tmp->C))
{ /* we are below the lower edge */
- result = point_copy(&lseg->p[!yh]); /* below the lseg, take lower
- * end pt */
+ result = point_copy(&lseg->p[!yh]); /* below the lseg, take lower end
+ * pt */
#ifdef GEODEBUG
printf("close_ps below: tmp A %f B %f C %f\n",
tmp->A, tmp->B, tmp->C);
#endif
PG_RETURN_POINT_P(result);
}
- tmp = line_construct_pm(&lseg->p[yh], invm); /* upper edge of the
- * "band" */
+ tmp = line_construct_pm(&lseg->p[yh], invm); /* upper edge of the
+ * "band" */
if (pt->y > (tmp->A * pt->x + tmp->C))
{ /* we are below the lower edge */
- result = point_copy(&lseg->p[yh]); /* above the lseg, take higher
- * end pt */
+ result = point_copy(&lseg->p[yh]); /* above the lseg, take higher end
+ * pt */
#ifdef GEODEBUG
printf("close_ps above: tmp A %f B %f C %f\n",
tmp->A, tmp->B, tmp->C);
{
int64 newtmp = tmp * 10 + (*ptr++ - '0');
- if ((newtmp / 10) != tmp) /* overflow? */
+ if ((newtmp / 10) != tmp) /* overflow? */
{
if (errorOK)
return false;
parse_array(lex, sem);
break;
default:
- parse_scalar(lex, sem); /* json can be a bare scalar */
+ parse_scalar(lex, sem); /* json can be a bare scalar */
}
lex_expect(JSON_PARSE_END, lex, JSON_TOKEN_END);
typedef struct IterateJsonStringValuesState
{
JsonLexContext *lex;
- JsonIterateStringValuesAction action; /* an action that will be
- * applied to each json value */
+ JsonIterateStringValuesAction action; /* an action that will be applied
+ * to each json value */
void *action_state; /* any necessary context for iteration */
} IterateJsonStringValuesState;
{
JsonLexContext *lex;
StringInfo strval; /* resulting json */
- JsonTransformStringValuesAction action; /* an action that will be
- * applied to each json value */
+ JsonTransformStringValuesAction action; /* an action that will be applied
+ * to each json value */
void *action_state; /* any necessary context for transformation */
} TransformJsonStringValuesState;
/* hashtable element */
typedef struct JsonHashEntry
{
- char fname[NAMEDATALEN]; /* hash key (MUST BE FIRST) */
+ char fname[NAMEDATALEN]; /* hash key (MUST BE FIRST) */
char *val;
JsonTokenType type;
} JsonHashEntry;
else if (state->element_scalar)
{
jsv.val.json.str = state->element_scalar;
- jsv.val.json.len = -1; /* null-terminated */
+ jsv.val.json.len = -1; /* null-terminated */
}
else
{
* elements and accumulate result using given ArrayBuildState.
*/
static void
-populate_array_dim_jsonb(PopulateArrayContext *ctx, /* context */
- JsonbValue *jbv, /* jsonb sub-array */
- int ndim) /* current dimension */
+populate_array_dim_jsonb(PopulateArrayContext *ctx, /* context */
+ JsonbValue *jbv, /* jsonb sub-array */
+ int ndim) /* current dimension */
{
JsonbContainer *jbc = jbv->val.binary.data;
JsonbIterator *it;
str = JsonbToCString(NULL, &jsonb->root, VARSIZE(jsonb));
}
- else if (jbv->type == jbvString) /* quotes are stripped */
+ else if (jbv->type == jbvString) /* quotes are stripped */
str = pnstrdup(jbv->val.string.val, jbv->val.string.len);
else if (jbv->type == jbvBool)
str = pstrdup(jbv->val.boolean ? "true" : "false");
if (JB_ROOT_IS_SCALAR(jb))
{
- (void) JsonbIteratorNext(&it, &v, false); /* skip array header */
- (void) JsonbIteratorNext(&it, &v, false); /* fetch scalar value */
+ (void) JsonbIteratorNext(&it, &v, false); /* skip array header */
+ (void) JsonbIteratorNext(&it, &v, false); /* fetch scalar value */
switch (o->type)
{
return result;
}
-#endif /* do_like_escape */
+#endif /* do_like_escape */
#ifdef CHAREQ
#undef CHAREQ
if (tinterval->data[0] == INVALID_ABSTIME ||
tinterval->data[1] == INVALID_ABSTIME)
- status = T_INTERVAL_INVAL; /* undefined */
+ status = T_INTERVAL_INVAL; /* undefined */
else
status = T_INTERVAL_VALID;
if (AbsoluteTimeIsReal(t1) &&
RelativeTimeIsValid(t2) &&
((t2 > 0 && t1 < NOEND_ABSTIME - t2) ||
- (t2 <= 0 && t1 > NOSTART_ABSTIME - t2))) /* prevent overflow */
+ (t2 <= 0 && t1 > NOSTART_ABSTIME - t2))) /* prevent overflow */
PG_RETURN_ABSOLUTETIME(t1 + t2);
PG_RETURN_ABSOLUTETIME(INVALID_ABSTIME);
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
errmsg("invalid input syntax for type %s: \"%s\"",
"tinterval", i_string)));
- *i_start = *i_end = INVALID_ABSTIME; /* keep compiler quiet */
+ *i_start = *i_end = INVALID_ABSTIME; /* keep compiler quiet */
}
int
namecat(Name n1, Name n2)
{
- return namestrcat(n1, NameStr(*n2)); /* n2 can't be any longer than
- * n1 */
+ return namestrcat(n1, NameStr(*n2)); /* n2 can't be any longer than n1 */
}
#endif
array = construct_array(names, i,
NAMEOID,
- NAMEDATALEN, /* sizeof(Name) */
- false, /* Name is not by-val */
- 'c'); /* alignment of Name */
+ NAMEDATALEN, /* sizeof(Name) */
+ false, /* Name is not by-val */
+ 'c'); /* alignment of Name */
PG_RETURN_POINTER(array);
}
return NumericAbbrevGetDatum(result);
}
-#endif /* NUMERIC_ABBREV_BITS == 64 */
+#endif /* NUMERIC_ABBREV_BITS == 64 */
#if NUMERIC_ABBREV_BITS == 32
return NumericAbbrevGetDatum(result);
}
-#endif /* NUMERIC_ABBREV_BITS == 32 */
+#endif /* NUMERIC_ABBREV_BITS == 32 */
/*
* Ordinary (non-sortsupport) comparisons follow.
rscale = vsumX.dscale * 2;
mul_var(&vsumX, &vsumX, &vsumX, rscale); /* vsumX = sumX * sumX */
- mul_var(&vN, &vsumX2, &vsumX2, rscale); /* vsumX2 = N * sumX2 */
+ mul_var(&vN, &vsumX2, &vsumX2, rscale); /* vsumX2 = N * sumX2 */
sub_var(&vsumX2, &vsumX, &vsumX2); /* N * sumX2 - sumX * sumX */
if (cmp_var(&vsumX2, &const_zero) <= 0)
else
{
if (sample)
- mul_var(&vN, &vNminus1, &vNminus1, 0); /* N * (N - 1) */
+ mul_var(&vN, &vNminus1, &vNminus1, 0); /* N * (N - 1) */
else
mul_var(&vN, &vN, &vNminus1, 0); /* N * N */
rscale = select_div_scale(&vsumX2, &vNminus1);
- div_var(&vsumX2, &vNminus1, &vsumX, rscale, true); /* variance */
+ div_var(&vsumX2, &vNminus1, &vsumX, rscale, true); /* variance */
if (!variance)
sqrt_var(&vsumX, &vsumX, rscale); /* stddev */
printf("\n");
}
-#endif /* NUMERIC_DEBUG */
+#endif /* NUMERIC_DEBUG */
/* ----------------------------------------------------------------------
if (cmp_var(base, &const_zero) == 0)
{
set_var_from_var(&const_zero, result);
- result->dscale = NUMERIC_MIN_SIG_DIGITS; /* no need to round */
+ result->dscale = NUMERIC_MIN_SIG_DIGITS; /* no need to round */
return;
}
#if defined(WIN32) && defined(LC_MESSAGES)
-static char *IsoLocaleName(const char *); /* MSVC specific */
+static char *IsoLocaleName(const char *); /* MSVC specific */
#endif
else
#endif
result = setlocale(category, locale);
-#endif /* WIN32 */
+#endif /* WIN32 */
if (result == NULL)
return result; /* fall out immediately on failure */
result = IsoLocaleName(locale);
if (result == NULL)
result = (char *) locale;
-#endif /* WIN32 */
+#endif /* WIN32 */
break;
-#endif /* LC_MESSAGES */
+#endif /* LC_MESSAGES */
case LC_MONETARY:
envvar = "LC_MONETARY";
envbuf = lc_monetary_envbuf;
/* redefine strftime() */
#define strftime(a,b,c,d) strftime_win32(a,b,c,d)
-#endif /* WIN32 */
+#endif /* WIN32 */
/* Subroutine for cache_locale_time(). */
static void
return NULL;
#else
return NULL; /* Not supported on this version of msvc/mingw */
-#endif /* _MSC_VER >= 1400 */
+#endif /* _MSC_VER >= 1400 */
}
-#endif /* WIN32 && LC_MESSAGES */
+#endif /* WIN32 && LC_MESSAGES */
/*
errdetail("The operating system could not find any locale data for the locale name \"%s\".",
localename) : 0)));
}
-#endif /* HAVE_LOCALE_T */
+#endif /* HAVE_LOCALE_T */
/*
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("collation provider LIBC is not supported on this platform")));
-#endif /* not HAVE_LOCALE_T */
+#endif /* not HAVE_LOCALE_T */
}
else if (collform->collprovider == COLLPROVIDER_ICU)
{
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("ICU is not supported in this build"), \
errhint("You need to rebuild PostgreSQL using --with-icu.")));
-#endif /* not USE_ICU */
+#endif /* not USE_ICU */
}
collversion = SysCacheGetAttr(COLLOID, tp, Anum_pg_collation_collversion,
}
}
else
-#endif /* WIN32 */
+#endif /* WIN32 */
if (locale == (pg_locale_t) 0)
{
/* Use wcstombs directly for the default locale */
result = wcstombs(to, from, tolen);
uselocale(save_locale);
-#endif /* HAVE_WCSTOMBS_L */
+#endif /* HAVE_WCSTOMBS_L */
#else /* !HAVE_LOCALE_T */
/* Can't have locale != 0 without HAVE_LOCALE_T */
elog(ERROR, "wcstombs_l is not available");
result = 0; /* keep compiler quiet */
-#endif /* HAVE_LOCALE_T */
+#endif /* HAVE_LOCALE_T */
}
return result;
}
}
else
-#endif /* WIN32 */
+#endif /* WIN32 */
{
/* mbstowcs requires ending '\0' */
char *str = pnstrdup(from, fromlen);
result = mbstowcs(to, str, tolen);
uselocale(save_locale);
-#endif /* HAVE_MBSTOWCS_L */
+#endif /* HAVE_MBSTOWCS_L */
#else /* !HAVE_LOCALE_T */
/* Can't have locale != 0 without HAVE_LOCALE_T */
elog(ERROR, "mbstowcs_l is not available");
result = 0; /* keep compiler quiet */
-#endif /* HAVE_LOCALE_T */
+#endif /* HAVE_LOCALE_T */
}
pfree(str);
return result;
}
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
typedef struct
{
TypeCacheEntry *typcache; /* typcache for range type */
- bool has_subtype_diff; /* does it have subtype_diff? */
+ bool has_subtype_diff; /* does it have subtype_diff? */
int entries_count; /* total number of entries being split */
/* Information about currently selected split follows */
ATTSTATSSLOT_NUMBERS))
{
if (sslot.nnumbers != 1)
- elog(ERROR, "invalid empty fraction statistic"); /* shouldn't happen */
+ elog(ERROR, "invalid empty fraction statistic"); /* shouldn't happen */
empty_frac = sslot.numbers[0];
free_attstatsslot(&sslot);
}
stats->stats_valid = true;
stats->stanullfrac = 1.0;
stats->stawidth = 0; /* "unknown" */
- stats->stadistinct = 0.0; /* "unknown" */
+ stats->stadistinct = 0.0; /* "unknown" */
}
/*
char confdeltype; /* foreign key's ON DELETE action */
char confmatchtype; /* foreign key's match type */
int nkeys; /* number of key columns */
- int16 pk_attnums[RI_MAX_NUMKEYS]; /* attnums of referenced cols */
- int16 fk_attnums[RI_MAX_NUMKEYS]; /* attnums of referencing cols */
- Oid pf_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK =
- * FK) */
- Oid pp_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK =
- * PK) */
- Oid ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK =
- * FK) */
+ int16 pk_attnums[RI_MAX_NUMKEYS]; /* attnums of referenced cols */
+ int16 fk_attnums[RI_MAX_NUMKEYS]; /* attnums of referencing cols */
+ Oid pf_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = FK) */
+ Oid pp_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = PK) */
+ Oid ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK = FK) */
dlist_node valid_link; /* Link in list of valid entries */
} RI_ConstraintInfo;
result = ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, NULL,
- true, /* treat like update */
+ true, /* treat like update */
SPI_OK_SELECT);
if (SPI_finish() != SPI_OK_FINISH)
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, NULL,
- true, /* must detect new rows */
+ true, /* must detect new rows */
SPI_OK_SELECT);
if (SPI_finish() != SPI_OK_FINISH)
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, NULL,
- true, /* must detect new rows */
+ true, /* must detect new rows */
SPI_OK_SELECT);
if (SPI_finish() != SPI_OK_FINISH)
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, NULL,
- true, /* must detect new rows */
+ true, /* must detect new rows */
SPI_OK_DELETE);
if (SPI_finish() != SPI_OK_FINISH)
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, new_row,
- true, /* must detect new rows */
+ true, /* must detect new rows */
SPI_OK_UPDATE);
if (SPI_finish() != SPI_OK_FINISH)
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, NULL,
- true, /* must detect new rows */
+ true, /* must detect new rows */
SPI_OK_UPDATE);
if (SPI_finish() != SPI_OK_FINISH)
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, NULL,
- true, /* must detect new rows */
+ true, /* must detect new rows */
SPI_OK_UPDATE);
if (SPI_finish() != SPI_OK_FINISH)
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, NULL,
- true, /* must detect new rows */
+ true, /* must detect new rows */
SPI_OK_UPDATE);
if (SPI_finish() != SPI_OK_FINISH)
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
old_row, NULL,
- true, /* must detect new rows */
+ true, /* must detect new rows */
SPI_OK_UPDATE);
if (SPI_finish() != SPI_OK_FINISH)
*/
if (IsolationUsesXactSnapshot() && detectNewRows)
{
- CommandCounterIncrement(); /* be sure all my own work is visible */
+ CommandCounterIncrement(); /* be sure all my own work is visible */
test_snapshot = GetLatestSnapshot();
crosscheck_snapshot = GetTransactionSnapshot();
}
{
oldvalue = FunctionCall3(&entry->cast_func_finfo,
oldvalue,
- Int32GetDatum(-1), /* typmod */
+ Int32GetDatum(-1), /* typmod */
BoolGetDatum(false)); /* implicit coercion */
newvalue = FunctionCall3(&entry->cast_func_finfo,
newvalue,
- Int32GetDatum(-1), /* typmod */
+ Int32GetDatum(-1), /* typmod */
BoolGetDatum(false)); /* implicit coercion */
}
op_input_types(eq_opr, &lefttype, &righttype);
Assert(lefttype == righttype);
if (typeid == lefttype)
- castfunc = InvalidOid; /* simplest case */
+ castfunc = InvalidOid; /* simplest case */
else
{
pathtype = find_coercion_pathway(lefttype, typeid,
#define PRETTYINDENT_JOIN 4
#define PRETTYINDENT_VAR 4
-#define PRETTYINDENT_LIMIT 40 /* wrap limit */
+#define PRETTYINDENT_LIMIT 40 /* wrap limit */
/* Pretty flags */
#define PRETTYFLAG_PAREN 1
int wrapColumn; /* max line length, or -1 for no limit */
int indentLevel; /* current indent level for prettyprint */
bool varprefix; /* TRUE to print prefixes on Vars */
- ParseExprKind special_exprkind; /* set only for exprkinds needing
- * special handling */
+ ParseExprKind special_exprkind; /* set only for exprkinds needing special
+ * handling */
} deparse_context;
/*
*/
typedef struct
{
- char name[NAMEDATALEN]; /* Hash key --- must be first */
+ char name[NAMEDATALEN]; /* Hash key --- must be first */
int counter; /* Largest addition used so far for name */
} NameHashEntry;
if (!isnull)
{
simple_quote_literal(&buf, TextDatumGetCString(tmp));
- appendStringInfoString(&buf, ", "); /* assume prosrc isn't null */
+ appendStringInfoString(&buf, ", "); /* assume prosrc isn't null */
}
tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_prosrc, &isnull);
}
case T_BoolExpr: /* lower precedence */
case T_ArrayRef: /* other separators */
- case T_ArrayExpr: /* other separators */
+ case T_ArrayExpr: /* other separators */
case T_RowExpr: /* other separators */
case T_CoalesceExpr: /* own parentheses */
- case T_MinMaxExpr: /* own parentheses */
+ case T_MinMaxExpr: /* own parentheses */
case T_XmlExpr: /* own parentheses */
- case T_NullIfExpr: /* other separators */
+ case T_NullIfExpr: /* other separators */
case T_Aggref: /* own parentheses */
- case T_WindowFunc: /* own parentheses */
+ case T_WindowFunc: /* own parentheses */
case T_CaseExpr: /* other separators */
return true;
default:
return true; /* own parentheses */
}
case T_ArrayRef: /* other separators */
- case T_ArrayExpr: /* other separators */
+ case T_ArrayExpr: /* other separators */
case T_RowExpr: /* other separators */
case T_CoalesceExpr: /* own parentheses */
- case T_MinMaxExpr: /* own parentheses */
+ case T_MinMaxExpr: /* own parentheses */
case T_XmlExpr: /* own parentheses */
- case T_NullIfExpr: /* other separators */
+ case T_NullIfExpr: /* other separators */
case T_Aggref: /* own parentheses */
- case T_WindowFunc: /* own parentheses */
+ case T_WindowFunc: /* own parentheses */
case T_CaseExpr: /* other separators */
return true;
default:
else
{
appendStringInfo(buf, "'%s'", extval);
- needlabel = true; /* we must attach a cast */
+ needlabel = true; /* we must attach a cast */
}
break;
else
{
appendStringInfo(buf, "'%s'", extval);
- needlabel = true; /* we must attach a cast */
+ needlabel = true; /* we must attach a cast */
}
break;
break;
case ANY_SUBLINK:
- if (strcmp(opname, "=") == 0) /* Represent = ANY as IN */
+ if (strcmp(opname, "=") == 0) /* Represent = ANY as IN */
appendStringInfoString(buf, " IN ");
else
appendStringInfo(buf, " %s ANY ", opname);
*/
double histfrac;
int lobound = 0; /* first possible slot to search */
- int hibound = sslot.nvalues; /* last+1 slot to search */
+ int hibound = sslot.nvalues; /* last+1 slot to search */
bool have_end = false;
/*
/* get nominal (after relabeling) element type of rightop */
nominal_element_type = get_base_element_type(exprType(rightop));
if (!OidIsValid(nominal_element_type))
- return (Selectivity) 0.5; /* probably shouldn't happen */
+ return (Selectivity) 0.5; /* probably shouldn't happen */
/* get nominal collation, too, for generating constants */
nominal_element_collation = exprCollation(rightop);
if (vardata1->rel &&
bms_is_subset(vardata1->rel->relids, sjinfo->syn_righthand))
- *join_is_reversed = true; /* var1 is on RHS */
+ *join_is_reversed = true; /* var1 is on RHS */
else if (vardata2->rel &&
bms_is_subset(vardata2->rel->relids, sjinfo->syn_lefthand))
- *join_is_reversed = true; /* var2 is on LHS */
+ *join_is_reversed = true; /* var2 is on LHS */
else
*join_is_reversed = false;
}
ScanKeyEntryInitialize(&scankeys[0],
SK_ISNULL | SK_SEARCHNOTNULL,
1, /* index col 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, "unrecognized ptype: %d", (int) ptype);
- result = Pattern_Prefix_None; /* keep compiler quiet */
+ result = Pattern_Prefix_None; /* keep compiler quiet */
break;
}
return result;
negclass = true;
pos++;
}
- if (patt[pos] == ']') /* ']' at start of class is not
- * special */
+ if (patt[pos] == ']') /* ']' at start of class is not special */
pos++;
while (pos < pattlen && patt[pos] != ']')
pos++;
{
elog(ERROR, "unsupported indexorderby type: %d",
(int) nodeTag(clause));
- other_operand = NULL; /* keep compiler quiet */
+ other_operand = NULL; /* keep compiler quiet */
}
cost_qual_eval_node(&index_qual_cost, other_operand, root);
case WAITOPERAND:
if (t_iseq(state->buf, '!'))
{
- (state->buf)++; /* can safely ++, t_iseq guarantee
- * that pg_mblen()==1 */
+ (state->buf)++; /* can safely ++, t_iseq guarantee that
+ * pg_mblen()==1 */
*operator = OP_NOT;
state->state = WAITOPERAND;
return PT_OPR;
if (ptr[*pos].qoperator.oper == OP_NOT)
{
- ptr[*pos].qoperator.left = 1; /* fixed offset */
+ ptr[*pos].qoperator.left = 1; /* fixed offset */
(*pos)++;
/* process the only argument */
else
{
QueryOperator *curitem = &ptr[*pos].qoperator;
- int tmp = *pos; /* save current position */
+ int tmp = *pos; /* save current position */
Assert(curitem->oper == OP_AND ||
curitem->oper == OP_OR ||
*/
operands[i] = val;
- datalen += val_len + 1; /* + 1 for the '\0' terminator */
+ datalen += val_len + 1; /* + 1 for the '\0' terminator */
}
else if (item->type == QI_OPR)
{
Wdoc += Cpos / ((double) (1 + nNoise));
CurExtPos = ((double) (ext.q + ext.p)) / 2.0;
- if (NExtent > 0 && CurExtPos > PrevExtPos /* prevent division by
- * zero in a case of
+ if (NExtent > 0 && CurExtPos > PrevExtPos /* prevent division by
+ * zero in a case of
* multiple lexize */ )
SumDist += 1.0 / (CurExtPos - PrevExtPos);
Oid cfgId;
/* Check call context */
- if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */
+ if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */
elog(ERROR, "tsvector_update_trigger: not fired by trigger manager");
trigdata = (TriggerData *) fcinfo->context;
{
VarBit *t1 = PG_GETARG_VARBIT_P(0);
VarBit *t2 = PG_GETARG_VARBIT_P(1);
- int sp = PG_GETARG_INT32(2); /* substring start position */
- int sl = PG_GETARG_INT32(3); /* substring length */
+ int sp = PG_GETARG_INT32(2); /* substring start position */
+ int sl = PG_GETARG_INT32(3); /* substring length */
PG_RETURN_VARBIT_P(bit_overlay(t1, t2, sp, sl));
}
{
VarBit *t1 = PG_GETARG_VARBIT_P(0);
VarBit *t2 = PG_GETARG_VARBIT_P(1);
- int sp = PG_GETARG_INT32(2); /* substring start position */
+ int sp = PG_GETARG_INT32(2); /* substring start position */
int sl;
sl = VARBITLEN(t2); /* defaults to length(t2) */
bc = (len - 2) / 2 + VARHDRSZ; /* maximum possible length */
result = palloc(bc);
bc = hex_decode(inputText + 2, len - 2, VARDATA(result));
- SET_VARSIZE(result, bc + VARHDRSZ); /* actual length */
+ SET_VARSIZE(result, bc + VARHDRSZ); /* actual length */
PG_RETURN_BYTEA_P(result);
}
{
S1 = Max(S, 1);
- if (length_not_specified) /* special case - get length to end of
- * string */
+ if (length_not_specified) /* special case - get length to end of
+ * string */
L1 = -1;
else
{
*/
slice_start = 0;
- if (length_not_specified) /* special case - get length to end of
- * string */
+ if (length_not_specified) /* special case - get length to end of
+ * string */
slice_size = L1 = -1;
else
{
{
text *t1 = PG_GETARG_TEXT_PP(0);
text *t2 = PG_GETARG_TEXT_PP(1);
- int sp = PG_GETARG_INT32(2); /* substring start position */
- int sl = PG_GETARG_INT32(3); /* substring length */
+ int sp = PG_GETARG_INT32(2); /* substring start position */
+ int sl = PG_GETARG_INT32(3); /* substring length */
PG_RETURN_TEXT_P(text_overlay(t1, t2, sp, sl));
}
{
text *t1 = PG_GETARG_TEXT_PP(0);
text *t2 = PG_GETARG_TEXT_PP(1);
- int sp = PG_GETARG_INT32(2); /* substring start position */
+ int sp = PG_GETARG_INT32(2); /* substring start position */
int sl;
- sl = text_length(PointerGetDatum(t2)); /* defaults to length(t2) */
+ sl = text_length(PointerGetDatum(t2)); /* defaults to length(t2) */
PG_RETURN_TEXT_P(text_overlay(t1, t2, sp, sl));
}
return result;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
if (len1 >= TEXTBUFLEN)
a1p = (char *) palloc(len1 + 1);
#else /* not USE_ICU */
/* shouldn't happen */
elog(ERROR, "unsupported collprovider: %c", mylocale->provider);
-#endif /* not USE_ICU */
+#endif /* not USE_ICU */
}
else
{
#else /* not USE_ICU */
/* shouldn't happen */
elog(ERROR, "unsupported collprovider: %c", sss->locale->provider);
-#endif /* not USE_ICU */
+#endif /* not USE_ICU */
}
else
{
{
bytea *t1 = PG_GETARG_BYTEA_PP(0);
bytea *t2 = PG_GETARG_BYTEA_PP(1);
- int sp = PG_GETARG_INT32(2); /* substring start position */
- int sl = PG_GETARG_INT32(3); /* substring length */
+ int sp = PG_GETARG_INT32(2); /* substring start position */
+ int sl = PG_GETARG_INT32(3); /* substring length */
PG_RETURN_BYTEA_P(bytea_overlay(t1, t2, sp, sl));
}
{
bytea *t1 = PG_GETARG_BYTEA_PP(0);
bytea *t2 = PG_GETARG_BYTEA_PP(1);
- int sp = PG_GETARG_INT32(2); /* substring start position */
+ int sp = PG_GETARG_INT32(2); /* substring start position */
int sl;
sl = VARSIZE_ANY_EXHDR(t2); /* defaults to length(t2) */
{
endp = strchr(nextp + 1, '"');
if (endp == NULL)
- return false; /* mismatched quotes */
+ return false; /* mismatched quotes */
if (endp[1] != '"')
break; /* found end of quoted name */
/* Collapse adjacent quotes into one quote, and look again */
{
endp = strchr(nextp + 1, '"');
if (endp == NULL)
- return false; /* mismatched quotes */
+ return false; /* mismatched quotes */
if (endp[1] != '"')
break; /* found end of quoted name */
/* Collapse adjacent quotes into one quote, and look again */
data,
data_len,
search_start,
- NULL, /* no details */
+ NULL, /* no details */
REGEXP_REPLACE_BACKREF_CNT,
pmatch,
0);
/* start_ptr points to the start_posn'th character of inputstring */
start_ptr = VARDATA_ANY(inputstring);
- for (fldnum = 1;; fldnum++) /* field number is 1 based */
+ for (fldnum = 1;; fldnum++) /* field number is 1 based */
{
CHECK_FOR_INTERRUPTS();
else if (!PG_ARGISNULL(2))
appendStringInfoText(state, PG_GETARG_TEXT_PP(2)); /* delimiter */
- appendStringInfoText(state, PG_GETARG_TEXT_PP(1)); /* value */
+ appendStringInfoText(state, PG_GETARG_TEXT_PP(1)); /* value */
}
/*
#if LIBXML_VERSION >= 20704
#define HAVE_XMLSTRUCTUREDERRORCONTEXT 1
#endif
-#endif /* USE_LIBXML */
+#endif /* USE_LIBXML */
#include "access/htup_details.h"
#include "catalog/namespace.h"
static void *xml_repalloc(void *ptr, size_t size);
static void xml_pfree(void *ptr);
static char *xml_pstrdup(const char *string);
-#endif /* USE_LIBXMLCONTEXT */
+#endif /* USE_LIBXMLCONTEXT */
static xmlChar *xml_text2xmlChar(text *in);
static int parse_xml_decl(const xmlChar *str, size_t *lenp,
ArrayBuildState *astate,
PgXmlErrorContext *xmlerrcxt);
static xmlChar *pg_xmlCharStrndup(char *str, size_t len);
-#endif /* USE_LIBXML */
+#endif /* USE_LIBXML */
static void xmldata_root_element_start(StringInfo result, const char *eltname,
const char *xmlschema, const char *targetns,
#else /* not USE_LIBXML */
NO_XML_SUPPORT();
return false;
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
volatile xmlParserCtxtPtr ctxt = NULL;
volatile xmlDocPtr doc = NULL;
- len = VARSIZE_ANY_EXHDR(data); /* will be useful later */
+ len = VARSIZE_ANY_EXHDR(data); /* will be useful later */
string = xml_text2xmlChar(data);
utf8string = pg_do_encoding_conversion(string,
{
return MemoryContextStrdup(LibxmlContext, string);
}
-#endif /* USE_LIBXMLCONTEXT */
+#endif /* USE_LIBXMLCONTEXT */
/*
|| xmlIsCombiningQ(c)
|| xmlIsExtenderQ(c));
}
-#endif /* USE_LIBXML */
+#endif /* USE_LIBXML */
/*
#else /* not USE_LIBXML */
NO_XML_SUPPORT();
return NULL;
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
return result;
}
-#endif /* USE_LIBXML */
+#endif /* USE_LIBXML */
}
if (xmlXPathRegisterNs(xpathctx,
(xmlChar *) ns_name,
(xmlChar *) ns_uri) != 0)
- ereport(ERROR, /* is this an internal error??? */
+ ereport(ERROR, /* is this an internal error??? */
(errmsg("could not register XML namespace with name \"%s\" and URI \"%s\"",
ns_name, ns_uri)));
}
pg_xml_done(xmlerrcxt, false);
}
-#endif /* USE_LIBXML */
+#endif /* USE_LIBXML */
/*
* Evaluate XPath expression and return array of XML values.
#else
NO_XML_SUPPORT();
return 0;
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
Datum
#else
NO_XML_SUPPORT();
return 0;
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
Datum
#else
NO_XML_SUPPORT();
return 0;
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/*
state->opaque = xtCxt;
#else
NO_XML_SUPPORT();
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/*
xtCxt->xpathcxt = xpathcxt;
#else
NO_XML_SUPPORT();
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/*
"could not set XML namespace");
#else
NO_XML_SUPPORT();
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/*
"invalid XPath expression");
#else
NO_XML_SUPPORT();
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/*
"invalid XPath expression");
#else
NO_XML_SUPPORT();
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/*
#else
NO_XML_SUPPORT();
return false;
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/*
#else
NO_XML_SUPPORT();
return 0;
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/*
#else
NO_XML_SUPPORT();
-#endif /* not USE_LIBXML */
+#endif /* not USE_LIBXML */
}
/* Find existing cache entry, if any. */
if (!AttoptCacheHash)
InitializeAttoptCache();
- memset(&key, 0, sizeof(key)); /* make sure any padding bits are
- * unset */
+ memset(&key, 0, sizeof(key)); /* make sure any padding bits are unset */
key.attrelid = attrelid;
key.attnum = attnum;
attopt =
cc_lsearches,
cc_lhits);
}
-#endif /* CATCACHE_STATS */
+#endif /* CATCACHE_STATS */
/*
*/
typedef struct InvalidationChunk
{
- struct InvalidationChunk *next; /* list link */
+ struct InvalidationChunk *next; /* list link */
int nitems; /* # items currently stored in chunk */
int maxitems; /* size of allocated array in this chunk */
SharedInvalidationMessage msgs[FLEXIBLE_ARRAY_MEMBER];
else
return InvalidOid;
}
-#endif /* NOT_USED */
+#endif /* NOT_USED */
/*
* get_typcollation
MemoryContext source_context;
MemoryContext oldcxt;
- Assert(query_string != NULL); /* required as of 8.4 */
+ Assert(query_string != NULL); /* required as of 8.4 */
/*
* Make a dedicated memory context for the CachedPlanSource and its
{
CachedPlanSource *plansource;
- Assert(query_string != NULL); /* required as of 8.4 */
+ Assert(query_string != NULL); /* required as of 8.4 */
/*
* Create and fill the CachedPlanSource struct within the caller's memory
/*
* initialize the relation lock manager information
*/
- RelationInitLockInfo(relation); /* see lmgr.c */
+ RelationInitLockInfo(relation); /* see lmgr.c */
/*
* initialize physical addressing information for the relation
/*
* initialize the relation lock manager information
*/
- RelationInitLockInfo(relation); /* see lmgr.c */
+ RelationInitLockInfo(relation); /* see lmgr.c */
/*
* initialize physical addressing information for the relation
if (relation->rd_rel->relkind == RELKIND_INDEX)
{
- relation->rd_isvalid = false; /* needs to be revalidated */
+ relation->rd_isvalid = false; /* needs to be revalidated */
if (relation->rd_refcnt > 1 && IsTransactionState())
RelationReloadIndexInfo(relation);
}
formrdesc("pg_type", TypeRelation_Rowtype_Id, false,
true, Natts_pg_type, Desc_pg_type);
-#define NUM_CRITICAL_LOCAL_RELS 4 /* fix if you change list above */
+#define NUM_CRITICAL_LOCAL_RELS 4 /* fix if you change list above */
}
MemoryContextSwitchTo(oldcxt);
oldcxt = MemoryContextSwitchTo(CacheMemoryContext);
result = CreateTemplateTupleDesc(natts, hasoids);
- result->tdtypeid = RECORDOID; /* not right, but we don't care */
+ result->tdtypeid = RECORDOID; /* not right, but we don't care */
result->tdtypmod = -1;
for (i = 0; i < natts; i++)
elog(ERROR, "null conkey for rel %s",
RelationGetRelationName(relation));
- arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
+ arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
nelem = ARR_DIMS(arr)[0];
if (ARR_NDIM(arr) != 1 ||
nelem < 1 ||
elog(ERROR, "null confkey for rel %s",
RelationGetRelationName(relation));
- arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
+ arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
nelem = ARR_DIMS(arr)[0];
if (ARR_NDIM(arr) != 1 ||
nelem != info->nkeys ||
elog(ERROR, "null conpfeqop for rel %s",
RelationGetRelationName(relation));
- arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
+ arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
nelem = ARR_DIMS(arr)[0];
if (ARR_NDIM(arr) != 1 ||
nelem != info->nkeys ||
rel->rd_att->tdrefcount = 1; /* mark as refcounted */
rel->rd_att->tdtypeid = relform->reltype;
- rel->rd_att->tdtypmod = -1; /* unnecessary, but... */
+ rel->rd_att->tdtypmod = -1; /* unnecessary, but... */
/* next read all the attribute tuple form data entries */
has_not_null = false;
if (fread(rel->rd_options, 1, len, fp) != len)
goto read_failed;
if (len != VARSIZE(rel->rd_options))
- goto read_failed; /* sanity check */
+ goto read_failed; /* sanity check */
}
else
{
* all entries, otherwise just remove the specific relation's entry.
* Always remove negative cache entries.
*/
- if (relid == InvalidOid || /* complete reset */
- entry->relid == InvalidOid || /* negative cache entry */
- entry->relid == relid) /* individual flushed relation */
+ if (relid == InvalidOid || /* complete reset */
+ entry->relid == InvalidOid || /* negative cache entry */
+ entry->relid == relid) /* individual flushed relation */
{
if (hash_search(RelfilenodeMapHash,
(void *) &entry->key,
*/
#define RELMAPPER_FILENAME "pg_filenode.map"
-#define RELMAPPER_FILEMAGIC 0x592717 /* version ID value */
+#define RELMAPPER_FILEMAGIC 0x592717 /* version ID value */
-#define MAX_MAPPINGS 62 /* 62 * 8 + 16 = 512 */
+#define MAX_MAPPINGS 62 /* 62 * 8 + 16 = 512 */
typedef struct RelMapping
{
},
8
},
- {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPERNAME */
+ {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPERNAME */
ForeignDataWrapperNameIndexId,
1,
{
},
2
},
- {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPEROID */
+ {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPEROID */
ForeignDataWrapperOidIndexId,
1,
{
},
128
},
- {ReplicationOriginRelationId, /* REPLORIGIDENT */
+ {ReplicationOriginRelationId, /* REPLORIGIDENT */
ReplicationOriginIdentIndex,
1,
{
},
16
},
- {ReplicationOriginRelationId, /* REPLORIGNAME */
+ {ReplicationOriginRelationId, /* REPLORIGNAME */
ReplicationOriginNameIndex,
1,
{
static TupleDesc *RecordCacheArray = NULL;
static int32 RecordCacheArrayLen = 0; /* allocated length of array */
-static int32 NextRecordTypmod = 0; /* number of entries used */
+static int32 NextRecordTypmod = 0; /* number of entries used */
static void load_typcache_tupdesc(TypeCacheEntry *typentry);
static void load_rangetype_info(TypeCacheEntry *typentry);
{
Relation rel;
- if (!OidIsValid(typentry->typrelid)) /* should not happen */
+ if (!OidIsValid(typentry->typrelid)) /* should not happen */
elog(ERROR, "invalid typrelid for composite type %u",
typentry->type_id);
rel = relation_open(typentry->typrelid, AccessShareLock);
/* GUC parameters */
int Log_error_verbosity = PGERROR_VERBOSE;
-char *Log_line_prefix = NULL; /* format for extra log line info */
+char *Log_line_prefix = NULL; /* format for extra log line info */
int Log_destination = LOG_DESTINATION_STDERR;
char *Log_destination_string = NULL;
bool syslog_sequence_numbers = true;
* because it suggests an infinite loop of errors during error
* recovery.
*/
- errordata_stack_depth = -1; /* make room on stack */
+ errordata_stack_depth = -1; /* make room on stack */
ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
}
* else failure to convert it to client encoding could cause further
* recursion.
*/
- errordata_stack_depth = -1; /* make room on stack */
+ errordata_stack_depth = -1; /* make room on stack */
ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
}
* because it suggests an infinite loop of errors during error
* recovery.
*/
- errordata_stack_depth = -1; /* make room on stack */
+ errordata_stack_depth = -1; /* make room on stack */
ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
}
* because it suggests an infinite loop of errors during error
* recovery.
*/
- errordata_stack_depth = -1; /* make room on stack */
+ errordata_stack_depth = -1; /* make room on stack */
ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
}
syslog(level, "%s", line);
}
}
-#endif /* HAVE_SYSLOG */
+#endif /* HAVE_SYSLOG */
#ifdef WIN32
/*
&line,
NULL);
}
-#endif /* WIN32 */
+#endif /* WIN32 */
static void
write_console(const char *line, int len)
write_syslog(syslog_level, buf.data);
}
-#endif /* HAVE_SYSLOG */
+#endif /* HAVE_SYSLOG */
#ifdef WIN32
/* Write to eventlog, if enabled */
{
write_eventlog(edata->elevel, buf.data, buf.len);
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/* Write to stderr, if enabled */
if ((Log_destination & LOG_DESTINATION_STDERR) || whereToSendOutput == DestDebug)
err_sendstring(&msgbuf, edata->funcname);
}
- pq_sendbyte(&msgbuf, '\0'); /* terminator */
+ pq_sendbyte(&msgbuf, '\0'); /* terminator */
}
else
{
ino_t inode; /* Inode number of file */
#endif
void *handle; /* a handle for pg_dl* functions */
- char filename[FLEXIBLE_ARRAY_MEMBER]; /* Full pathname of file */
+ char filename[FLEXIBLE_ARRAY_MEMBER]; /* Full pathname of file */
} DynamicFileList;
static DynamicFileList *file_list = NULL;
else
prv = file_scanner;
}
-#endif /* NOT_USED */
+#endif /* NOT_USED */
}
static bool
TransactionId fn_xmin; /* for checking up-to-dateness */
ItemPointerData fn_tid;
PGFunction user_fn; /* the function's address */
- const Pg_finfo_record *inforec; /* address of its info record */
+ const Pg_finfo_record *inforec; /* address of its info record */
} CFuncHashTabEntry;
static HTAB *CFuncHash = NULL;
finfo->fn_nargs = fbp->nargs;
finfo->fn_strict = fbp->strict;
finfo->fn_retset = fbp->retset;
- finfo->fn_stats = TRACK_FUNC_ALL; /* ie, never track */
+ finfo->fn_stats = TRACK_FUNC_ALL; /* ie, never track */
finfo->fn_addr = fbp->func;
finfo->fn_oid = functionId;
return;
FmgrHookIsNeeded(functionId)))
{
finfo->fn_addr = fmgr_security_definer;
- finfo->fn_stats = TRACK_FUNC_ALL; /* ie, never track */
+ finfo->fn_stats = TRACK_FUNC_ALL; /* ie, never track */
finfo->fn_oid = functionId;
ReleaseSysCache(procedureTuple);
return;
*retval = X;
return PointerGetDatum(retval);
}
-#endif /* USE_FLOAT8_BYVAL */
+#endif /* USE_FLOAT8_BYVAL */
#ifndef USE_FLOAT4_BYVAL
* deconstruct_array() since the array data is just going to look like
* a C array of values.
*/
- arr = DatumGetArrayTypeP(proallargtypes); /* ensure not toasted */
+ arr = DatumGetArrayTypeP(proallargtypes); /* ensure not toasted */
numargs = ARR_DIMS(arr)[0];
if (ARR_NDIM(arr) != 1 ||
numargs < 0 ||
* For proargmodes, we don't need to use deconstruct_array() since the
* array data is just going to look like a C array of values.
*/
- arr = DatumGetArrayTypeP(proargnames); /* ensure not toasted */
+ arr = DatumGetArrayTypeP(proargnames); /* ensure not toasted */
if (ARR_NDIM(arr) != 1 ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != TEXTOID)
ARR_ELEMTYPE(arr) != OIDOID)
elog(ERROR, "proallargtypes is not a 1-D Oid array");
argtypes = (Oid *) ARR_DATA_PTR(arr);
- arr = DatumGetArrayTypeP(proargmodes); /* ensure not toasted */
+ arr = DatumGetArrayTypeP(proargmodes); /* ensure not toasted */
if (ARR_NDIM(arr) != 1 ||
ARR_DIMS(arr)[0] != numargs ||
ARR_HASNULL(arr) ||
hashp->hash = tag_hash;
}
else
- hashp->hash = string_hash; /* default hash function */
+ hashp->hash = string_hash; /* default hash function */
/*
* If you don't specify a match function, it defaults to string_compare if
/* Begin scan of curBucket... */
status->curEntry = curElem->link;
- if (status->curEntry == NULL) /* end of this bucket */
+ if (status->curEntry == NULL) /* end of this bucket */
++curBucket;
status->curBucket = curBucket;
return (void *) ELEMENTKEY(curElem);
#define MAX_SEQ_SCANS 100
static HTAB *seq_scan_tables[MAX_SEQ_SCANS]; /* tables being scanned */
-static int seq_scan_level[MAX_SEQ_SCANS]; /* subtransaction nest level */
+static int seq_scan_level[MAX_SEQ_SCANS]; /* subtransaction nest level */
static int num_seq_scans = 0;
char OutputFileName[MAXPGPATH]; /* debugging output file */
char my_exec_path[MAXPGPATH]; /* full path to my executable */
-char pkglib_path[MAXPGPATH]; /* full path to lib directory */
+char pkglib_path[MAXPGPATH]; /* full path to lib directory */
#ifdef EXEC_BACKEND
-char postgres_exec_path[MAXPGPATH]; /* full path to backend */
+char postgres_exec_path[MAXPGPATH]; /* full path to backend */
/* note: currently this is not valid in backend processes */
#endif
int max_parallel_workers = 8;
int MaxBackends = 0;
-int VacuumCostPageHit = 1; /* GUC parameters for vacuum */
+int VacuumCostPageHit = 1; /* GUC parameters for vacuum */
int VacuumCostPageMiss = 10;
int VacuumCostPageDirty = 20;
int VacuumCostLimit = 200;
int VacuumPageMiss = 0;
int VacuumPageDirty = 0;
-int VacuumCostBalance = 0; /* working state for vacuum */
+int VacuumCostBalance = 0; /* working state for vacuum */
bool VacuumCostActive = false;
read(fd, buffer, sizeof(buffer));
close(fd);
}
-#endif /* HAVE_UTIMES */
-#endif /* HAVE_UTIME */
+#endif /* HAVE_UTIMES */
+#endif /* HAVE_UTIME */
}
}
set_ps_display("startup", false);
- ClientAuthInProgress = false; /* client_min_messages is active now */
+ ClientAuthInProgress = false; /* client_min_messages is active now */
}
/*
* JIS X 0213
*/
- if (c1 >= 0x81 && c1 <= 0x9f) /* plane 1 1ku-62ku */
+ if (c1 >= 0x81 && c1 <= 0x9f) /* plane 1 1ku-62ku */
{
ku = (c1 << 1) - 0x100;
ten = get_ten(c2, &kubun);
} codes_t;
/* map Big5 Level 1 to CNS 11643-1992 Plane 1 */
-static const codes_t big5Level1ToCnsPlane1[25] = { /* range */
+static const codes_t big5Level1ToCnsPlane1[25] = { /* range */
{0xA140, 0x2121},
{0xA1F6, 0x2258},
{0xA1F7, 0x2257},
};
/* map CNS 11643-1992 Plane 1 to Big5 Level 1 */
-static const codes_t cnsPlane1ToBig5Level1[26] = { /* range */
+static const codes_t cnsPlane1ToBig5Level1[26] = { /* range */
{0x2121, 0xA140},
{0x2257, 0xA1F7},
{0x2258, 0xA1F6},
};
/* map Big5 Level 2 to CNS 11643-1992 Plane 2 */
-static const codes_t big5Level2ToCnsPlane2[48] = { /* range */
+static const codes_t big5Level2ToCnsPlane2[48] = { /* range */
{0xC940, 0x2121},
{0xc94a, 0x0000},
{0xC94B, 0x212B},
};
/* map CNS 11643-1992 Plane 2 to Big5 Level 2 */
-static const codes_t cnsPlane2ToBig5Level2[49] = { /* range */
+static const codes_t cnsPlane2ToBig5Level2[49] = { /* range */
{0x2121, 0xC940},
{0x212B, 0xC94B},
{0x214C, 0xC9BE},
typedef struct
{
pg_enc encoding;
- const pg_mb_radix_tree *map1; /* to UTF8 map name */
- const pg_mb_radix_tree *map2; /* from UTF8 map name */
+ const pg_mb_radix_tree *map1; /* to UTF8 map name */
+ const pg_mb_radix_tree *map2; /* from UTF8 map name */
} pg_conv_map;
static const pg_conv_map maps[] = {
{PG_LATIN2, &iso8859_2_to_unicode_tree,
- &iso8859_2_from_unicode_tree}, /* ISO-8859-2 Latin 2 */
+ &iso8859_2_from_unicode_tree}, /* ISO-8859-2 Latin 2 */
{PG_LATIN3, &iso8859_3_to_unicode_tree,
- &iso8859_3_from_unicode_tree}, /* ISO-8859-3 Latin 3 */
+ &iso8859_3_from_unicode_tree}, /* ISO-8859-3 Latin 3 */
{PG_LATIN4, &iso8859_4_to_unicode_tree,
- &iso8859_4_from_unicode_tree}, /* ISO-8859-4 Latin 4 */
+ &iso8859_4_from_unicode_tree}, /* ISO-8859-4 Latin 4 */
{PG_LATIN5, &iso8859_9_to_unicode_tree,
- &iso8859_9_from_unicode_tree}, /* ISO-8859-9 Latin 5 */
+ &iso8859_9_from_unicode_tree}, /* ISO-8859-9 Latin 5 */
{PG_LATIN6, &iso8859_10_to_unicode_tree,
- &iso8859_10_from_unicode_tree}, /* ISO-8859-10 Latin 6 */
+ &iso8859_10_from_unicode_tree}, /* ISO-8859-10 Latin 6 */
{PG_LATIN7, &iso8859_13_to_unicode_tree,
- &iso8859_13_from_unicode_tree}, /* ISO-8859-13 Latin 7 */
+ &iso8859_13_from_unicode_tree}, /* ISO-8859-13 Latin 7 */
{PG_LATIN8, &iso8859_14_to_unicode_tree,
- &iso8859_14_from_unicode_tree}, /* ISO-8859-14 Latin 8 */
+ &iso8859_14_from_unicode_tree}, /* ISO-8859-14 Latin 8 */
{PG_LATIN9, &iso8859_15_to_unicode_tree,
- &iso8859_15_from_unicode_tree}, /* ISO-8859-15 Latin 9 */
+ &iso8859_15_from_unicode_tree}, /* ISO-8859-15 Latin 9 */
{PG_LATIN10, &iso8859_16_to_unicode_tree,
- &iso8859_16_from_unicode_tree}, /* ISO-8859-16 Latin 10 */
+ &iso8859_16_from_unicode_tree}, /* ISO-8859-16 Latin 10 */
{PG_ISO_8859_5, &iso8859_5_to_unicode_tree,
- &iso8859_5_from_unicode_tree}, /* ISO-8859-5 */
+ &iso8859_5_from_unicode_tree}, /* ISO-8859-5 */
{PG_ISO_8859_6, &iso8859_6_to_unicode_tree,
- &iso8859_6_from_unicode_tree}, /* ISO-8859-6 */
+ &iso8859_6_from_unicode_tree}, /* ISO-8859-6 */
{PG_ISO_8859_7, &iso8859_7_to_unicode_tree,
- &iso8859_7_from_unicode_tree}, /* ISO-8859-7 */
+ &iso8859_7_from_unicode_tree}, /* ISO-8859-7 */
{PG_ISO_8859_8, &iso8859_8_to_unicode_tree,
- &iso8859_8_from_unicode_tree}, /* ISO-8859-8 */
+ &iso8859_8_from_unicode_tree}, /* ISO-8859-8 */
};
Datum
typedef struct
{
pg_enc encoding;
- const pg_mb_radix_tree *map1; /* to UTF8 map name */
- const pg_mb_radix_tree *map2; /* from UTF8 map name */
+ const pg_mb_radix_tree *map1; /* to UTF8 map name */
+ const pg_mb_radix_tree *map2; /* from UTF8 map name */
} pg_conv_map;
static const pg_conv_map maps[] = {
return icu_encoding_name;
}
-#endif /* not FRONTEND */
+#endif /* not FRONTEND */
/* ----------
*to = (SS2 << 8) | *from++;
len -= 2;
}
- else if (*from == SS3 && len >= 3) /* JIS X 0212 KANJI */
+ else if (*from == SS3 && len >= 3) /* JIS X 0212 KANJI */
{
from++;
*to = (SS3 << 16) | (*from++ << 8);
*to |= *from++;
len -= 3;
}
- else if (IS_HIGHBIT_SET(*from) && len >= 2) /* JIS X 0208 KANJI */
+ else if (IS_HIGHBIT_SET(*from) && len >= 2) /* JIS X 0208 KANJI */
{
*to = *from++ << 8;
*to |= *from++;
*to |= *from++;
len -= 3;
}
- else if (*from == SS3 && len >= 3) /* code set 3 (unused ?) */
+ else if (*from == SS3 && len >= 3) /* code set 3 (unused ?) */
{
from++;
*to = (SS3 << 16) | (*from++ << 8);
*to |= *from++;
len -= 3;
}
- else if (IS_HIGHBIT_SET(*from) && len >= 2) /* code set 1 */
+ else if (IS_HIGHBIT_SET(*from) && len >= 2) /* code set 1 */
{
*to = *from++ << 8;
*to |= *from++;
*to |= *from++;
len -= 4;
}
- else if (*from == SS3 && len >= 3) /* code set 3 (unused?) */
+ else if (*from == SS3 && len >= 3) /* code set 3 (unused?) */
{
from++;
*to = (SS3 << 16) | (*from++ << 8);
*to |= *from++;
len -= 3;
}
- else if (IS_HIGHBIT_SET(*from) && len >= 2) /* code set 2 */
+ else if (IS_HIGHBIT_SET(*from) && len >= 2) /* code set 2 */
{
*to = *from++ << 8;
*to |= *from++;
else if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
- len = pg_ascii_dsplen(s); /* should be ASCII */
+ len = pg_ascii_dsplen(s); /* should be ASCII */
return len;
}
if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
- len = pg_ascii_dsplen(s); /* should be ASCII */
+ len = pg_ascii_dsplen(s); /* should be ASCII */
return len;
}
if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
- len = pg_ascii_dsplen(s); /* should be ASCII */
+ len = pg_ascii_dsplen(s); /* should be ASCII */
return len;
}
if (IS_HIGHBIT_SET(*s))
len = 2; /* 2byte? */
else
- len = pg_ascii_dsplen(s); /* should be ASCII */
+ len = pg_ascii_dsplen(s); /* should be ASCII */
return len;
}
if (IS_HIGHBIT_SET(*s))
len = 2;
else
- len = pg_ascii_dsplen(s); /* ASCII */
+ len = pg_ascii_dsplen(s); /* ASCII */
return len;
}
break;
default:
- if (IS_HIGHBIT_SET(c1)) /* JIS X 0208? */
+ if (IS_HIGHBIT_SET(c1)) /* JIS X 0208? */
{
l = 2;
if (l > len)
return -1;
default:
- if (IS_HIGHBIT_SET(c1)) /* CNS 11643 Plane 1 */
+ if (IS_HIGHBIT_SET(c1)) /* CNS 11643 Plane 1 */
{
l = 2;
if (l > len)
return false;
default:
- if (IS_HIGHBIT_SET(c1)) /* JIS X 0208? */
+ if (IS_HIGHBIT_SET(c1)) /* JIS X 0208? */
{
if (length != 2)
return false;
return true;
}
-#endif /* !FRONTEND */
+#endif /* !FRONTEND */
/*
{pg_euctw2wchar_with_len, pg_wchar2euc_with_len, pg_euctw_mblen, pg_euctw_dsplen, pg_euctw_verifier, 4}, /* PG_EUC_TW */
{pg_eucjp2wchar_with_len, pg_wchar2euc_with_len, pg_eucjp_mblen, pg_eucjp_dsplen, pg_eucjp_verifier, 3}, /* PG_EUC_JIS_2004 */
{pg_utf2wchar_with_len, pg_wchar2utf_with_len, pg_utf_mblen, pg_utf_dsplen, pg_utf8_verifier, 4}, /* PG_UTF8 */
- {pg_mule2wchar_with_len, pg_wchar2mule_with_len, pg_mule_mblen, pg_mule_dsplen, pg_mule_verifier, 4}, /* PG_MULE_INTERNAL */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN1 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN2 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN3 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN4 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN5 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN6 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN7 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN8 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN9 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN10 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1256 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1258 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN866 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN874 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_KOI8R */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1251 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1252 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-5 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-6 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-7 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-8 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1250 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1253 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1254 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1255 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1257 */
- {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_KOI8U */
+ {pg_mule2wchar_with_len, pg_wchar2mule_with_len, pg_mule_mblen, pg_mule_dsplen, pg_mule_verifier, 4}, /* PG_MULE_INTERNAL */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN1 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN2 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN3 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN4 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN5 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN6 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN7 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN8 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN9 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_LATIN10 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1256 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1258 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN866 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN874 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_KOI8R */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1251 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1252 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-5 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-6 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-7 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* ISO-8859-8 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1250 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1253 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1254 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1255 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_WIN1257 */
+ {pg_latin12wchar_with_len, pg_wchar2single_with_len, pg_latin1_mblen, pg_latin1_dsplen, pg_latin1_verifier, 1}, /* PG_KOI8U */
{0, 0, pg_sjis_mblen, pg_sjis_dsplen, pg_sjis_verifier, 2}, /* PG_SJIS */
{0, 0, pg_big5_mblen, pg_big5_dsplen, pg_big5_verifier, 2}, /* PG_BIG5 */
{0, 0, pg_gbk_mblen, pg_gbk_dsplen, pg_gbk_verifier, 2}, /* PG_GBK */
{0, 0, pg_uhc_mblen, pg_uhc_dsplen, pg_uhc_verifier, 2}, /* PG_UHC */
- {0, 0, pg_gb18030_mblen, pg_gb18030_dsplen, pg_gb18030_verifier, 4}, /* PG_GB18030 */
- {0, 0, pg_johab_mblen, pg_johab_dsplen, pg_johab_verifier, 3}, /* PG_JOHAB */
+ {0, 0, pg_gb18030_mblen, pg_gb18030_dsplen, pg_gb18030_verifier, 4}, /* PG_GB18030 */
+ {0, 0, pg_johab_mblen, pg_johab_dsplen, pg_johab_verifier, 3}, /* PG_JOHAB */
{0, 0, pg_sjis_mblen, pg_sjis_dsplen, pg_sjis_verifier, 2} /* PG_SHIFT_JIS_2004 */
};
pg_enc2name_tbl[dest_encoding].name)));
}
-#endif /* !FRONTEND */
+#endif /* !FRONTEND */
}
-#endif /* HAVE_STRONG_RANDOM */
+#endif /* HAVE_STRONG_RANDOM */
bool log_parser_stats = false;
bool log_planner_stats = false;
bool log_executor_stats = false;
-bool log_statement_stats = false; /* this is sort of all three
- * above together */
+bool log_statement_stats = false; /* this is sort of all three above
+ * together */
bool log_btree_build_stats = false;
char *event_source;
item->name = pstrdup(name);
item->value = pstrdup(value);
item->errmsg = NULL;
- item->filename = pstrdup(""); /* new item has no location */
+ item->filename = pstrdup(""); /* new item has no location */
item->sourceline = 0;
item->ignore = false;
item->applied = false;
FreeFile(fp);
}
-#endif /* EXEC_BACKEND */
+#endif /* EXEC_BACKEND */
/*
* can_skip_gucvar:
return false;
#else
return true;
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
static void
{
#ifdef USE_PREFETCH
target_prefetch_pages = *((int *) extra);
-#endif /* USE_PREFETCH */
+#endif /* USE_PREFETCH */
}
static void
char *fname;
/* directory */
- dname = guc_malloc(ERROR, strlen(newval) + 1); /* runtime dir */
+ dname = guc_malloc(ERROR, strlen(newval) + 1); /* runtime dir */
sprintf(dname, "%s", newval);
/* global stats */
- tname = guc_malloc(ERROR, strlen(newval) + 12); /* /global.tmp */
+ tname = guc_malloc(ERROR, strlen(newval) + 12); /* /global.tmp */
sprintf(tname, "%s/global.tmp", newval);
- fname = guc_malloc(ERROR, strlen(newval) + 13); /* /global.stat */
+ fname = guc_malloc(ERROR, strlen(newval) + 13); /* /global.stat */
sprintf(fname, "%s/global.stat", newval);
if (pgstat_stat_directory)
static char *ps_buffer; /* will point to argv area */
static size_t ps_buffer_size; /* space determined at run time */
static size_t last_status_len; /* use to minimize length of clobber */
-#endif /* PS_USE_CLOBBER_ARGV */
+#endif /* PS_USE_CLOBBER_ARGV */
static size_t ps_buffer_cur_len; /* nominal strlen(ps_buffer) */
-static size_t ps_buffer_fixed_size; /* size of the constant prefix */
+static size_t ps_buffer_fixed_size; /* size of the constant prefix */
/* save the original argv[] location here */
static int save_argc;
new_environ[i] = NULL;
environ = new_environ;
}
-#endif /* PS_USE_CLOBBER_ARGV */
+#endif /* PS_USE_CLOBBER_ARGV */
#if defined(PS_USE_CHANGE_ARGV) || defined(PS_USE_CLOBBER_ARGV)
argv = new_argv;
}
-#endif /* PS_USE_CHANGE_ARGV or PS_USE_CLOBBER_ARGV */
+#endif /* PS_USE_CHANGE_ARGV or PS_USE_CLOBBER_ARGV */
return argv;
}
#ifdef PS_USE_CHANGE_ARGV
save_argv[0] = ps_buffer;
save_argv[1] = NULL;
-#endif /* PS_USE_CHANGE_ARGV */
+#endif /* PS_USE_CHANGE_ARGV */
#ifdef PS_USE_CLOBBER_ARGV
{
for (i = 1; i < save_argc; i++)
save_argv[i] = ps_buffer + ps_buffer_size;
}
-#endif /* PS_USE_CLOBBER_ARGV */
+#endif /* PS_USE_CLOBBER_ARGV */
/*
* Make fixed prefix of ps display.
ps_buffer_cur_len = ps_buffer_fixed_size = strlen(ps_buffer);
set_ps_display(initial_str, true);
-#endif /* not PS_USE_NONE */
+#endif /* not PS_USE_NONE */
}
pst.pst_command = ps_buffer;
pstat(PSTAT_SETCMD, pst, ps_buffer_cur_len, 0, 0);
}
-#endif /* PS_USE_PSTAT */
+#endif /* PS_USE_PSTAT */
#ifdef PS_USE_PS_STRINGS
PS_STRINGS->ps_nargvstr = 1;
PS_STRINGS->ps_argvstr = ps_buffer;
-#endif /* PS_USE_PS_STRINGS */
+#endif /* PS_USE_PS_STRINGS */
#ifdef PS_USE_CLOBBER_ARGV
/* pad unused memory; need only clobber remainder of old status string */
MemSet(ps_buffer + ps_buffer_cur_len, PS_PADDING,
last_status_len - ps_buffer_cur_len);
last_status_len = ps_buffer_cur_len;
-#endif /* PS_USE_CLOBBER_ARGV */
+#endif /* PS_USE_CLOBBER_ARGV */
#ifdef PS_USE_WIN32
{
ident_handle = CreateEvent(NULL, TRUE, FALSE, name);
}
-#endif /* PS_USE_WIN32 */
-#endif /* not PS_USE_NONE */
+#endif /* PS_USE_WIN32 */
+#endif /* not PS_USE_NONE */
}
BlockNumber
BlockSampler_Next(BlockSampler bs)
{
- BlockNumber K = bs->N - bs->t; /* remaining blocks */
- int k = bs->n - bs->m; /* blocks still to sample */
+ BlockNumber K = bs->N - bs->t; /* remaining blocks */
+ int k = bs->n - bs->m; /* blocks still to sample */
double p; /* probability to skip block */
double V; /* random */
double V,
quot;
- V = sampler_random_fract(rs->randstate); /* Generate V */
+ V = sampler_random_fract(rs->randstate); /* Generate V */
S = 0;
t += 1;
/* Note: "num" in Vitter's code is always equal to t - n */
y *= numer / denom;
denom -= 1;
}
- W = exp(-log(sampler_random_fract(rs->randstate)) / n); /* Generate W in advance */
+ W = exp(-log(sampler_random_fract(rs->randstate)) / n); /* Generate W in advance */
if (exp(log(y) / n) <= (t + X) / t)
break;
}
#define ALLOC_BLOCKHDRSZ MAXALIGN(sizeof(AllocBlockData))
#define ALLOC_CHUNKHDRSZ sizeof(struct AllocChunkData)
-typedef struct AllocBlockData *AllocBlock; /* forward reference */
+typedef struct AllocBlockData *AllocBlock; /* forward reference */
typedef struct AllocChunkData *AllocChunk;
/*
MemoryContextData header; /* Standard memory-context fields */
/* Info about storage allocated in this context: */
AllocBlock blocks; /* head of list of blocks in this set */
- AllocChunk freelist[ALLOCSET_NUM_FREELISTS]; /* free chunk lists */
+ AllocChunk freelist[ALLOCSET_NUM_FREELISTS]; /* free chunk lists */
/* Allocation parameters for this context: */
Size initBlockSize; /* initial block size */
Size maxBlockSize; /* maximum block size */
Size padding;
#endif
-#endif /* MEMORY_CONTEXT_CHECKING */
+#endif /* MEMORY_CONTEXT_CHECKING */
/* aset is the owning aset if allocated, or the freelist link if free */
void *aset;
chunk->size = availchunk;
#ifdef MEMORY_CONTEXT_CHECKING
- chunk->requested_size = 0; /* mark it free */
+ chunk->requested_size = 0; /* mark it free */
#endif
chunk->aset = (void *) set->freelist[a_fidx];
set->freelist[a_fidx] = chunk;
Size chsize,
dsize;
- chsize = chunk->size; /* aligned chunk size */
+ chsize = chunk->size; /* aligned chunk size */
VALGRIND_MAKE_MEM_DEFINED(&chunk->requested_size,
sizeof(chunk->requested_size));
- dsize = chunk->requested_size; /* real data */
+ dsize = chunk->requested_size; /* real data */
if (dsize > 0) /* not on a free list */
VALGRIND_MAKE_MEM_NOACCESS(&chunk->requested_size,
sizeof(chunk->requested_size));
}
}
-#endif /* MEMORY_CONTEXT_CHECKING */
+#endif /* MEMORY_CONTEXT_CHECKING */
*/
static const uint16 dsa_size_classes[] = {
sizeof(dsa_area_span), 0, /* special size classes */
- 8, 16, 24, 32, 40, 48, 56, 64, /* 8 classes separated by 8 bytes */
+ 8, 16, 24, 32, 40, 48, 56, 64, /* 8 classes separated by 8 bytes */
80, 96, 112, 128, /* 4 classes separated by 16 bytes */
160, 192, 224, 256, /* 4 classes separated by 32 bytes */
320, 384, 448, 512, /* 4 classes separated by 64 bytes */
/* Set up the segment map for this process's mapping. */
segment_map = &area->segment_maps[0];
- segment_map->segment = segment; /* NULL for in-place */
+ segment_map->segment = segment; /* NULL for in-place */
segment_map->mapped_address = place;
segment_map->header = (dsa_segment_header *) segment_map->mapped_address;
segment_map->fpm = (FreePageManager *)
save_ctr = ctr;
}
-#endif /* RANDOMIZE_ALLOCATED_MEMORY */
+#endif /* RANDOMIZE_ALLOCATED_MEMORY */
}
}
-#endif /* MEMORY_CONTEXT_CHECKING */
+#endif /* MEMORY_CONTEXT_CHECKING */
/* We can remember up to MAX_RESOWNER_LOCKS references to local locks. */
int nlocks; /* number of owned locks */
- LOCALLOCK *locks[MAX_RESOWNER_LOCKS]; /* list of owned locks */
+ LOCALLOCK *locks[MAX_RESOWNER_LOCKS]; /* list of owned locks */
} ResourceOwnerData;
* blocks that have been allocated for a tape, but have not been written
* to the underlying file yet.
*/
- long nBlocksAllocated; /* # of blocks allocated */
+ long nBlocksAllocated; /* # of blocks allocated */
long nBlocksWritten; /* # of blocks used in underlying file */
/*
/*
* GUC parameters
*/
-int old_snapshot_threshold; /* number of minutes, -1 disables */
+int old_snapshot_threshold; /* number of minutes, -1 disables */
/*
* Structure for dealing with old_snapshot_threshold implementation.
* only allowed to move forward.
*/
slock_t mutex_current; /* protect current_timestamp */
- TimestampTz current_timestamp; /* latest snapshot timestamp */
- slock_t mutex_latest_xmin; /* protect latest_xmin and
- * next_map_update */
+ TimestampTz current_timestamp; /* latest snapshot timestamp */
+ slock_t mutex_latest_xmin; /* protect latest_xmin and next_map_update */
TransactionId latest_xmin; /* latest snapshot xmin */
TimestampTz next_map_update; /* latest snapshot valid up to */
slock_t mutex_threshold; /* protect threshold fields */
else if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetRawXmin(tuple)))
{
if (HeapTupleHeaderGetCmin(tuple) >= curcid)
- return HeapTupleInvisible; /* inserted after scan started */
+ return HeapTupleInvisible; /* inserted after scan started */
if (tuple->t_infomask & HEAP_XMAX_INVALID) /* xid invalid */
return HeapTupleMayBeUpdated;
return HeapTupleSelfUpdated; /* updated after scan
* started */
else
- return HeapTupleInvisible; /* updated before scan
- * started */
+ return HeapTupleInvisible; /* updated before scan
+ * started */
}
}
if (HeapTupleHeaderGetCmax(tuple) >= curcid)
return HeapTupleSelfUpdated; /* updated after scan started */
else
- return HeapTupleInvisible; /* updated before scan started */
+ return HeapTupleInvisible; /* updated before scan started */
}
else if (TransactionIdIsInProgress(HeapTupleHeaderGetRawXmin(tuple)))
return HeapTupleInvisible;
if (HeapTupleHeaderGetCmax(tuple) >= curcid)
return HeapTupleSelfUpdated; /* updated after scan started */
else
- return HeapTupleInvisible; /* updated before scan started */
+ return HeapTupleInvisible; /* updated before scan started */
}
if (MultiXactIdIsRunning(HeapTupleHeaderGetRawXmax(tuple), false))
if (HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask))
return HeapTupleBeingUpdated;
if (HeapTupleHeaderGetCmax(tuple) >= curcid)
- return HeapTupleSelfUpdated; /* updated after scan started */
+ return HeapTupleSelfUpdated; /* updated after scan started */
else
return HeapTupleInvisible; /* updated before scan started */
}
else if (HeapTupleHeaderGetCmax(tuple) >= snapshot->curcid)
return true; /* updated after scan started */
else
- return false; /* updated before scan started */
+ return false; /* updated before scan started */
}
if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetRawXmax(tuple)))
if (pgtm->tm_zone == NULL)
return -1; /* probably shouldn't happen */
memset(cbuf, 0, sizeof(cbuf));
- strftime(cbuf, sizeof(cbuf) - 1, "%Z", systm); /* zone abbr */
+ strftime(cbuf, sizeof(cbuf) - 1, "%Z", systm); /* zone abbr */
if (strcmp(cbuf, pgtm->tm_zone) != 0)
{
#ifdef DEBUG_IDENTIFY_TIMEZONE
#endif
return NULL; /* go to GMT */
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
conflines = replace_token(conflines,
"host replication all ::1",
"#host replication all ::1");
-#endif /* HAVE_IPV6 */
+#endif /* HAVE_IPV6 */
/* Replace default authentication methods */
conflines = replace_token(conflines,
{"show", no_argument, NULL, 's'},
{"noclean", no_argument, NULL, 'n'}, /* for backwards compatibility */
{"no-clean", no_argument, NULL, 'n'},
- {"nosync", no_argument, NULL, 'N'}, /* for backwards compatibility */
+ {"nosync", no_argument, NULL, 'N'}, /* for backwards compatibility */
{"no-sync", no_argument, NULL, 'N'},
{"sync-only", no_argument, NULL, 'S'},
{"waldir", required_argument, NULL, 'X'},
/* Options and defaults */
bool debug = false; /* are we debugging? */
bool dryrun = false; /* are we performing a dry-run operation? */
-char *additional_ext = NULL; /* Extension to remove from filenames */
+char *additional_ext = NULL; /* Extension to remove from filenames */
char *archiveLocation; /* where to find the archive? */
char *restartWALFileName; /* the file from which we can restart restore */
char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */
-char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we
- * want to remain in
- * archive */
+char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we want
+ * to remain in archive */
/* =====================================================================
dryrun = true;
break;
case 'x':
- additional_ext = pg_strdup(optarg); /* Extension to remove
- * from xlogfile names */
+ additional_ext = pg_strdup(optarg); /* Extension to remove
+ * from xlogfile names */
break;
default:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
static bool fastcheckpoint = false;
static bool writerecoveryconf = false;
static bool do_sync = true;
-static int standby_message_timeout = 10 * 1000; /* 10 sec = default */
+static int standby_message_timeout = 10 * 1000; /* 10 sec = default */
static pg_time_t last_progress_report = 0;
static int32 maxrate = 0; /* no limit by default */
static char *replication_slot = NULL;
/*
* Directory
*/
- filename[strlen(filename) - 1] = '\0'; /* Remove trailing slash */
+ filename[strlen(filename) - 1] = '\0'; /* Remove trailing slash */
if (mkdir(filename, S_IRWXU) != 0)
{
/*
* are, you can call it an undocumented feature that you
* can map them too.)
*/
- filename[strlen(filename) - 1] = '\0'; /* Remove trailing slash */
+ filename[strlen(filename) - 1] = '\0'; /* Remove trailing slash */
mapped_tblspc_path = get_tablespace_mapping(©buf[157]);
if (symlink(mapped_tblspc_path, filename) != 0)
#ifdef HAVE_LIBZ
compresslevel = Z_DEFAULT_COMPRESSION;
#else
- compresslevel = 1; /* will be rejected below */
+ compresslevel = 1; /* will be rejected below */
#endif
break;
case 'Z':
static int verbose = 0;
static int compresslevel = 0;
static int noloop = 0;
-static int standby_message_timeout = 10 * 1000; /* 10 sec = default */
+static int standby_message_timeout = 10 * 1000; /* 10 sec = default */
static volatile bool time_to_abort = false;
static bool do_create_slot = false;
static bool slot_exists_ok = false;
static char *outfile = NULL;
static int verbose = 0;
static int noloop = 0;
-static int standby_message_timeout = 10 * 1000; /* 10 sec = default */
+static int standby_message_timeout = 10 * 1000; /* 10 sec = default */
static int fsync_interval = 10 * 1000; /* 10 sec = default */
static XLogRecPtr startpos = InvalidXLogRecPtr;
static XLogRecPtr endpos = InvalidXLogRecPtr;
len += 1;
fe_sendint64(output_written_lsn, &replybuf[len]); /* write */
len += 8;
- fe_sendint64(output_fsync_lsn, &replybuf[len]); /* flush */
+ fe_sendint64(output_fsync_lsn, &replybuf[len]); /* flush */
len += 8;
fe_sendint64(InvalidXLogRecPtr, &replybuf[len]); /* apply */
len += 8;
fe_sendint64(now, &replybuf[len]); /* sendTime */
len += 8;
- replybuf[len] = replyRequested ? 1 : 0; /* replyRequested */
+ replybuf[len] = replyRequested ? 1 : 0; /* replyRequested */
len += 1;
startpos = output_written_lsn;
static bool reportFlushPosition = false;
static XLogRecPtr lastFlushPosition = InvalidXLogRecPtr;
-static bool still_sending = true; /* feedback still needs to be sent? */
+static bool still_sending = true; /* feedback still needs to be sent? */
static PGresult *HandleCopyStream(PGconn *conn, StreamCtl *stream,
XLogRecPtr *stoppos);
replybuf[len] = 'r';
len += 1;
- fe_sendint64(blockpos, &replybuf[len]); /* write */
+ fe_sendint64(blockpos, &replybuf[len]); /* write */
len += 8;
if (reportFlushPosition)
- fe_sendint64(lastFlushPosition, &replybuf[len]); /* flush */
+ fe_sendint64(lastFlushPosition, &replybuf[len]); /* flush */
else
- fe_sendint64(InvalidXLogRecPtr, &replybuf[len]); /* flush */
+ fe_sendint64(InvalidXLogRecPtr, &replybuf[len]); /* flush */
len += 8;
fe_sendint64(InvalidXLogRecPtr, &replybuf[len]); /* apply */
len += 8;
fe_sendint64(now, &replybuf[len]); /* sendTime */
len += 8;
- replybuf[len] = replyRequested ? 1 : 0; /* replyRequested */
+ replybuf[len] = replyRequested ? 1 : 0; /* replyRequested */
len += 1;
if (PQputCopyData(conn, replybuf, len) <= 0 || PQflush(conn))
TimeLineID timeline; /* Timeline to stream data from */
char *sysidentifier; /* Validate this system identifier and
* timeline */
- int standby_message_timeout; /* Send status messages this
- * often */
+ int standby_message_timeout; /* Send status messages this often */
bool synchronous; /* Flush immediately WAL data on write */
bool mark_done; /* Mark segment as done in generated archive */
bool do_sync; /* Flush to disk to ensure consistent state of
WalWriteMethod *walmethod; /* How to write the WAL */
char *partial_suffix; /* Suffix appended to partially received files */
- char *replication_slot; /* Replication slot to use, or NULL */
+ char *replication_slot; /* Replication slot to use, or NULL */
bool temp_slot; /* Create temporary replication slot */
} StreamCtl;
extern bool ReceiveXlogStream(PGconn *conn,
StreamCtl *stream);
-#endif /* RECEIVELOG_H */
+#endif /* RECEIVELOG_H */
extern void fe_sendint64(int64 i, char *buf);
extern int64 fe_recvint64(char *buf);
-#endif /* STREAMUTIL_H */
+#endif /* STREAMUTIL_H */
static char *log_file = NULL;
static char *exec_path = NULL;
static char *event_source = NULL;
-static char *register_servicename = "PostgreSQL"; /* FIXME: + version ID? */
+static char *register_servicename = "PostgreSQL"; /* FIXME: + version ID? */
static char *register_username = NULL;
static char *register_password = NULL;
static char *argv0 = NULL;
*/
if (pgwin32_is_service()) /* Running as a service */
{
- char errbuf[2048]; /* Arbitrary size? */
+ char errbuf[2048]; /* Arbitrary size? */
vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
postmasterProcess = pi.hProcess;
CloseHandle(pi.hThread);
return pi.dwProcessId; /* Shell's PID, not postmaster's! */
-#endif /* WIN32 */
+#endif /* WIN32 */
}
*/
if ((arg1 = strstr(optline, " \"")) != NULL)
{
- *arg1 = '\0'; /* terminate so we get only program
- * name */
+ *arg1 = '\0'; /* terminate so we get only program name */
post_opts = pg_strdup(arg1 + 1); /* point past whitespace */
}
if (exec_path == NULL)
if ((pid = get_pgpid(false)) != 0)
{
print_msg(".");
- pg_usleep(1000000); /* 1 sec */
+ pg_usleep(1000000); /* 1 sec */
}
else
break;
if ((pid = get_pgpid(false)) != 0)
{
print_msg(".");
- pg_usleep(1000000); /* 1 sec */
+ pg_usleep(1000000); /* 1 sec */
}
else
break;
osv.dwOSVersionInfoSize = sizeof(osv);
/* Windows XP = Version 5.1 */
- return (!GetVersionEx(&osv) || /* could not get version */
+ return (!GetVersionEx(&osv) || /* could not get version */
osv.dwMajorVersion > 5 || (osv.dwMajorVersion == 5 && osv.dwMinorVersion >= 1));
}
osv.dwOSVersionInfoSize = sizeof(osv);
/* Windows 7 = Version 6.0 */
- return (!GetVersionEx(&osv) || /* could not get version */
+ return (!GetVersionEx(&osv) || /* could not get version */
osv.dwMajorVersion > 6 || (osv.dwMajorVersion == 6 && osv.dwMinorVersion >= 0));
}
#endif
break;
}
- case (WAIT_OBJECT_0 + 1): /* postmaster went down */
+ case (WAIT_OBJECT_0 + 1): /* postmaster went down */
break;
default:
*/
return r;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
static void
do_advice(void)
free(out);
free(zp);
}
-#endif /* HAVE_LIBZ */
+#endif /* HAVE_LIBZ */
/*
while (!(*input == '"' && *(input + 1) != '"'))
{
if (*input == '\0')
- return input; /* really a syntax error... */
+ return input; /* really a syntax error... */
/*
* Quoting convention is to escape " as "". Keep this code in
const char *acl_column, const char *acl_owner,
const char *obj_kind, bool binary_upgrade);
-#endif /* DUMPUTILS_H */
+#endif /* DUMPUTILS_H */
T_WorkerStatus workerStatus; /* see enum above */
/* These fields are valid if workerStatus == WRKR_WORKING: */
- ParallelCompletionPtr callback; /* function to call on completion */
+ ParallelCompletionPtr callback; /* function to call on completion */
void *callback_data; /* passthrough data for it */
ArchiveHandle *AH; /* Archive data worker is using */
#define piperead(a,b,c) read(a,b,c)
#define pipewrite(a,b,c) write(a,b,c)
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
* State info for archive_close_connection() shutdown callback.
/* globally visible variables (needed by exit_nicely) */
bool parallel_init_done = false;
DWORD mainThreadId;
-#endif /* WIN32 */
+#endif /* WIN32 */
static const char *modulename = gettext_noop("parallel archiver");
return id_return;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
* pg_dump and pg_restore call this to register the cleanup handler
break;
}
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/* On all platforms, update workerStatus and te[] as well */
Assert(j < pstate->numWorkers);
}
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
_endthreadex(0);
return 0;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
* This function starts a parallel dump or restore by spawning off the worker
closesocket(pipeMW[PIPE_READ]);
/* close write end of Worker -> Master */
closesocket(pipeWM[PIPE_WRITE]);
-#endif /* WIN32 */
+#endif /* WIN32 */
}
/*
return ret;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
extern void set_archive_cancel_info(ArchiveHandle *AH, PGconn *conn);
-#endif /* PG_DUMP_PARALLEL_H */
+#endif /* PG_DUMP_PARALLEL_H */
int createDB; /* Issue commands to create the database */
int noOwner; /* Don't try to match original object owner */
int noTablespace; /* Don't issue tablespace-related commands */
- int disable_triggers; /* disable triggers during data-only
- * restore */
+ int disable_triggers; /* disable triggers during data-only
+ * restore */
int use_setsessauth; /* Use SET SESSION AUTHORIZATION commands
* instead of OWNER TO */
char *superuser; /* Username to use as superuser */
int column_inserts;
int if_exists;
int no_publications; /* Skip publication entries */
- int no_security_labels; /* Skip security label entries */
- int no_subscriptions; /* Skip subscription entries */
+ int no_security_labels; /* Skip security label entries */
+ int no_subscriptions; /* Skip subscription entries */
int strict_names;
const char *filename;
RestoreOptions *ropt; /* options, if restoring */
int verbose;
- char *remoteVersionStr; /* server's version string */
+ char *remoteVersionStr; /* server's version string */
int remoteVersion; /* same in numeric form */
bool isStandby; /* is server a standby node */
- int minRemoteVersion; /* allowable range */
+ int minRemoteVersion; /* allowable range */
int maxRemoteVersion;
int numWorkers; /* number of parallel processes */
- char *sync_snapshot_id; /* sync snapshot id for parallel
- * operation */
+ char *sync_snapshot_id; /* sync snapshot id for parallel operation */
/* info needed for string escaping */
int encoding; /* libpq code for client_encoding */
#define appendStringLiteralAH(buf,str,AH) \
appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings)
-#endif /* PG_BACKUP_H */
+#endif /* PG_BACKUP_H */
defnDumped = false;
- if ((reqs & REQ_SCHEMA) != 0) /* We want the schema */
+ if ((reqs & REQ_SCHEMA) != 0) /* We want the schema */
{
/* Show namespace if available */
if (te->namespace)
AH->lookahead[AH->lookaheadLen++] = vmin;
/* Check header version; varies from V1.0 */
- if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */
+ if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */
{
if ((byteread = fgetc(fh)) == EOF)
READ_ERROR_EXIT(fh);
{
struct tm crtm;
- (*AH->WriteBufPtr) (AH, "PGDMP", 5); /* Magic code */
+ (*AH->WriteBufPtr) (AH, "PGDMP", 5); /* Magic code */
(*AH->WriteBytePtr) (AH, ARCHIVE_MAJOR(AH->version));
(*AH->WriteBytePtr) (AH, ARCHIVE_MINOR(AH->version));
(*AH->WriteBytePtr) (AH, ARCHIVE_REV(AH->version));
vmaj = (*AH->ReadBytePtr) (AH);
vmin = (*AH->ReadBytePtr) (AH);
- if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */
+ if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */
vrev = (*AH->ReadBytePtr) (AH);
else
vrev = 0;
/* Historical version numbers (checked in code) */
#define K_VERS_1_0 MAKE_ARCHIVE_VERSION(1, 0, 0)
-#define K_VERS_1_2 MAKE_ARCHIVE_VERSION(1, 2, 0) /* Allow No ZLIB */
-#define K_VERS_1_3 MAKE_ARCHIVE_VERSION(1, 3, 0) /* BLOBs */
-#define K_VERS_1_4 MAKE_ARCHIVE_VERSION(1, 4, 0) /* Date & name in header */
-#define K_VERS_1_5 MAKE_ARCHIVE_VERSION(1, 5, 0) /* Handle dependencies */
-#define K_VERS_1_6 MAKE_ARCHIVE_VERSION(1, 6, 0) /* Schema field in TOCs */
-#define K_VERS_1_7 MAKE_ARCHIVE_VERSION(1, 7, 0) /* File Offset size in
- * header */
-#define K_VERS_1_8 MAKE_ARCHIVE_VERSION(1, 8, 0) /* change interpretation
- * of ID numbers and
- * dependencies */
-#define K_VERS_1_9 MAKE_ARCHIVE_VERSION(1, 9, 0) /* add default_with_oids
- * tracking */
-#define K_VERS_1_10 MAKE_ARCHIVE_VERSION(1, 10, 0) /* add tablespace */
-#define K_VERS_1_11 MAKE_ARCHIVE_VERSION(1, 11, 0) /* add toc section
- * indicator */
-#define K_VERS_1_12 MAKE_ARCHIVE_VERSION(1, 12, 0) /* add separate BLOB
- * entries */
+#define K_VERS_1_2 MAKE_ARCHIVE_VERSION(1, 2, 0) /* Allow No ZLIB */
+#define K_VERS_1_3 MAKE_ARCHIVE_VERSION(1, 3, 0) /* BLOBs */
+#define K_VERS_1_4 MAKE_ARCHIVE_VERSION(1, 4, 0) /* Date & name in header */
+#define K_VERS_1_5 MAKE_ARCHIVE_VERSION(1, 5, 0) /* Handle dependencies */
+#define K_VERS_1_6 MAKE_ARCHIVE_VERSION(1, 6, 0) /* Schema field in TOCs */
+#define K_VERS_1_7 MAKE_ARCHIVE_VERSION(1, 7, 0) /* File Offset size in
+ * header */
+#define K_VERS_1_8 MAKE_ARCHIVE_VERSION(1, 8, 0) /* change interpretation
+ * of ID numbers and
+ * dependencies */
+#define K_VERS_1_9 MAKE_ARCHIVE_VERSION(1, 9, 0) /* add default_with_oids
+ * tracking */
+#define K_VERS_1_10 MAKE_ARCHIVE_VERSION(1, 10, 0) /* add tablespace */
+#define K_VERS_1_11 MAKE_ARCHIVE_VERSION(1, 11, 0) /* add toc section
+ * indicator */
+#define K_VERS_1_12 MAKE_ARCHIVE_VERSION(1, 12, 0) /* add separate BLOB
+ * entries */
/* Current archive version number (the format we can output) */
#define K_VERS_MAJOR 1
char *archiveRemoteVersion; /* When reading an archive, the
* version of the dumped DB */
- char *archiveDumpVersion; /* When reading an archive, the
- * version of the dumper */
+ char *archiveDumpVersion; /* When reading an archive, the version of
+ * the dumper */
int debugLevel; /* Used for logging (currently only by
* --verbose) */
size_t lookaheadLen; /* Length of data in lookahead */
pgoff_t lookaheadPos; /* Current read position in lookahead buffer */
- ArchiveEntryPtrType ArchiveEntryPtr; /* Called for each metadata
- * object */
- StartDataPtrType StartDataPtr; /* Called when table data is about to
- * be dumped */
- WriteDataPtrType WriteDataPtr; /* Called to send some table data to
- * the archive */
+ ArchiveEntryPtrType ArchiveEntryPtr; /* Called for each metadata object */
+ StartDataPtrType StartDataPtr; /* Called when table data is about to be
+ * dumped */
+ WriteDataPtrType WriteDataPtr; /* Called to send some table data to the
+ * archive */
EndDataPtrType EndDataPtr; /* Called when table data dump is finished */
- WriteBytePtrType WriteBytePtr; /* Write a byte to output */
+ WriteBytePtrType WriteBytePtr; /* Write a byte to output */
ReadBytePtrType ReadBytePtr; /* Read a byte from an archive */
WriteBufPtrType WriteBufPtr; /* Write a buffer of output to the archive */
ReadBufPtrType ReadBufPtr; /* Read a buffer of input from the archive */
ClosePtrType ClosePtr; /* Close the archive */
ReopenPtrType ReopenPtr; /* Reopen the archive */
- WriteExtraTocPtrType WriteExtraTocPtr; /* Write extra TOC entry data
- * associated with the current
- * archive format */
- ReadExtraTocPtrType ReadExtraTocPtr; /* Read extra info associated
- * with archive format */
- PrintExtraTocPtrType PrintExtraTocPtr; /* Extra TOC info for format */
+ WriteExtraTocPtrType WriteExtraTocPtr; /* Write extra TOC entry data
+ * associated with the current
+ * archive format */
+ ReadExtraTocPtrType ReadExtraTocPtr; /* Read extra info associated with
+ * archive format */
+ PrintExtraTocPtrType PrintExtraTocPtr; /* Extra TOC info for format */
PrintTocDataPtrType PrintTocDataPtr;
StartBlobsPtrType StartBlobsPtr;
ClonePtrType ClonePtr; /* Clone format-specific fields */
DeClonePtrType DeClonePtr; /* Clean up cloned fields */
- CustomOutPtrType CustomOutPtr; /* Alternative script output routine */
+ CustomOutPtrType CustomOutPtr; /* Alternative script output routine */
/* Stuff for direct DB connection */
char *archdbname; /* DB name *read* from archive */
th->targetFile, filename);
/* Header doesn't match, so read to next header */
- len = ((th->fileLen + 511) & ~511); /* Padded length */
+ len = ((th->fileLen + 511) & ~511); /* Padded length */
blks = len >> 9; /* # of 512 byte blocks */
for (i = 0; i < blks; i++)
extern void exit_horribly(const char *modulename, const char *fmt,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
-#endif /* PG_BACKUP_UTILS_H */
+#endif /* PG_BACKUP_UTILS_H */
if (tdinfo->dobj.dump & DUMP_COMPONENT_DATA)
ArchiveEntry(fout,
- tdinfo->dobj.catId, /* catalog ID */
- tdinfo->dobj.dumpId, /* dump ID */
+ tdinfo->dobj.catId, /* catalog ID */
+ tdinfo->dobj.dumpId, /* dump ID */
tbinfo->dobj.name, /* Name */
tbinfo->dobj.namespace->dobj.name, /* Namespace */
NULL, /* Tablespace */
"", /* Del */
NULL, /* Copy */
tdinfo->dobj.dependencies, /* Deps */
- tdinfo->dobj.nDeps, /* # Deps */
+ tdinfo->dobj.nDeps, /* # Deps */
NULL, /* Dumper */
NULL); /* Dumper Arg */
dba, /* Owner */
false, /* with oids */
"DATABASE", /* Desc */
- SECTION_PRE_DATA, /* Section */
+ SECTION_PRE_DATA, /* Section */
creaQry->data, /* Create */
delQry->data, /* Del */
NULL, /* Copy */
if (strlen(agginfo[i].aggfn.rolname) == 0)
write_msg(NULL, "WARNING: owner of aggregate function \"%s\" appears to be invalid\n",
agginfo[i].aggfn.dobj.name);
- agginfo[i].aggfn.lang = InvalidOid; /* not currently interesting */
- agginfo[i].aggfn.prorettype = InvalidOid; /* not saved */
+ agginfo[i].aggfn.lang = InvalidOid; /* not currently interesting */
+ agginfo[i].aggfn.prorettype = InvalidOid; /* not saved */
agginfo[i].aggfn.proacl = pg_strdup(PQgetvalue(res, i, i_aggacl));
agginfo[i].aggfn.rproacl = pg_strdup(PQgetvalue(res, i, i_raggacl));
agginfo[i].aggfn.initproacl = pg_strdup(PQgetvalue(res, i, i_initaggacl));
tblinfo[i].interesting = tblinfo[i].dobj.dump ? true : false;
tblinfo[i].dummy_view = false; /* might get set during sort */
- tblinfo[i].postponed_def = false; /* might get set during sort */
+ tblinfo[i].postponed_def = false; /* might get set during sort */
tblinfo[i].is_identity_sequence = (i_is_identity_sequence >= 0 &&
strcmp(PQgetvalue(res, i, i_is_identity_sequence), "t") == 0);
PQExpBuffer asPart;
PGresult *res;
char *funcsig; /* identity signature */
- char *funcfullsig = NULL; /* full signature */
+ char *funcfullsig = NULL; /* full signature */
char *funcsig_tag;
char *proretset;
char *prosrc;
PQExpBuffer labelq;
PQExpBuffer details;
char *aggsig; /* identity signature */
- char *aggfullsig = NULL; /* full signature */
+ char *aggfullsig = NULL; /* full signature */
char *aggsig_tag;
PGresult *res;
int i_aggtransfn;
char *name; /* object name (should never be NULL) */
struct _namespaceInfo *namespace; /* containing namespace, or NULL */
DumpComponents dump; /* bitmask of components to dump */
- DumpComponents dump_contains; /* as above, but for contained objects */
+ DumpComponents dump_contains; /* as above, but for contained objects */
bool ext_member; /* true if object is member of extension */
DumpId *dependencies; /* dumpIds of objects this one depends on */
int nDeps; /* number of valid dependencies */
char *reltablespace; /* relation tablespace */
char *reloptions; /* options specified by WITH (...) */
char *checkoption; /* WITH CHECK OPTION, if any */
- char *toast_reloptions; /* WITH options for the TOAST table */
+ char *toast_reloptions; /* WITH options for the TOAST table */
bool hasindex; /* does it have any indexes? */
bool hasrules; /* does it have any rules? */
bool hastriggers; /* does it have any triggers? */
char **attfdwoptions; /* per-attribute fdw options */
bool *notnull; /* NOT NULL constraints on attributes */
bool *inhNotNull; /* true if NOT NULL is inherited */
- struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
+ struct _attrDefInfo **attrdefs; /* DEFAULT expressions */
struct _constraintInfo *checkexprs; /* CHECK constraints */
char *partkeydef; /* partition key definition */
char *partbound; /* partition bound definition */
*/
int numParents; /* number of (immediate) parent tables */
struct _tableInfo **parents; /* TableInfos of immediate parents */
- struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
+ struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
int numTriggers; /* number of triggers for table */
- struct _triggerInfo *triggers; /* array of TriggerInfo structs */
+ struct _triggerInfo *triggers; /* array of TriggerInfo structs */
} TableInfo;
typedef struct _attrDefInfo
int numTables);
extern void getSubscriptions(Archive *fout);
-#endif /* PG_DUMP_H */
+#endif /* PG_DUMP_H */
static bool
TopoSort(DumpableObject **objs,
int numObjs,
- DumpableObject **ordering, /* output argument */
+ DumpableObject **ordering, /* output argument */
int *nOrdering) /* output argument */
{
DumpId maxDumpId = getMaxDumpId();
#include "pg_getopt.h"
-static ControlFileData ControlFile; /* pg_control values */
+static ControlFileData ControlFile; /* pg_control values */
static XLogSegNo newXlogSegNo; /* new XLOG segment # */
static bool guessed = false; /* T if we had to guess at any values */
static const char *progname;
RewriteControlFile(void)
{
int fd;
- char buffer[PG_CONTROL_SIZE]; /* need not be aligned */
+ char buffer[PG_CONTROL_SIZE]; /* need not be aligned */
/*
* Adjust fields as needed to force an empty XLOG starting at
#else
pg_fatal("\"%s\" is a symbolic link, but symbolic links are not supported on this platform\n",
fullpath);
-#endif /* HAVE_READLINK */
+#endif /* HAVE_READLINK */
}
}
extern bool datapagemap_next(datapagemap_iterator_t *iter, BlockNumber *blkno);
extern void datapagemap_print(datapagemap_t *map);
-#endif /* DATAPAGEMAP_H */
+#endif /* DATAPAGEMAP_H */
typedef void (*process_file_callback_t) (const char *path, file_type_t type, size_t size, const char *link_target);
extern void traverse_datadir(const char *datadir, process_file_callback_t callback);
-#endif /* FETCH_H */
+#endif /* FETCH_H */
extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
-#endif /* FILE_OPS_H */
+#endif /* FILE_OPS_H */
BlockNumber blkno);
extern void filemap_finalize(void);
-#endif /* FILEMAP_H */
+#endif /* FILEMAP_H */
extern void progress_report(bool force);
-#endif /* PG_REWIND_LOGGING_H */
+#endif /* PG_REWIND_LOGGING_H */
pg_fatal("backup label buffer too small\n"); /* shouldn't happen */
/* TODO: move old file out of the way, if any. */
- open_target_file("backup_label", true); /* BACKUP_LABEL_FILE */
+ open_target_file("backup_label", true); /* BACKUP_LABEL_FILE */
write_target_range(buf, 0, len);
close_target_file();
}
extern TimeLineHistoryEntry *rewind_parseTimeLineHistory(char *buffer,
TimeLineID targetTLI, int *nentries);
-#endif /* PG_REWIND_H */
+#endif /* PG_REWIND_H */
schemaName, relName, src, dst, strerror(errno));
}
-#endif /* WIN32 */
+#endif /* WIN32 */
}
{
Oid db_oid; /* oid of the database */
char *db_name; /* database name */
- char db_tablespace[MAXPGPATH]; /* database default tablespace
- * path */
+ char db_tablespace[MAXPGPATH]; /* database default tablespace
+ * path */
char *db_collate;
char *db_ctype;
int db_encoding;
uint32 major_version; /* PG_VERSION of cluster */
char major_version_str[64]; /* string PG_VERSION of cluster */
uint32 bin_version; /* version returned from pg_ctl */
- const char *tablespace_suffix; /* directory specification */
+ const char *tablespace_suffix; /* directory specification */
} ClusterInfo;
if (sep != NULL)
{
*dir = pg_strdup(path);
- (*dir)[(sep - path) + 1] = '\0'; /* no strndup */
+ (*dir)[(sep - path) + 1] = '\0'; /* no strndup */
*fname = pg_strdup(sep + 1);
}
/* local directory */
extern const RmgrDescData RmgrDescTable[];
-#endif /* RMGRDESC_H */
+#endif /* RMGRDESC_H */
#ifdef WIN32
#define FD_SETSIZE 1024 /* set before winsock2.h is included */
-#endif /* ! WIN32 */
+#endif /* ! WIN32 */
#include "postgres_fe.h"
#define LOG_STEP_SECONDS 5 /* seconds between log messages */
#define DEFAULT_NXACTS 10 /* default nxacts */
-#define MIN_GAUSSIAN_PARAM 2.0 /* minimum parameter for gauss */
+#define MIN_GAUSSIAN_PARAM 2.0 /* minimum parameter for gauss */
int nxacts = 0; /* number of transactions per client */
int duration = 0; /* duration in seconds */
pthread_t thread; /* thread handle */
CState *state; /* array of CState */
int nstate; /* length of state[] */
- unsigned short random_state[3]; /* separate randomness for each thread */
- int64 throttle_trigger; /* previous/next throttling (us) */
+ unsigned short random_state[3]; /* separate randomness for each thread */
+ int64 throttle_trigger; /* previous/next throttling (us) */
FILE *logfile; /* where to log, or NULL */
/* per thread collected stats */
{
int64 tmp = result * 10 + (*ptr++ - '0');
- if ((tmp / 10) != result) /* overflow? */
+ if ((tmp / 10) != result) /* overflow? */
fprintf(stderr, "value \"%s\" is out of range for type bigint\n", str);
result = tmp;
}
st->state = CSTATE_FINISHED;
break;
}
- else if (!ret) /* on error */
+ else if (!ret) /* on error */
{
commandFailed(st, "execution of meta-command 'setshell' failed");
st->state = CSTATE_ABORTED;
st->state = CSTATE_FINISHED;
break;
}
- else if (!ret) /* on error */
+ else if (!ret) /* on error */
{
commandFailed(st, "execution of meta-command 'shell' failed");
st->state = CSTATE_ABORTED;
Command *my_command;
PQExpBufferData word_buf;
int word_offset;
- int offsets[MAX_ARGS]; /* offsets of argument words */
+ int offsets[MAX_ARGS]; /* offsets of argument words */
int start_offset,
end_offset;
int lineno;
};
int c;
- int is_init_mode = 0; /* initialize mode? */
- int is_no_vacuum = 0; /* no vacuum at all before testing? */
+ int is_init_mode = 0; /* initialize mode? */
+ int is_no_vacuum = 0; /* no vacuum at all before testing? */
int do_vacuum_accounts = 0; /* do vacuum accounts before testing? */
int optindex;
bool scale_given = false;
if (getrlimit(RLIMIT_NOFILE, &rlim) == -1)
#else /* but BSD doesn't ... */
if (getrlimit(RLIMIT_OFILE, &rlim) == -1)
-#endif /* RLIMIT_NOFILE */
+#endif /* RLIMIT_NOFILE */
{
fprintf(stderr, "getrlimit failed: %s\n", strerror(errno));
exit(1);
fprintf(stderr, "Reduce number of clients, or use limit/ulimit to increase the system limit.\n");
exit(1);
}
-#endif /* HAVE_GETRLIMIT */
+#endif /* HAVE_GETRLIMIT */
break;
case 'j': /* jobs */
benchmarking_option_set = true;
fprintf(stderr, "threads are not supported on this platform; use -j1\n");
exit(1);
}
-#endif /* !ENABLE_THREAD_SAFETY */
+#endif /* !ENABLE_THREAD_SAFETY */
break;
case 'C':
benchmarking_option_set = true;
end_time = INSTR_TIME_GET_MICROSEC(threads[0].start_time) +
(int64) 1000000 * duration;
threads[0].thread = INVALID_THREAD;
-#endif /* ENABLE_THREAD_SAFETY */
+#endif /* ENABLE_THREAD_SAFETY */
/* wait for threads and accumulate results */
initStats(&stats, 0);
pthread_join(thread->thread, NULL);
#else
(void) threadRun(thread);
-#endif /* ENABLE_THREAD_SAFETY */
+#endif /* ENABLE_THREAD_SAFETY */
/* aggregate thread level stats */
mergeSimpleStats(&stats.latency, &thread->stats.latency);
instr_time start,
end;
int nstate = thread->nstate;
- int remains = nstate; /* number of remaining clients */
+ int remains = nstate; /* number of remaining clients */
int i;
/* for reporting progress: */
fd_set input_mask;
int maxsock; /* max socket number to be waited for */
int64 min_usec;
- int64 now_usec = 0; /* set this only if needed */
+ int64 now_usec = 0; /* set this only if needed */
/* identify which client sockets should be checked for input */
FD_ZERO(&input_mask);
return 0;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
extern int64 strtoint64(const char *str);
-#endif /* PGBENCH_H */
+#endif /* PGBENCH_H */
* directory, so if someone wants to code this here instead...
*/
dir = "/";
-#endif /* WIN32 */
+#endif /* WIN32 */
}
if (chdir(dir) == -1)
extern void UnsyncVariables(void);
-#endif /* COMMAND_H */
+#endif /* COMMAND_H */
SetConsoleCtrlHandler(consoleHandler, TRUE);
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/* ConnectionUp
extern bool recognized_connection_string(const char *connstr);
-#endif /* COMMON_H */
+#endif /* COMMON_H */
extern int conditional_stack_get_paren_depth(ConditionalStack cstack);
-#endif /* CONDITIONAL_H */
+#endif /* CONDITIONAL_H */
result = pg_malloc0(sizeof(struct copy_options));
- result->before_tofrom = pg_strdup(""); /* initialize for appending */
+ result->before_tofrom = pg_strdup(""); /* initialize for appending */
token = strtokx(args, whitespace, ".,()", "\"",
0, false, false, pset.encoding);
/* prototypes */
extern bool PrintResultsInCrosstab(const PGresult *res);
-#endif /* CROSSTABVIEW_H */
+#endif /* CROSSTABVIEW_H */
if (showSeq)
appendPQExpBufferStr(&buf, CppAsString2(RELKIND_SEQUENCE) ",");
if (showSystem || pattern)
- appendPQExpBufferStr(&buf, "'s',"); /* was RELKIND_SPECIAL */
+ appendPQExpBufferStr(&buf, "'s',"); /* was RELKIND_SPECIAL */
if (showForeign)
appendPQExpBufferStr(&buf, CppAsString2(RELKIND_FOREIGN_TABLE) ",");
/* \dRs */
bool describeSubscriptions(const char *pattern, bool verbose);
-#endif /* DESCRIBE_H */
+#endif /* DESCRIBE_H */
while (topic[j] != ' ' && j++ <= len)
wordlen++;
}
- if (wordlen >= len) /* Don't try again if the same word */
+ if (wordlen >= len) /* Don't try again if the same word */
{
if (!output)
output = PageOutput(nl_count, pager ? &(pset.popt.topt) : NULL);
}
END_ITERATE_HISTORY();
}
-#endif /* USE_READLINE */
+#endif /* USE_READLINE */
/*
#if defined(HAVE_HISTORY_H)
#include
#endif
-#endif /* HAVE_READLINE_READLINE_H, etc */
-#endif /* HAVE_LIBREADLINE */
+#endif /* HAVE_READLINE_READLINE_H, etc */
+#endif /* HAVE_LIBREADLINE */
#include "pqexpbuffer.h"
extern void pg_append_history(const char *s, PQExpBuffer history_buf);
extern void pg_send_history(PQExpBuffer history_buf);
-#endif /* INPUT_H */
+#endif /* INPUT_H */
bool do_lo_unlink(const char *loid_arg);
bool do_lo_list(void);
-#endif /* LARGE_OBJ_H */
+#endif /* LARGE_OBJ_H */
{
PsqlScanState scan_state; /* lexer working state */
ConditionalStack cond_stack; /* \if status stack */
- volatile PQExpBuffer query_buf; /* buffer for query being accumulated */
+ volatile PQExpBuffer query_buf; /* buffer for query being accumulated */
volatile PQExpBuffer previous_buf; /* if there isn't anything in the new
* buffer yet, use this one for \e,
* etc. */
extern int MainLoop(FILE *source);
-#endif /* MAINLOOP_H */
+#endif /* MAINLOOP_H */
*/
buf[0] = (*p == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE;
buf[1] = '\0';
-#endif /* USE_READLINE */
+#endif /* USE_READLINE */
break;
default:
char *get_prompt(promptStatus_t status, ConditionalStack cstack);
-#endif /* PROMPT_H */
+#endif /* PROMPT_H */
FILE *copyStream; /* Stream to read/write for \copy command */
- PGresult *last_error_result; /* most recent error result, if any */
+ PGresult *last_error_result; /* most recent error result, if any */
printQueryOpt popt;
#else /* WIN32 */
#include
#include
-#endif /* WIN32 */
+#endif /* WIN32 */
#include "getopt_long.h"
extern char *quote_if_needed(const char *source, const char *entails_quote,
char quote, char escape, int encoding);
-#endif /* STRINGUTILS_H */
+#endif /* STRINGUTILS_H */
*/
static const char *completion_charp; /* to pass a string */
static const char *const *completion_charpp; /* to pass a list of strings */
-static const char *completion_info_charp; /* to pass a second string */
-static const char *completion_info_charp2; /* to pass a third string */
+static const char *completion_info_charp; /* to pass a second string */
+static const char *completion_info_charp2; /* to pass a third string */
static const SchemaQuery *completion_squery; /* to pass a SchemaQuery */
static bool completion_case_sensitive; /* completion is case sensitive */
{"SYSTEM", NULL, NULL, THING_NO_CREATE | THING_NO_DROP},
{"TABLE", NULL, &Query_for_list_of_tables},
{"TABLESPACE", Query_for_list_of_tablespaces},
- {"TEMP", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE TEMP TABLE
- * ... */
+ {"TEMP", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE TEMP TABLE
+ * ... */
{"TEMPLATE", Query_for_list_of_ts_templates, NULL, THING_NO_SHOW},
{"TEMPORARY", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE TEMPORARY
* TABLE ... */
{"TRANSFORM", NULL, NULL},
{"TRIGGER", "SELECT pg_catalog.quote_ident(tgname) FROM pg_catalog.pg_trigger WHERE substring(pg_catalog.quote_ident(tgname),1,%d)='%s' AND NOT tgisinternal"},
{"TYPE", NULL, &Query_for_list_of_datatypes},
- {"UNIQUE", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE UNIQUE
- * INDEX ... */
+ {"UNIQUE", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE UNIQUE
+ * INDEX ... */
{"UNLOGGED", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE UNLOGGED
* TABLE ... */
{"USER", Query_for_list_of_roles},
return s;
}
-#endif /* NOT_USED */
+#endif /* NOT_USED */
-#endif /* USE_READLINE */
+#endif /* USE_READLINE */
extern void initialize_readline(void);
-#endif /* TAB_COMPLETE_H */
+#endif /* TAB_COMPLETE_H */
}
}
else if (new_value)
- pg_free(new_value); /* current->value is left unchanged */
+ pg_free(new_value); /* current->value is left unchanged */
return confirmed;
}
void PsqlVarEnumError(const char *name, const char *value, const char *suggestions);
-#endif /* VARIABLES_H */
+#endif /* VARIABLES_H */
SetConsoleCtrlHandler(consoleHandler, TRUE);
}
-#endif /* WIN32 */
+#endif /* WIN32 */
extern void ResetCancelConn(void);
-#endif /* COMMON_H */
+#endif /* COMMON_H */
log_error4(_("could not change directory to \"%s\": %s"), orig_wd, strerror(errno));
return -1;
}
-#endif /* HAVE_READLINK */
+#endif /* HAVE_READLINK */
return 0;
}
CloseHandle(childstdoutrddup);
return retval;
-#endif /* WIN32 */
+#endif /* WIN32 */
}
return 0;
}
-#endif /* PG_FLUSH_DATA_WORKS */
+#endif /* PG_FLUSH_DATA_WORKS */
/*
* fsync_fname -- Try to fsync a file or directory
}
}
else
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
{
/* struct was built by getaddrinfo() */
if (ai != NULL)
return 0;
}
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
*/
#define PG_KEYWORD(a,b,c) {a,0,c},
-#endif /* FRONTEND */
+#endif /* FRONTEND */
const ScanKeyword ScanKeywords[] = {
b = c + ROT_LEFT((b + F(c, d, a) + X[7] + 0xfd469501), 22); /* 8 */
a = b + ROT_LEFT((a + F(b, c, d) + X[8] + 0x698098d8), 7); /* 9 */
d = a + ROT_LEFT((d + F(a, b, c) + X[9] + 0x8b44f7af), 12); /* 10 */
- c = d + ROT_LEFT((c + F(d, a, b) + X[10] + 0xffff5bb1), 17); /* 11 */
- b = c + ROT_LEFT((b + F(c, d, a) + X[11] + 0x895cd7be), 22); /* 12 */
+ c = d + ROT_LEFT((c + F(d, a, b) + X[10] + 0xffff5bb1), 17); /* 11 */
+ b = c + ROT_LEFT((b + F(c, d, a) + X[11] + 0x895cd7be), 22); /* 12 */
a = b + ROT_LEFT((a + F(b, c, d) + X[12] + 0x6b901122), 7); /* 13 */
- d = a + ROT_LEFT((d + F(a, b, c) + X[13] + 0xfd987193), 12); /* 14 */
- c = d + ROT_LEFT((c + F(d, a, b) + X[14] + 0xa679438e), 17); /* 15 */
- b = c + ROT_LEFT((b + F(c, d, a) + X[15] + 0x49b40821), 22); /* 16 */
+ d = a + ROT_LEFT((d + F(a, b, c) + X[13] + 0xfd987193), 12); /* 14 */
+ c = d + ROT_LEFT((c + F(d, a, b) + X[14] + 0xa679438e), 17); /* 15 */
+ b = c + ROT_LEFT((b + F(c, d, a) + X[15] + 0x49b40821), 22); /* 16 */
/* round 2 */
a = b + ROT_LEFT((a + G(b, c, d) + X[1] + 0xf61e2562), 5); /* 17 */
d = a + ROT_LEFT((d + G(a, b, c) + X[6] + 0xc040b340), 9); /* 18 */
- c = d + ROT_LEFT((c + G(d, a, b) + X[11] + 0x265e5a51), 14); /* 19 */
+ c = d + ROT_LEFT((c + G(d, a, b) + X[11] + 0x265e5a51), 14); /* 19 */
b = c + ROT_LEFT((b + G(c, d, a) + X[0] + 0xe9b6c7aa), 20); /* 20 */
a = b + ROT_LEFT((a + G(b, c, d) + X[5] + 0xd62f105d), 5); /* 21 */
d = a + ROT_LEFT((d + G(a, b, c) + X[10] + 0x02441453), 9); /* 22 */
- c = d + ROT_LEFT((c + G(d, a, b) + X[15] + 0xd8a1e681), 14); /* 23 */
+ c = d + ROT_LEFT((c + G(d, a, b) + X[15] + 0xd8a1e681), 14); /* 23 */
b = c + ROT_LEFT((b + G(c, d, a) + X[4] + 0xe7d3fbc8), 20); /* 24 */
a = b + ROT_LEFT((a + G(b, c, d) + X[9] + 0x21e1cde6), 5); /* 25 */
d = a + ROT_LEFT((d + G(a, b, c) + X[14] + 0xc33707d6), 9); /* 26 */
a = b + ROT_LEFT((a + G(b, c, d) + X[13] + 0xa9e3e905), 5); /* 29 */
d = a + ROT_LEFT((d + G(a, b, c) + X[2] + 0xfcefa3f8), 9); /* 30 */
c = d + ROT_LEFT((c + G(d, a, b) + X[7] + 0x676f02d9), 14); /* 31 */
- b = c + ROT_LEFT((b + G(c, d, a) + X[12] + 0x8d2a4c8a), 20); /* 32 */
+ b = c + ROT_LEFT((b + G(c, d, a) + X[12] + 0x8d2a4c8a), 20); /* 32 */
/* round 3 */
a = b + ROT_LEFT((a + H(b, c, d) + X[5] + 0xfffa3942), 4); /* 33 */
d = a + ROT_LEFT((d + H(a, b, c) + X[8] + 0x8771f681), 11); /* 34 */
- c = d + ROT_LEFT((c + H(d, a, b) + X[11] + 0x6d9d6122), 16); /* 35 */
- b = c + ROT_LEFT((b + H(c, d, a) + X[14] + 0xfde5380c), 23); /* 36 */
+ c = d + ROT_LEFT((c + H(d, a, b) + X[11] + 0x6d9d6122), 16); /* 35 */
+ b = c + ROT_LEFT((b + H(c, d, a) + X[14] + 0xfde5380c), 23); /* 36 */
a = b + ROT_LEFT((a + H(b, c, d) + X[1] + 0xa4beea44), 4); /* 37 */
d = a + ROT_LEFT((d + H(a, b, c) + X[4] + 0x4bdecfa9), 11); /* 38 */
c = d + ROT_LEFT((c + H(d, a, b) + X[7] + 0xf6bb4b60), 16); /* 39 */
- b = c + ROT_LEFT((b + H(c, d, a) + X[10] + 0xbebfbc70), 23); /* 40 */
+ b = c + ROT_LEFT((b + H(c, d, a) + X[10] + 0xbebfbc70), 23); /* 40 */
a = b + ROT_LEFT((a + H(b, c, d) + X[13] + 0x289b7ec6), 4); /* 41 */
d = a + ROT_LEFT((d + H(a, b, c) + X[0] + 0xeaa127fa), 11); /* 42 */
c = d + ROT_LEFT((c + H(d, a, b) + X[3] + 0xd4ef3085), 16); /* 43 */
b = c + ROT_LEFT((b + H(c, d, a) + X[6] + 0x04881d05), 23); /* 44 */
a = b + ROT_LEFT((a + H(b, c, d) + X[9] + 0xd9d4d039), 4); /* 45 */
- d = a + ROT_LEFT((d + H(a, b, c) + X[12] + 0xe6db99e5), 11); /* 46 */
- c = d + ROT_LEFT((c + H(d, a, b) + X[15] + 0x1fa27cf8), 16); /* 47 */
+ d = a + ROT_LEFT((d + H(a, b, c) + X[12] + 0xe6db99e5), 11); /* 46 */
+ c = d + ROT_LEFT((c + H(d, a, b) + X[15] + 0x1fa27cf8), 16); /* 47 */
b = c + ROT_LEFT((b + H(c, d, a) + X[2] + 0xc4ac5665), 23); /* 48 */
/* round 4 */
a = b + ROT_LEFT((a + I(b, c, d) + X[0] + 0xf4292244), 6); /* 49 */
d = a + ROT_LEFT((d + I(a, b, c) + X[7] + 0x432aff97), 10); /* 50 */
- c = d + ROT_LEFT((c + I(d, a, b) + X[14] + 0xab9423a7), 15); /* 51 */
+ c = d + ROT_LEFT((c + I(d, a, b) + X[14] + 0xab9423a7), 15); /* 51 */
b = c + ROT_LEFT((b + I(c, d, a) + X[5] + 0xfc93a039), 21); /* 52 */
a = b + ROT_LEFT((a + I(b, c, d) + X[12] + 0x655b59c3), 6); /* 53 */
d = a + ROT_LEFT((d + I(a, b, c) + X[3] + 0x8f0ccc92), 10); /* 54 */
- c = d + ROT_LEFT((c + I(d, a, b) + X[10] + 0xffeff47d), 15); /* 55 */
+ c = d + ROT_LEFT((c + I(d, a, b) + X[10] + 0xffeff47d), 15); /* 55 */
b = c + ROT_LEFT((b + I(c, d, a) + X[1] + 0x85845dd1), 21); /* 56 */
a = b + ROT_LEFT((a + I(b, c, d) + X[8] + 0x6fa87e4f), 6); /* 57 */
- d = a + ROT_LEFT((d + I(a, b, c) + X[15] + 0xfe2ce6e0), 10); /* 58 */
+ d = a + ROT_LEFT((d + I(a, b, c) + X[15] + 0xfe2ce6e0), 10); /* 58 */
c = d + ROT_LEFT((c + I(d, a, b) + X[6] + 0xa3014314), 15); /* 59 */
- b = c + ROT_LEFT((b + I(c, d, a) + X[13] + 0x4e0811a1), 21); /* 60 */
+ b = c + ROT_LEFT((b + I(c, d, a) + X[13] + 0x4e0811a1), 21); /* 60 */
a = b + ROT_LEFT((a + I(b, c, d) + X[4] + 0xf7537e82), 6); /* 61 */
- d = a + ROT_LEFT((d + I(a, b, c) + X[11] + 0xbd3af235), 10); /* 62 */
+ d = a + ROT_LEFT((d + I(a, b, c) + X[11] + 0xbd3af235), 10); /* 62 */
c = d + ROT_LEFT((c + I(d, a, b) + X[2] + 0x2ad7d2bb), 15); /* 63 */
b = c + ROT_LEFT((b + I(c, d, a) + X[9] + 0xeb86d391), 21); /* 64 */
* An unset control bit means LITERAL BYTE. So we just copy
* one from INPUT to OUTPUT.
*/
- if (dp >= destend) /* check for buffer overrun */
+ if (dp >= destend) /* check for buffer overrun */
break; /* do not clobber memory */
*dp++ = *sp++;
#include "postgres_fe.h"
/* It's possible we could use a different value for this in frontend code */
-#define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */
+#define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */
#endif
maxlen = strlen("SCRAM-SHA-256") + 1
+ 10 + 1 /* iteration count */
+ pg_b64_enc_len(saltlen) + 1 /* Base64-encoded salt */
- + pg_b64_enc_len(SCRAM_KEY_LEN) + 1 /* Base64-encoded StoredKey */
+ + pg_b64_enc_len(SCRAM_KEY_LEN) + 1 /* Base64-encoded StoredKey */
+ pg_b64_enc_len(SCRAM_KEY_LEN) + 1; /* Base64-encoded ServerKey */
#ifdef FRONTEND
(x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \
((tmp & 0x0000ffff0000ffffULL) << 16); \
}
-#endif /* not bigendian */
+#endif /* not bigendian */
/*
* Macro for incrementally adding the unsigned 64-bit integer n to the
/* Clean up */
a = b = c = d = e = f = g = h = T1 = T2 = 0;
}
-#endif /* SHA2_UNROLL_TRANSFORM */
+#endif /* SHA2_UNROLL_TRANSFORM */
void
pg_sha256_update(pg_sha256_ctx *context, const uint8 *data, size_t len)
/* Clean up */
a = b = c = d = e = f = g = h = T1 = T2 = 0;
}
-#endif /* SHA2_UNROLL_TRANSFORM */
+#endif /* SHA2_UNROLL_TRANSFORM */
void
pg_sha512_update(pg_sha512_ctx *context, const uint8 *data, size_t len)
width = linewidth;
linewidth = 0;
height += 1;
- format_size += 1; /* For NUL char */
+ format_size += 1; /* For NUL char */
}
- else if (*pwcs == '\r') /* Linefeed */
+ else if (*pwcs == '\r') /* Linefeed */
{
linewidth += 2;
format_size += 2;
}
- else if (*pwcs == '\t') /* Tab */
+ else if (*pwcs == '\t') /* Tab */
{
do
{
/* make next line point to remaining memory */
lines->ptr = ptr;
}
- else if (*pwcs == '\r') /* Linefeed */
+ else if (*pwcs == '\r') /* Linefeed */
{
strcpy((char *) ptr, "\\r");
linewidth += 2;
ptr += 2;
}
- else if (*pwcs == '\t') /* Tab */
+ else if (*pwcs == '\t') /* Tab */
{
do
{
const char *const *ptr;
- struct lineptr **col_lineptrs; /* pointers to line pointer per column */
+ struct lineptr **col_lineptrs; /* pointers to line pointer per column */
bool *header_done; /* Have all header lines been output? */
int *bytes_output; /* Bytes output for column value */
printTextLineWrap *wrap; /* Wrap status for each column */
- int output_columns = 0; /* Width of interactive console */
+ int output_columns = 0; /* Width of interactive console */
bool is_local_pager = false;
if (cancel_pressed)
* If left-aligned, pad out remaining space if needed (not
* last column, and/or wrap marks required).
*/
- if (cont->aligns[j] != 'r') /* Left aligned cell */
+ if (cont->aligns[j] != 'r') /* Left aligned cell */
{
if (finalspaces ||
wrap[j] == PRINT_LINE_WRAP_WRAP ||
bool is_local_pager = false,
hmultiline = false,
dmultiline = false;
- int output_columns = 0; /* Width of interactive console */
+ int output_columns = 0; /* Width of interactive console */
if (cancel_pressed)
return;
backslash_run_length--;
}
appendPQExpBufferStr(buf, "^\"");
-#endif /* WIN32 */
+#endif /* WIN32 */
return ok;
}
{
atext++;
if (*atext == '\0')
- return false; /* premature end of string */
+ return false; /* premature end of string */
}
- *strings++ = *atext++; /* copy quoted data */
+ *strings++ = *atext++; /* copy quoted data */
}
atext++;
}
amcanreturn_function amcanreturn; /* can be NULL */
amcostestimate_function amcostestimate;
amoptions_function amoptions;
- amproperty_function amproperty; /* can be NULL */
+ amproperty_function amproperty; /* can be NULL */
amvalidate_function amvalidate;
ambeginscan_function ambeginscan;
amrescan_function amrescan;
- amgettuple_function amgettuple; /* can be NULL */
+ amgettuple_function amgettuple; /* can be NULL */
amgetbitmap_function amgetbitmap; /* can be NULL */
amendscan_function amendscan;
- ammarkpos_function ammarkpos; /* can be NULL */
- amrestrpos_function amrestrpos; /* can be NULL */
+ ammarkpos_function ammarkpos; /* can be NULL */
+ amrestrpos_function amrestrpos; /* can be NULL */
/* interface functions to support parallel index scans */
- amestimateparallelscan_function amestimateparallelscan; /* can be NULL */
- aminitparallelscan_function aminitparallelscan; /* can be NULL */
+ amestimateparallelscan_function amestimateparallelscan; /* can be NULL */
+ aminitparallelscan_function aminitparallelscan; /* can be NULL */
amparallelrescan_function amparallelrescan; /* can be NULL */
} IndexAmRoutine;
extern IndexAmRoutine *GetIndexAmRoutine(Oid amhandler);
extern IndexAmRoutine *GetIndexAmRoutineByAmId(Oid amoid, bool noerror);
-#endif /* AMAPI_H */
+#endif /* AMAPI_H */
Oid lefttype, Oid righttype);
extern bool opfamily_can_sort_type(Oid opfamilyoid, Oid datatypeoid);
-#endif /* AMVALIDATE_H */
+#endif /* AMVALIDATE_H */
#define AttrOffsetGetAttrNumber(attributeOffset) \
((AttrNumber) (1 + (attributeOffset)))
-#endif /* ATTNUM_H */
+#endif /* ATTNUM_H */
extern void brinGetStats(Relation index, BrinStatsData *stats);
-#endif /* BRIN_H */
+#endif /* BRIN_H */
/* brin_validate.c */
extern bool brinvalidate(Oid opclassoid);
-#endif /* BRIN_INTERNAL_H */
+#endif /* BRIN_INTERNAL_H */
#define REVMAP_PAGE_MAXITEMS \
(REVMAP_CONTENT_SIZE / sizeof(ItemPointerData))
-#endif /* BRIN_PAGE_H */
+#endif /* BRIN_PAGE_H */
extern bool brin_page_cleanup(Relation idxrel, Buffer buf);
-#endif /* BRIN_PAGEOPS_H */
+#endif /* BRIN_PAGEOPS_H */
Size *size, int mode, Snapshot snapshot);
extern bool brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk);
-#endif /* BRIN_REVMAP_H */
+#endif /* BRIN_REVMAP_H */
extern BrinMemTuple *brin_deform_tuple(BrinDesc *brdesc,
BrinTuple *tuple, BrinMemTuple *dMemtuple);
-#endif /* BRIN_TUPLE_H */
+#endif /* BRIN_TUPLE_H */
extern const char *brin_identify(uint8 info);
extern void brin_mask(char *pagedata, BlockNumber blkno);
-#endif /* BRIN_XLOG_H */
+#endif /* BRIN_XLOG_H */
extern void clog_desc(StringInfo buf, XLogReaderState *record);
extern const char *clog_identify(uint8 info);
-#endif /* CLOG_H */
+#endif /* CLOG_H */
extern void commit_ts_desc(StringInfo buf, XLogReaderState *record);
extern const char *commit_ts_identify(uint8 info);
-#endif /* COMMIT_TS_H */
+#endif /* COMMIT_TS_H */
bool estimated_count; /* num_heap_tuples is an estimate */
int message_level; /* ereport level for progress messages */
double num_heap_tuples; /* tuples remaining in heap */
- BufferAccessStrategy strategy; /* access strategy for reads */
+ BufferAccessStrategy strategy; /* access strategy for reads */
} IndexVacuumInfo;
/*
BlockNumber num_pages; /* pages remaining in index */
BlockNumber pages_removed; /* # removed during vacuum operation */
bool estimated_count; /* num_index_tuples is an estimate */
- double num_index_tuples; /* tuples remaining */
+ double num_index_tuples; /* tuples remaining */
double tuples_removed; /* # removed during vacuum operation */
BlockNumber pages_deleted; /* # unused pages in index */
BlockNumber pages_free; /* # pages available for reuse */
ScanDirection direction);
extern void systable_endscan_ordered(SysScanDesc sysscan);
-#endif /* GENAM_H */
+#endif /* GENAM_H */
extern void generic_desc(StringInfo buf, XLogReaderState *record);
extern void generic_mask(char *pagedata, BlockNumber blkno);
-#endif /* GENERIC_XLOG_H */
+#endif /* GENERIC_XLOG_H */
#define GIN_SEARCH_MODE_DEFAULT 0
#define GIN_SEARCH_MODE_INCLUDE_EMPTY 1
#define GIN_SEARCH_MODE_ALL 2
-#define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */
+#define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */
/*
* GinStatsData represents stats data for planner use
extern void ginGetStats(Relation index, GinStatsData *stats);
extern void ginUpdateStats(Relation index, const GinStatsData *stats);
-#endif /* GIN_H */
+#endif /* GIN_H */
FmgrInfo extractQueryFn[INDEX_MAX_KEYS];
FmgrInfo consistentFn[INDEX_MAX_KEYS];
FmgrInfo triConsistentFn[INDEX_MAX_KEYS];
- FmgrInfo comparePartialFn[INDEX_MAX_KEYS]; /* optional method */
+ FmgrInfo comparePartialFn[INDEX_MAX_KEYS]; /* optional method */
/* canPartialMatch[i] is true if comparePartialFn[i] is valid */
bool canPartialMatch[INDEX_MAX_KEYS];
/* Collations to pass to the support functions */
extern int ginTraverseLock(Buffer buffer, bool searchMode);
-#endif /* GIN_PRIVATE_H */
+#endif /* GIN_PRIVATE_H */
#define GIN_DELETED (1 << 2)
#define GIN_META (1 << 3)
#define GIN_LIST (1 << 4)
-#define GIN_LIST_FULLROW (1 << 5) /* makes sense only on GIN_LIST page */
+#define GIN_LIST_FULLROW (1 << 5) /* makes sense only on GIN_LIST page */
#define GIN_INCOMPLETE_SPLIT (1 << 6) /* page was split, but parent not
* updated */
#define GIN_COMPRESSED (1 << 7)
*/
typedef signed char GinNullCategory;
-#define GIN_CAT_NORM_KEY 0 /* normal, non-null key value */
-#define GIN_CAT_NULL_KEY 1 /* null key value */
-#define GIN_CAT_EMPTY_ITEM 2 /* placeholder for zero-key item */
-#define GIN_CAT_NULL_ITEM 3 /* placeholder for null item */
+#define GIN_CAT_NORM_KEY 0 /* normal, non-null key value */
+#define GIN_CAT_NULL_KEY 1 /* null key value */
+#define GIN_CAT_EMPTY_ITEM 2 /* placeholder for zero-key item */
+#define GIN_CAT_NULL_ITEM 3 /* placeholder for null item */
#define GIN_CAT_EMPTY_QUERY (-1) /* placeholder for full-scan query */
/*
#define SizeOfGinPostingList(plist) (offsetof(GinPostingList, bytes) + SHORTALIGN((plist)->nbytes) )
#define GinNextPostingListSegment(cur) ((GinPostingList *) (((char *) (cur)) + SizeOfGinPostingList((cur))))
-#endif /* GINBLOCK_H */
+#endif /* GINBLOCK_H */
} ginxlogSegmentAction;
/* Action types */
-#define GIN_SEGMENT_UNMODIFIED 0 /* no action (not used in WAL records) */
-#define GIN_SEGMENT_DELETE 1 /* a whole segment is removed */
-#define GIN_SEGMENT_INSERT 2 /* a whole segment is added */
-#define GIN_SEGMENT_REPLACE 3 /* a segment is replaced */
-#define GIN_SEGMENT_ADDITEMS 4 /* items are added to existing segment */
+#define GIN_SEGMENT_UNMODIFIED 0 /* no action (not used in WAL records) */
+#define GIN_SEGMENT_DELETE 1 /* a whole segment is removed */
+#define GIN_SEGMENT_INSERT 2 /* a whole segment is added */
+#define GIN_SEGMENT_REPLACE 3 /* a segment is replaced */
+#define GIN_SEGMENT_ADDITEMS 4 /* items are added to existing segment */
typedef struct
{
extern void gin_xlog_cleanup(void);
extern void gin_mask(char *pagedata, BlockNumber blkno);
-#endif /* GINXLOG_H */
+#endif /* GINXLOG_H */
OffsetNumber *spl_left; /* array of entries that go left */
int spl_nleft; /* size of this array */
Datum spl_ldatum; /* Union of keys in spl_left */
- bool spl_ldatum_exists; /* true, if spl_ldatum already exists. */
+ bool spl_ldatum_exists; /* true, if spl_ldatum already exists. */
OffsetNumber *spl_right; /* array of entries that go right */
int spl_nright; /* size of the array */
Datum spl_rdatum; /* Union of keys in spl_right */
- bool spl_rdatum_exists; /* true, if spl_rdatum already exists. */
+ bool spl_rdatum_exists; /* true, if spl_rdatum already exists. */
} GIST_SPLITVEC;
/*
do { (e).key = (k); (e).rel = (r); (e).page = (pg); \
(e).offset = (o); (e).leafkey = (l); } while (0)
-#endif /* GIST_H */
+#endif /* GIST_H */
{
ItemPointerData heapPtr;
bool recheck; /* T if quals must be rechecked */
- bool recheckDistances; /* T if distances must be rechecked */
+ bool recheckDistances; /* T if distances must be rechecked */
HeapTuple recontup; /* data reconstructed from the index, used in
* index-only scans */
OffsetNumber offnum; /* track offset in page to mark tuple as
/* we must store parentlsn to detect whether a split occurred */
GISTSearchHeapItem heap; /* heap info, if heap tuple */
} data;
- double distances[FLEXIBLE_ARRAY_MEMBER]; /* numberOfOrderBys
- * entries */
+ double distances[FLEXIBLE_ARRAY_MEMBER]; /* numberOfOrderBys
+ * entries */
} GISTSearchItem;
#define GISTSearchItemIsHeap(item) ((item).blkno == InvalidBlockNumber)
{
GIST_SPLITVEC splitVector; /* passed to/from user PickSplit method */
- Datum spl_lattr[INDEX_MAX_KEYS]; /* Union of subkeys in
- * splitVector.spl_left */
+ Datum spl_lattr[INDEX_MAX_KEYS]; /* Union of subkeys in
+ * splitVector.spl_left */
bool spl_lisnull[INDEX_MAX_KEYS];
- Datum spl_rattr[INDEX_MAX_KEYS]; /* Union of subkeys in
- * splitVector.spl_right */
+ Datum spl_rattr[INDEX_MAX_KEYS]; /* Union of subkeys in
+ * splitVector.spl_right */
bool spl_risnull[INDEX_MAX_KEYS];
bool *spl_dontcare; /* flags tuples which could go to either side
int32 blocksCount; /* current # of blocks occupied by buffer */
BlockNumber pageBlocknum; /* temporary file block # */
- GISTNodeBufferPage *pageBuffer; /* in-memory buffer page */
+ GISTNodeBufferPage *pageBuffer; /* in-memory buffer page */
/* is this buffer queued for emptying? */
bool queuedForEmptying;
* loaded in main memory.
*/
GISTNodeBuffer **loadedBuffers;
- int loadedBuffersCount; /* # of entries in loadedBuffers */
- int loadedBuffersLen; /* allocated size of loadedBuffers */
+ int loadedBuffersCount; /* # of entries in loadedBuffers */
+ int loadedBuffersLen; /* allocated size of loadedBuffers */
/* Level of the current root node (= height of the index tree - 1) */
int rootlevel;
List *splitinfo);
extern void gistUnloadNodeBuffers(GISTBuildBuffers *gfbb);
-#endif /* GIST_PRIVATE_H */
+#endif /* GIST_PRIVATE_H */
ScanKey orderbys, int norderbys);
extern void gistendscan(IndexScanDesc scan);
-#endif /* GISTSCAN_H */
+#endif /* GISTSCAN_H */
*/
bool hashso_buc_split;
/* info about killed items if any (killedItems is NULL if never used) */
- HashScanPosItem *killedItems; /* tids and offset numbers of killed
- * items */
+ HashScanPosItem *killedItems; /* tids and offset numbers of killed items */
int numKilled; /* number of currently stored items */
} HashScanOpaqueData;
uint32 hashm_firstfree; /* lowest-number free ovflpage (bit#) */
uint32 hashm_nmaps; /* number of bitmap pages */
RegProcedure hashm_procid; /* hash procedure id from pg_proc */
- uint32 hashm_spares[HASH_MAX_SPLITPOINTS]; /* spare pages before
- * each splitpoint */
+ uint32 hashm_spares[HASH_MAX_SPLITPOINTS]; /* spare pages before each
+ * splitpoint */
BlockNumber hashm_mapp[HASH_MAX_BITMAPS]; /* blknos of ovfl bitmaps */
} HashMetaPageData;
/*
* Constants
*/
-#define BYTE_TO_BIT 3 /* 2^3 bits/byte */
+#define BYTE_TO_BIT 3 /* 2^3 bits/byte */
#define ALL_SET ((uint32) ~0)
/*
bool bucket_has_garbage,
IndexBulkDeleteCallback callback, void *callback_state);
-#endif /* HASH_H */
+#endif /* HASH_H */
/*
* XLOG records for hash operations
*/
-#define XLOG_HASH_INIT_META_PAGE 0x00 /* initialize the meta page */
-#define XLOG_HASH_INIT_BITMAP_PAGE 0x10 /* initialize the bitmap page */
+#define XLOG_HASH_INIT_META_PAGE 0x00 /* initialize the meta page */
+#define XLOG_HASH_INIT_BITMAP_PAGE 0x10 /* initialize the bitmap page */
#define XLOG_HASH_INSERT 0x20 /* add index tuple without split */
#define XLOG_HASH_ADD_OVFL_PAGE 0x30 /* add overflow page */
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE 0x40 /* allocate new page for split */
#define XLOG_HASH_SPLIT_PAGE 0x50 /* split page */
-#define XLOG_HASH_SPLIT_COMPLETE 0x60 /* completion of split
- * operation */
+#define XLOG_HASH_SPLIT_COMPLETE 0x60 /* completion of split operation */
#define XLOG_HASH_MOVE_PAGE_CONTENTS 0x70 /* remove tuples from one page
* and add to another page */
#define XLOG_HASH_SQUEEZE_PAGE 0x80 /* add tuples to one of the previous
#define XLOG_HASH_SPLIT_CLEANUP 0xA0 /* clear split-cleanup flag in primary
* bucket page after deleting tuples
* that are moved due to split */
-#define XLOG_HASH_UPDATE_META_PAGE 0xB0 /* update meta page after
- * vacuum */
+#define XLOG_HASH_UPDATE_META_PAGE 0xB0 /* update meta page after vacuum */
-#define XLOG_HASH_VACUUM_ONE_PAGE 0xC0 /* remove dead tuples from
- * index page */
+#define XLOG_HASH_VACUUM_ONE_PAGE 0xC0 /* remove dead tuples from index
+ * page */
/*
* xl_hash_split_allocate_page flag values, 8 bits are available.
typedef struct xl_hash_move_page_contents
{
uint16 ntups;
- bool is_prim_bucket_same_wrt; /* TRUE if the page to which
- * tuples are moved is same as
- * primary bucket page */
+ bool is_prim_bucket_same_wrt; /* TRUE if the page to which
+ * tuples are moved is same as
+ * primary bucket page */
} xl_hash_move_page_contents;
#define SizeOfHashMovePageContents \
BlockNumber prevblkno;
BlockNumber nextblkno;
uint16 ntups;
- bool is_prim_bucket_same_wrt; /* TRUE if the page to which
- * tuples are moved is same as
- * primary bucket page */
- bool is_prev_bucket_same_wrt; /* TRUE if the page to which
- * tuples are moved is the
- * page previous to the freed
- * overflow page */
+ bool is_prim_bucket_same_wrt; /* TRUE if the page to which
+ * tuples are moved is same as
+ * primary bucket page */
+ bool is_prev_bucket_same_wrt; /* TRUE if the page to which
+ * tuples are moved is the page
+ * previous to the freed overflow
+ * page */
} xl_hash_squeeze_page;
#define SizeOfHashSqueezePage \
*/
typedef struct xl_hash_delete
{
- bool clear_dead_marking; /* TRUE if this operation clears
- * LH_PAGE_HAS_DEAD_TUPLES flag */
+ bool clear_dead_marking; /* TRUE if this operation clears
+ * LH_PAGE_HAS_DEAD_TUPLES flag */
bool is_primary_bucket_page; /* TRUE if the operation is for
* primary bucket page */
} xl_hash_delete;
extern const char *hash_identify(uint8 info);
extern void hash_mask(char *pagedata, BlockNumber blkno);
-#endif /* HASH_XLOG_H */
+#endif /* HASH_XLOG_H */
extern void SyncScanShmemInit(void);
extern Size SyncScanShmemSize(void);
-#endif /* HEAPAM_H */
+#endif /* HEAPAM_H */
{
TransactionId old_xmax; /* xmax of the old tuple */
OffsetNumber old_offnum; /* old tuple's offset */
- uint8 old_infobits_set; /* infomask bits to set on old tuple */
+ uint8 old_infobits_set; /* infomask bits to set on old tuple */
uint8 flags;
TransactionId new_xmax; /* xmax of the new tuple */
OffsetNumber new_offnum; /* new tuple's offset */
extern XLogRecPtr log_heap_visible(RelFileNode rnode, Buffer heap_buffer,
Buffer vm_buffer, TransactionId cutoff_xid, uint8 flags);
-#endif /* HEAPAM_XLOG_H */
+#endif /* HEAPAM_XLOG_H */
*/
typedef struct BulkInsertStateData
{
- BufferAccessStrategy strategy; /* our BULKWRITE strategy object */
+ BufferAccessStrategy strategy; /* our BULKWRITE strategy object */
Buffer current_buf; /* current insertion target page */
} BulkInsertStateData;
BulkInsertState bistate,
Buffer *vmbuffer, Buffer *vmbuffer_other);
-#endif /* HIO_H */
+#endif /* HIO_H */
/* Prototype for HeapTupleHeader accessors in heapam.c */
extern TransactionId HeapTupleGetUpdateXid(HeapTupleHeader tuple);
-#endif /* HTUP_H */
+#endif /* HTUP_H */
extern Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
bool *isnull);
-#endif /* defined(DISABLE_COMPLEX_MACRO) */
+#endif /* defined(DISABLE_COMPLEX_MACRO) */
/* ----------------
extern HeapTuple heap_tuple_from_minimal_tuple(MinimalTuple mtup);
extern MinimalTuple minimal_tuple_from_heap_tuple(HeapTuple htup);
-#endif /* HTUP_DETAILS_H */
+#endif /* HTUP_DETAILS_H */
Datum *values, bool *isnull);
extern IndexTuple CopyIndexTuple(IndexTuple source);
-#endif /* ITUP_H */
+#endif /* ITUP_H */
extern char *mxid_to_string(MultiXactId multi, int nmembers,
MultiXactMember *members);
-#endif /* MULTIXACT_H */
+#endif /* MULTIXACT_H */
* to use bits 16-31 (see skey.h). The uppermost bits are copied from the
* index's indoption[] array entry for the index attribute.
*/
-#define SK_BT_REQFWD 0x00010000 /* required to continue forward scan */
-#define SK_BT_REQBKWD 0x00020000 /* required to continue backward scan */
-#define SK_BT_INDOPTION_SHIFT 24 /* must clear the above bits */
+#define SK_BT_REQFWD 0x00010000 /* required to continue forward scan */
+#define SK_BT_REQBKWD 0x00020000 /* required to continue backward scan */
+#define SK_BT_INDOPTION_SHIFT 24 /* must clear the above bits */
#define SK_BT_DESC (INDOPTION_DESC << SK_BT_INDOPTION_SHIFT)
#define SK_BT_NULLS_FIRST (INDOPTION_NULLS_FIRST << SK_BT_INDOPTION_SHIFT)
Datum *values, bool *isnull);
extern void _bt_leafbuild(BTSpool *btspool, BTSpool *spool2);
-#endif /* NBTREE_H */
+#endif /* NBTREE_H */
#define XLOG_BTREE_SPLIT_R_ROOT 0x60 /* as above, new item on right */
#define XLOG_BTREE_DELETE 0x70 /* delete leaf index tuples for a page */
#define XLOG_BTREE_UNLINK_PAGE 0x80 /* delete a half-dead page */
-#define XLOG_BTREE_UNLINK_PAGE_META 0x90 /* same, and update metapage */
+#define XLOG_BTREE_UNLINK_PAGE_META 0x90 /* same, and update metapage */
#define XLOG_BTREE_NEWROOT 0xA0 /* new root page */
-#define XLOG_BTREE_MARK_PAGE_HALFDEAD 0xB0 /* mark a leaf as half-dead */
+#define XLOG_BTREE_MARK_PAGE_HALFDEAD 0xB0 /* mark a leaf as half-dead */
#define XLOG_BTREE_VACUUM 0xC0 /* delete entries on a page during
* vacuum */
#define XLOG_BTREE_REUSE_PAGE 0xD0 /* old page is about to be reused from
extern const char *btree_identify(uint8 info);
extern void btree_mask(char *pagedata, BlockNumber blkno);
-#endif /* NBXLOG_H */
+#endif /* NBXLOG_H */
extern void ParallelWorkerMain(Datum main_arg);
-#endif /* PARALLEL_H */
+#endif /* PARALLEL_H */
extern void printsimple_startup(DestReceiver *self, int operation,
TupleDesc tupdesc);
-#endif /* PRINTSIMPLE_H */
+#endif /* PRINTSIMPLE_H */
TupleDesc typeinfo);
extern bool spi_printtup(TupleTableSlot *slot, DestReceiver *self);
-#endif /* PRINTTUP_H */
+#endif /* PRINTTUP_H */
extern bytea *tablespace_reloptions(Datum reloptions, bool validate);
extern LOCKMODE AlterTableGetRelOptionsLockLevel(List *defList);
-#endif /* RELOPTIONS_H */
+#endif /* RELOPTIONS_H */
Relation indexRelation; /* index relation descriptor */
Snapshot xs_snapshot; /* snapshot to see */
int numberOfKeys; /* number of index qualifier conditions */
- int numberOfOrderBys; /* number of ordering operators */
+ int numberOfOrderBys; /* number of ordering operators */
ScanKey keyData; /* array of index qualifier descriptors */
ScanKey orderByData; /* array of ordering op descriptors */
bool xs_want_itup; /* caller requests index tuples */
bool xs_temp_snap; /* unregister snapshot at scan end? */
/* signaling to index AM about killing index tuples */
- bool kill_prior_tuple; /* last-returned tuple is dead */
+ bool kill_prior_tuple; /* last-returned tuple is dead */
bool ignore_killed_tuples; /* do not return killed entries */
bool xactStartedInRecovery; /* prevents killing/seeing killed
* tuples */
Snapshot snapshot; /* snapshot to unregister at end of scan */
} SysScanDescData;
-#endif /* RELSCAN_H */
+#endif /* RELSCAN_H */
#define LOGICAL_REWRITE_FORMAT "map-%x-%x-%X_%X-%x-%x"
void CheckPointLogicalRewriteHeap(void);
-#endif /* REWRITE_HEAP_H */
+#endif /* REWRITE_HEAP_H */
#define RM_MAX_ID (RM_NEXT_ID - 1)
-#endif /* RMGR_H */
+#endif /* RMGR_H */
#define ScanDirectionIsForward(direction) \
((bool) ((direction) == ForwardScanDirection))
-#endif /* SDIR_H */
+#endif /* SDIR_H */
* bits should be defined here). Bits 16-31 are reserved for use within
* individual index access methods.
*/
-#define SK_ISNULL 0x0001 /* sk_argument is NULL */
-#define SK_UNARY 0x0002 /* unary operator (not supported!) */
-#define SK_ROW_HEADER 0x0004 /* row comparison header (see above) */
-#define SK_ROW_MEMBER 0x0008 /* row comparison member (see above) */
-#define SK_ROW_END 0x0010 /* last row comparison member */
-#define SK_SEARCHARRAY 0x0020 /* scankey represents ScalarArrayOp */
-#define SK_SEARCHNULL 0x0040 /* scankey represents "col IS NULL" */
-#define SK_SEARCHNOTNULL 0x0080 /* scankey represents "col IS NOT
- * NULL" */
-#define SK_ORDER_BY 0x0100 /* scankey is for ORDER BY op */
+#define SK_ISNULL 0x0001 /* sk_argument is NULL */
+#define SK_UNARY 0x0002 /* unary operator (not supported!) */
+#define SK_ROW_HEADER 0x0004 /* row comparison header (see above) */
+#define SK_ROW_MEMBER 0x0008 /* row comparison member (see above) */
+#define SK_ROW_END 0x0010 /* last row comparison member */
+#define SK_SEARCHARRAY 0x0020 /* scankey represents ScalarArrayOp */
+#define SK_SEARCHNULL 0x0040 /* scankey represents "col IS NULL" */
+#define SK_SEARCHNOTNULL 0x0080 /* scankey represents "col IS NOT NULL" */
+#define SK_ORDER_BY 0x0100 /* scankey is for ORDER BY op */
/*
FmgrInfo *finfo,
Datum argument);
-#endif /* SKEY_H */
+#endif /* SKEY_H */
extern bool SlruScanDirCbDeleteAll(SlruCtl ctl, char *filename, int segpage,
void *data);
-#endif /* SLRU_H */
+#endif /* SLRU_H */
typedef struct spgChooseOut
{
- spgChooseResultType resultType; /* action code, see above */
+ spgChooseResultType resultType; /* action code, see above */
union
{
struct /* results for spgMatchNode */
{
int nodeN; /* descend to this node (index from 0) */
- int levelAdd; /* increment level by this much */
- Datum restDatum; /* new leaf datum */
+ int levelAdd; /* increment level by this much */
+ Datum restDatum; /* new leaf datum */
} matchNode;
struct /* results for spgAddNode */
{
- Datum nodeLabel; /* new node's label */
+ Datum nodeLabel; /* new node's label */
int nodeN; /* where to insert it (index from 0) */
} addNode;
struct /* results for spgSplitTuple */
{
/* Info to form new upper-level inner tuple with one child tuple */
- bool prefixHasPrefix; /* tuple should have a prefix? */
- Datum prefixPrefixDatum; /* if so, its value */
+ bool prefixHasPrefix; /* tuple should have a prefix? */
+ Datum prefixPrefixDatum; /* if so, its value */
int prefixNNodes; /* number of nodes */
- Datum *prefixNodeLabels; /* their labels (or NULL for
- * no labels) */
- int childNodeN; /* which node gets child tuple */
+ Datum *prefixNodeLabels; /* their labels (or NULL for no
+ * labels) */
+ int childNodeN; /* which node gets child tuple */
/* Info to form new lower-level inner tuple with all old nodes */
- bool postfixHasPrefix; /* tuple should have a prefix? */
- Datum postfixPrefixDatum; /* if so, its value */
+ bool postfixHasPrefix; /* tuple should have a prefix? */
+ Datum postfixPrefixDatum; /* if so, its value */
} splitTuple;
} result;
} spgChooseOut;
int nNodes; /* number of nodes for new inner tuple */
Datum *nodeLabels; /* their labels (or NULL for no labels) */
- int *mapTuplesToNodes; /* node index for each leaf tuple */
+ int *mapTuplesToNodes; /* node index for each leaf tuple */
Datum *leafTupleDatums; /* datum to store in each new leaf tuple */
} spgPickSplitOut;
ScanKey scankeys; /* array of operators and comparison values */
int nkeys; /* length of array */
- Datum reconstructedValue; /* value reconstructed at parent */
+ Datum reconstructedValue; /* value reconstructed at parent */
void *traversalValue; /* opclass-specific traverse value */
- MemoryContext traversalMemoryContext; /* put new traverse values
- * here */
+ MemoryContext traversalMemoryContext; /* put new traverse values here */
int level; /* current level (counting from zero) */
bool returnData; /* original data must be returned? */
ScanKey scankeys; /* array of operators and comparison values */
int nkeys; /* length of array */
- Datum reconstructedValue; /* value reconstructed at parent */
+ Datum reconstructedValue; /* value reconstructed at parent */
void *traversalValue; /* opclass-specific traverse value */
int level; /* current level (counting from zero) */
bool returnData; /* original data must be returned? */
/* spgvalidate.c */
extern bool spgvalidate(Oid opclassoid);
-#endif /* SPGIST_H */
+#endif /* SPGIST_H */
/* Flag bits in page special space */
#define SPGIST_META (1<<0)
-#define SPGIST_DELETED (1<<1) /* never set, but keep for backwards
- * compatibility */
+#define SPGIST_DELETED (1<<1) /* never set, but keep for backwards
+ * compatibility */
#define SPGIST_LEAF (1<<2)
#define SPGIST_NULLS (1<<3)
typedef struct SpGistMetaPageData
{
uint32 magicNumber; /* for identity cross-check */
- SpGistLUPCache lastUsedPages; /* shared storage of last-used info */
+ SpGistLUPCache lastUsedPages; /* shared storage of last-used info */
} SpGistMetaPageData;
#define SPGIST_MAGIC_NUMBER (0xBA0BABEE)
spgConfigOut config; /* filled in by opclass config method */
SpGistTypeDesc attType; /* type of input data and leaf values */
- SpGistTypeDesc attPrefixType; /* type of inner-tuple prefix values */
+ SpGistTypeDesc attPrefixType; /* type of inner-tuple prefix values */
SpGistTypeDesc attLabelType; /* type of node label values */
- char *deadTupleStorage; /* workspace for spgFormDeadTuple */
+ char *deadTupleStorage; /* workspace for spgFormDeadTuple */
TransactionId myXid; /* XID to use when creating a redirect tuple */
bool isBuild; /* true if doing index build */
int iPtr; /* index for scanning through same */
ItemPointerData heapPtrs[MaxIndexTuplesPerPage]; /* TIDs from cur page */
bool recheck[MaxIndexTuplesPerPage]; /* their recheck flags */
- HeapTuple reconTups[MaxIndexTuplesPerPage]; /* reconstructed tuples */
+ HeapTuple reconTups[MaxIndexTuplesPerPage]; /* reconstructed tuples */
/*
* Note: using MaxIndexTuplesPerPage above is a bit hokey since
spgConfigOut config; /* filled in by opclass config method */
SpGistTypeDesc attType; /* type of input data and leaf values */
- SpGistTypeDesc attPrefixType; /* type of inner-tuple prefix values */
+ SpGistTypeDesc attPrefixType; /* type of inner-tuple prefix values */
SpGistTypeDesc attLabelType; /* type of node label values */
- SpGistLUPCache lastUsedPages; /* local storage of last-used info */
+ SpGistLUPCache lastUsedPages; /* local storage of last-used info */
} SpGistCache;
extern bool spgdoinsert(Relation index, SpGistState *state,
ItemPointer heapPtr, Datum datum, bool isnull);
-#endif /* SPGIST_PRIVATE_H */
+#endif /* SPGIST_PRIVATE_H */
typedef struct spgxlogVacuumRedirect
{
uint16 nToPlaceholder; /* number of redirects to make placeholders */
- OffsetNumber firstPlaceholder; /* first placeholder tuple to remove */
+ OffsetNumber firstPlaceholder; /* first placeholder tuple to remove */
TransactionId newestRedirectXid; /* newest XID of removed redirects */
/* offsets of redirect tuples to make placeholders follow */
extern void spg_xlog_cleanup(void);
extern void spg_mask(char *pagedata, BlockNumber blkno);
-#endif /* SPGXLOG_H */
+#endif /* SPGXLOG_H */
* The first few of these come from the R-Tree indexing method (hence the
* names); the others have been added over time as they have been needed.
*/
-#define RTLeftStrategyNumber 1 /* for << */
-#define RTOverLeftStrategyNumber 2 /* for &< */
-#define RTOverlapStrategyNumber 3 /* for && */
-#define RTOverRightStrategyNumber 4 /* for &> */
-#define RTRightStrategyNumber 5 /* for >> */
-#define RTSameStrategyNumber 6 /* for ~= */
-#define RTContainsStrategyNumber 7 /* for @> */
-#define RTContainedByStrategyNumber 8 /* for <@ */
-#define RTOverBelowStrategyNumber 9 /* for &<| */
-#define RTBelowStrategyNumber 10 /* for <<| */
-#define RTAboveStrategyNumber 11 /* for |>> */
-#define RTOverAboveStrategyNumber 12 /* for |&> */
-#define RTOldContainsStrategyNumber 13 /* for old spelling of @> */
-#define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */
-#define RTKNNSearchStrategyNumber 15 /* for <-> (distance) */
-#define RTContainsElemStrategyNumber 16 /* for range types @> elem */
-#define RTAdjacentStrategyNumber 17 /* for -|- */
-#define RTEqualStrategyNumber 18 /* for = */
-#define RTNotEqualStrategyNumber 19 /* for != */
-#define RTLessStrategyNumber 20 /* for < */
-#define RTLessEqualStrategyNumber 21 /* for <= */
-#define RTGreaterStrategyNumber 22 /* for > */
-#define RTGreaterEqualStrategyNumber 23 /* for >= */
-#define RTSubStrategyNumber 24 /* for inet >> */
-#define RTSubEqualStrategyNumber 25 /* for inet <<= */
-#define RTSuperStrategyNumber 26 /* for inet << */
-#define RTSuperEqualStrategyNumber 27 /* for inet >>= */
+#define RTLeftStrategyNumber 1 /* for << */
+#define RTOverLeftStrategyNumber 2 /* for &< */
+#define RTOverlapStrategyNumber 3 /* for && */
+#define RTOverRightStrategyNumber 4 /* for &> */
+#define RTRightStrategyNumber 5 /* for >> */
+#define RTSameStrategyNumber 6 /* for ~= */
+#define RTContainsStrategyNumber 7 /* for @> */
+#define RTContainedByStrategyNumber 8 /* for <@ */
+#define RTOverBelowStrategyNumber 9 /* for &<| */
+#define RTBelowStrategyNumber 10 /* for <<| */
+#define RTAboveStrategyNumber 11 /* for |>> */
+#define RTOverAboveStrategyNumber 12 /* for |&> */
+#define RTOldContainsStrategyNumber 13 /* for old spelling of @> */
+#define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */
+#define RTKNNSearchStrategyNumber 15 /* for <-> (distance) */
+#define RTContainsElemStrategyNumber 16 /* for range types @> elem */
+#define RTAdjacentStrategyNumber 17 /* for -|- */
+#define RTEqualStrategyNumber 18 /* for = */
+#define RTNotEqualStrategyNumber 19 /* for != */
+#define RTLessStrategyNumber 20 /* for < */
+#define RTLessEqualStrategyNumber 21 /* for <= */
+#define RTGreaterStrategyNumber 22 /* for > */
+#define RTGreaterEqualStrategyNumber 23 /* for >= */
+#define RTSubStrategyNumber 24 /* for inet >> */
+#define RTSubEqualStrategyNumber 25 /* for inet <<= */
+#define RTSuperStrategyNumber 26 /* for inet << */
+#define RTSuperEqualStrategyNumber 27 /* for inet >>= */
#define RTMaxStrategyNumber 27
-#endif /* STRATNUM_H */
+#endif /* STRATNUM_H */
extern void ExtendSUBTRANS(TransactionId newestXact);
extern void TruncateSUBTRANS(TransactionId oldestXact);
-#endif /* SUBTRANS_H */
+#endif /* SUBTRANS_H */
#define TableOidAttributeNumber (-7)
#define FirstLowInvalidHeapAttributeNumber (-8)
-#endif /* SYSATTR_H */
+#endif /* SYSATTR_H */
extern XLogRecPtr tliSwitchPoint(TimeLineID tli, List *history,
TimeLineID *nextTLI);
-#endif /* TIMELINE_H */
+#endif /* TIMELINE_H */
extern bool ForceTransactionIdLimitUpdate(void);
extern Oid GetNewObjectId(void);
-#endif /* TRAMSAM_H */
+#endif /* TRAMSAM_H */
SampleScanGetSampleSize_function SampleScanGetSampleSize;
/* Functions for executing a SampleScan on a physical table */
- InitSampleScan_function InitSampleScan; /* can be NULL */
+ InitSampleScan_function InitSampleScan; /* can be NULL */
BeginSampleScan_function BeginSampleScan;
NextSampleBlock_function NextSampleBlock; /* can be NULL */
NextSampleTuple_function NextSampleTuple;
- EndSampleScan_function EndSampleScan; /* can be NULL */
+ EndSampleScan_function EndSampleScan; /* can be NULL */
} TsmRoutine;
/* Functions in access/tablesample/tablesample.c */
extern TsmRoutine *GetTsmRoutine(Oid tsmhandler);
-#endif /* TSMAPI_H */
+#endif /* TSMAPI_H */
extern void free_conversion_map(TupleConversionMap *map);
-#endif /* TUPCONVERT_H */
+#endif /* TUPCONVERT_H */
extern TupleDesc BuildDescFromLists(List *names, List *types, List *typmods, List *collations);
-#endif /* TUPDESC_H */
+#endif /* TUPDESC_H */
: \
PointerGetDatum((char *) (T)) \
)
-#endif /* SIZEOF_DATUM == 8 */
+#endif /* SIZEOF_DATUM == 8 */
/*
* att_align_datum aligns the given offset as needed for a datum of alignment
break; \
} \
} while (0)
-#endif /* SIZEOF_DATUM == 8 */
+#endif /* SIZEOF_DATUM == 8 */
#endif
*
* NB: Changing TOAST_MAX_CHUNK_SIZE requires an initdb.
*/
-#define EXTERN_TUPLES_PER_PAGE 4 /* tweak only this */
+#define EXTERN_TUPLES_PER_PAGE 4 /* tweak only this */
#define EXTERN_TUPLE_MAX_SIZE MaximumBytesPerTuple(EXTERN_TUPLES_PER_PAGE)
*/
extern Oid toast_get_valid_index(Oid toastoid, LOCKMODE lock);
-#endif /* TUPTOASTER_H */
+#endif /* TUPTOASTER_H */
XLogRecPtr end_lsn);
extern void PrepareRedoRemove(TransactionId xid, bool giveWarning);
extern void restoreTwoPhaseData(void);
-#endif /* TWOPHASE_H */
+#endif /* TWOPHASE_H */
extern void RegisterTwoPhaseRecord(TwoPhaseRmgrId rmid, uint16 info,
const void *data, uint32 len);
-#endif /* TWOPHASE_RMGR_H */
+#endif /* TWOPHASE_RMGR_H */
} \
} while (0)
-#endif /* VALID_H */
+#endif /* VALID_H */
/* Flags for bit map */
#define VISIBILITYMAP_ALL_VISIBLE 0x01
#define VISIBILITYMAP_ALL_FROZEN 0x02
-#define VISIBILITYMAP_VALID_BITS 0x03 /* OR of all valid
- * visibilitymap flags bits */
+#define VISIBILITYMAP_VALID_BITS 0x03 /* OR of all valid visibilitymap
+ * flags bits */
/* Macros for visibilitymap test */
#define VM_ALL_VISIBLE(r, b, v) \
extern void visibilitymap_count(Relation rel, BlockNumber *all_visible, BlockNumber *all_frozen);
extern void visibilitymap_truncate(Relation rel, BlockNumber nheapblocks);
-#endif /* VISIBILITYMAP_H */
+#endif /* VISIBILITYMAP_H */
typedef enum
{
SYNCHRONOUS_COMMIT_OFF, /* asynchronous commit */
- SYNCHRONOUS_COMMIT_LOCAL_FLUSH, /* wait for local flush only */
+ SYNCHRONOUS_COMMIT_LOCAL_FLUSH, /* wait for local flush only */
SYNCHRONOUS_COMMIT_REMOTE_WRITE, /* wait for local flush and remote
* write */
SYNCHRONOUS_COMMIT_REMOTE_FLUSH, /* wait for local and remote flush */
- SYNCHRONOUS_COMMIT_REMOTE_APPLY /* wait for local flush and remote
- * apply */
+ SYNCHRONOUS_COMMIT_REMOTE_APPLY /* wait for local flush and remote apply */
} SyncCommitLevel;
/* Define the default setting for synchronous_commit */
extern void ExitParallelMode(void);
extern bool IsInParallelMode(void);
-#endif /* XACT_H */
+#endif /* XACT_H */
/* Sync methods */
#define SYNC_METHOD_FSYNC 0
#define SYNC_METHOD_FDATASYNC 1
-#define SYNC_METHOD_OPEN 2 /* for O_SYNC */
+#define SYNC_METHOD_OPEN 2 /* for O_SYNC */
#define SYNC_METHOD_FSYNC_WRITETHROUGH 3
-#define SYNC_METHOD_OPEN_DSYNC 4 /* for O_DSYNC */
+#define SYNC_METHOD_OPEN_DSYNC 4 /* for O_DSYNC */
extern int sync_method;
extern PGDLLIMPORT TimeLineID ThisTimeLineID; /* current TLI */
/* These directly affect the behavior of CreateCheckPoint and subsidiaries */
#define CHECKPOINT_IS_SHUTDOWN 0x0001 /* Checkpoint is for shutdown */
-#define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint,
- * but issued at end of WAL
- * recovery */
+#define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint, but
+ * issued at end of WAL recovery */
#define CHECKPOINT_IMMEDIATE 0x0004 /* Do it without delays */
#define CHECKPOINT_FORCE 0x0008 /* Force even if no activity */
#define CHECKPOINT_FLUSH_ALL 0x0010 /* Flush all pages, including those
TimestampTz ckpt_sync_end_t; /* end of fsyncs */
TimestampTz ckpt_end_t; /* end of checkpoint */
- int ckpt_bufs_written; /* # of buffers written */
+ int ckpt_bufs_written; /* # of buffers written */
int ckpt_segs_added; /* # of new xlog segments created */
- int ckpt_segs_removed; /* # of xlog segments deleted */
- int ckpt_segs_recycled; /* # of xlog segments recycled */
+ int ckpt_segs_removed; /* # of xlog segments deleted */
+ int ckpt_segs_recycled; /* # of xlog segments recycled */
int ckpt_sync_rels; /* # of relations synced */
- uint64 ckpt_longest_sync; /* Longest sync for one relation */
- uint64 ckpt_agg_sync_time; /* The sum of all the individual sync
- * times, which is not necessarily the
- * same as the total elapsed time for
- * the entire sync phase. */
+ uint64 ckpt_longest_sync; /* Longest sync for one relation */
+ uint64 ckpt_agg_sync_time; /* The sum of all the individual sync
+ * times, which is not necessarily the
+ * same as the total elapsed time for the
+ * entire sync phase. */
} CheckpointStatsData;
extern CheckpointStatsData CheckpointStats;
#define TABLESPACE_MAP "tablespace_map"
#define TABLESPACE_MAP_OLD "tablespace_map.old"
-#endif /* XLOG_H */
+#endif /* XLOG_H */
extern bool XLogArchiveIsReadyOrDone(const char *xlog);
extern void XLogArchiveCleanup(const char *xlog);
-#endif /* XLOG_INTERNAL_H */
+#endif /* XLOG_INTERNAL_H */
#define DEFAULT_SYNC_METHOD SYNC_METHOD_FSYNC
#endif
-#endif /* XLOG_DEFS_H */
+#endif /* XLOG_DEFS_H */
/* flags for XLogRegisterBuffer */
#define REGBUF_FORCE_IMAGE 0x01 /* force a full-page image */
#define REGBUF_NO_IMAGE 0x02 /* don't take a full-page image */
-#define REGBUF_WILL_INIT (0x04 | 0x02) /* page will be re-initialized
- * at replay (implies
- * NO_IMAGE) */
+#define REGBUF_WILL_INIT (0x04 | 0x02) /* page will be re-initialized at
+ * replay (implies NO_IMAGE) */
#define REGBUF_STANDARD 0x08 /* page follows "standard" page layout,
* (data between pd_lower and pd_upper
* will be skipped) */
extern void InitXLogInsert(void);
-#endif /* XLOGINSERT_H */
+#endif /* XLOGINSERT_H */
#ifdef FRONTEND
extern XLogRecPtr XLogFindNextRecord(XLogReaderState *state, XLogRecPtr RecPtr);
-#endif /* FRONTEND */
+#endif /* FRONTEND */
/* Functions for decoding an XLogRecord */
RelFileNode *rnode, ForkNumber *forknum,
BlockNumber *blknum);
-#endif /* XLOGREADER_H */
+#endif /* XLOGREADER_H */
/* Information stored in bimg_info */
#define BKPIMAGE_HAS_HOLE 0x01 /* page image has "hole" */
-#define BKPIMAGE_IS_COMPRESSED 0x02 /* page image is compressed */
+#define BKPIMAGE_IS_COMPRESSED 0x02 /* page image is compressed */
#define BKPIMAGE_APPLY 0x04 /* page image should be restored during
* replay */
#define XLR_BLOCK_ID_DATA_LONG 254
#define XLR_BLOCK_ID_ORIGIN 253
-#endif /* XLOGRECORD_H */
+#endif /* XLOGRECORD_H */
extern int boot_yylex(void);
extern void boot_yyerror(const char *str) pg_attribute_noreturn();
-#endif /* BOOTSTRAP_H */
+#endif /* BOOTSTRAP_H */
#define WIN32
#endif
-#if !defined(WIN32) && !defined(__CYGWIN__) /* win32 includes further down */
+#if !defined(WIN32) && !defined(__CYGWIN__) /* win32 includes further down */
#include "pg_config_os.h" /* must be before any system header files */
#endif
#ifndef false
#define false ((bool) 0)
#endif
-#endif /* not C++ */
+#endif /* not C++ */
typedef bool *BoolPtr;
typedef signed char int8; /* == 8 bits */
typedef signed short int16; /* == 16 bits */
typedef signed int int32; /* == 32 bits */
-#endif /* not HAVE_INT8 */
+#endif /* not HAVE_INT8 */
/*
* uintN
typedef unsigned char uint8; /* == 8 bits */
typedef unsigned short uint16; /* == 16 bits */
typedef unsigned int uint32; /* == 32 bits */
-#endif /* not HAVE_UINT8 */
+#endif /* not HAVE_UINT8 */
/*
* bitsN
*/
#ifndef offsetof
#define offsetof(type, field) ((long) &((type *)0)->field)
-#endif /* offsetof */
+#endif /* offsetof */
/*
* lengthof
Trap(TYPEALIGN(bndr, (uintptr_t)(ptr)) != (uintptr_t)(ptr), \
"UnalignedPointer")
-#endif /* USE_ASSERT_CHECKING && !FRONTEND */
+#endif /* USE_ASSERT_CHECKING && !FRONTEND */
/*
* Macros to support compile-time assertion checks.
((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; }))
#define StaticAssertExpr(condition, errmessage) \
StaticAssertStmt(condition, errmessage)
-#endif /* HAVE__STATIC_ASSERT */
+#endif /* HAVE__STATIC_ASSERT */
/*
#define AssertVariableIsOfTypeMacro(varname, typename) \
((void) StaticAssertExpr(sizeof(varname) == sizeof(typename), \
CppAsString(varname) " does not have type " CppAsString(typename)))
-#endif /* HAVE__BUILTIN_TYPES_COMPATIBLE_P */
+#endif /* HAVE__BUILTIN_TYPES_COMPATIBLE_P */
/* ----------------------------------------------------------------
/* /port compatibility functions */
#include "port.h"
-#endif /* C_H */
+#endif /* C_H */
extern PGDLLIMPORT bool binary_upgrade_record_init_privs;
-#endif /* BINARY_UPGRADE_H */
+#endif /* BINARY_UPGRADE_H */
extern Oid GetNewRelFileNode(Oid reltablespace, Relation pg_class,
char relpersistence);
-#endif /* CATALOG_H */
+#endif /* CATALOG_H */
#define LAST_OCLASS OCLASS_TRANSFORM
/* flag bits for performDeletion/performMultipleDeletions: */
-#define PERFORM_DELETION_INTERNAL 0x0001 /* internal action */
-#define PERFORM_DELETION_CONCURRENTLY 0x0002 /* concurrent drop */
-#define PERFORM_DELETION_QUIETLY 0x0004 /* suppress notices */
-#define PERFORM_DELETION_SKIP_ORIGINAL 0x0008 /* keep original obj */
-#define PERFORM_DELETION_SKIP_EXTENSIONS 0x0010 /* keep extensions */
+#define PERFORM_DELETION_INTERNAL 0x0001 /* internal action */
+#define PERFORM_DELETION_CONCURRENTLY 0x0002 /* concurrent drop */
+#define PERFORM_DELETION_QUIETLY 0x0004 /* suppress notices */
+#define PERFORM_DELETION_SKIP_ORIGINAL 0x0008 /* keep original obj */
+#define PERFORM_DELETION_SKIP_EXTENSIONS 0x0010 /* keep extensions */
/* in dependency.c */
extern void shdepReassignOwned(List *relids, Oid newrole);
-#endif /* DEPENDENCY_H */
+#endif /* DEPENDENCY_H */
#define DESCR(x) extern int no_such_variable
#define SHDESCR(x) extern int no_such_variable
-#endif /* GENBKI_H */
+#endif /* GENBKI_H */
extern void StorePartitionBound(Relation rel, Relation parent,
PartitionBoundSpec *bound);
-#endif /* HEAP_H */
+#endif /* HEAP_H */
extern bool ReindexIsProcessingIndex(Oid indexOid);
extern Oid IndexGetRelation(Oid indexId, bool missing_ok);
-#endif /* INDEX_H */
+#endif /* INDEX_H */
/* last step of initialization script: build the indexes declared above */
BUILD_INDICES
-#endif /* INDEXING_H */
+#endif /* INDEXING_H */
extern List *fetch_search_path(bool includeImplicit);
extern int fetch_search_path_array(Oid *sarray, int sarray_len);
-#endif /* NAMESPACE_H */
+#endif /* NAMESPACE_H */
RunFunctionExecuteHook(objectId); \
} while(0)
-#endif /* OBJECTACCESS_H */
+#endif /* OBJECTACCESS_H */
List **objname, List **objargs);
extern ArrayType *strlist_to_textarray(List *list);
-#endif /* OBJECTADDRESS_H */
+#endif /* OBJECTADDRESS_H */
Oid sortfamily; /* ordering operator's sort opfamily, or 0 */
} OpFamilyMember;
-#endif /* OPFAM_INTERNAL_H */
+#endif /* OPFAM_INTERNAL_H */
{
int nparts; /* Number of partitions */
Oid *oids; /* OIDs of partitions */
- PartitionBoundInfo boundinfo; /* collection of partition bounds */
+ PartitionBoundInfo boundinfo; /* collection of partition bounds */
} PartitionDescData;
typedef struct PartitionDescData *PartitionDesc;
EState *estate,
PartitionDispatchData **failed_at,
TupleTableSlot **failed_slot);
-#endif /* PARTITION_H */
+#endif /* PARTITION_H */
const char *aggminitval,
char proparallel);
-#endif /* PG_AGGREGATE_H */
+#endif /* PG_AGGREGATE_H */
* compiler constant for amtype
* ----------------
*/
-#define AMTYPE_INDEX 'i' /* index access method */
+#define AMTYPE_INDEX 'i' /* index access method */
/* ----------------
* initial contents of pg_am
DESCR("block range index (BRIN) access method");
#define BRIN_AM_OID 3580
-#endif /* PG_AM_H */
+#endif /* PG_AM_H */
/* we could, but choose not to, supply entries for strategies 13 and 14 */
DATA(insert ( 4104 603 600 7 s 433 3580 0 ));
-#endif /* PG_AMOP_H */
+#endif /* PG_AMOP_H */
DATA(insert ( 4104 603 603 11 4067 ));
DATA(insert ( 4104 603 603 13 187 ));
-#endif /* PG_AMPROC_H */
+#endif /* PG_AMPROC_H */
#define Anum_pg_attrdef_adbin 3
#define Anum_pg_attrdef_adsrc 4
-#endif /* PG_ATTRDEF_H */
+#endif /* PG_ATTRDEF_H */
#define ATTRIBUTE_IDENTITY_ALWAYS 'a'
#define ATTRIBUTE_IDENTITY_BY_DEFAULT 'd'
-#endif /* PG_ATTRIBUTE_H */
+#endif /* PG_ATTRIBUTE_H */
#define Anum_pg_auth_members_grantor 3
#define Anum_pg_auth_members_admin_option 4
-#endif /* PG_AUTH_MEMBERS_H */
+#endif /* PG_AUTH_MEMBERS_H */
DATA(insert OID = 4200 ( "pg_signal_backend" f t f f f f f -1 _null_ _null_));
#define DEFAULT_ROLE_SIGNAL_BACKENDID 4200
-#endif /* PG_AUTHID_H */
+#endif /* PG_AUTHID_H */
typedef enum CoercionCodes
{
- COERCION_CODE_IMPLICIT = 'i', /* coercion in context of expression */
- COERCION_CODE_ASSIGNMENT = 'a', /* coercion in context of assignment */
+ COERCION_CODE_IMPLICIT = 'i', /* coercion in context of expression */
+ COERCION_CODE_ASSIGNMENT = 'a', /* coercion in context of assignment */
COERCION_CODE_EXPLICIT = 'e' /* explicit cast operation */
} CoercionCodes;
*/
typedef enum CoercionMethod
{
- COERCION_METHOD_FUNCTION = 'f', /* use a function */
- COERCION_METHOD_BINARY = 'b', /* types are binary-compatible */
+ COERCION_METHOD_FUNCTION = 'f', /* use a function */
+ COERCION_METHOD_BINARY = 'b', /* types are binary-compatible */
COERCION_METHOD_INOUT = 'i' /* use input/output functions */
} CoercionMethod;
DATA(insert ( 114 3802 0 a i ));
DATA(insert ( 3802 114 0 a i ));
-#endif /* PG_CAST_H */
+#endif /* PG_CAST_H */
DESCR("");
-#define RELKIND_RELATION 'r' /* ordinary table */
-#define RELKIND_INDEX 'i' /* secondary index */
-#define RELKIND_SEQUENCE 'S' /* sequence object */
-#define RELKIND_TOASTVALUE 't' /* for out-of-line values */
-#define RELKIND_VIEW 'v' /* view */
-#define RELKIND_MATVIEW 'm' /* materialized view */
-#define RELKIND_COMPOSITE_TYPE 'c' /* composite type */
-#define RELKIND_FOREIGN_TABLE 'f' /* foreign table */
-#define RELKIND_PARTITIONED_TABLE 'p' /* partitioned table */
-
-#define RELPERSISTENCE_PERMANENT 'p' /* regular table */
-#define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */
-#define RELPERSISTENCE_TEMP 't' /* temporary table */
+#define RELKIND_RELATION 'r' /* ordinary table */
+#define RELKIND_INDEX 'i' /* secondary index */
+#define RELKIND_SEQUENCE 'S' /* sequence object */
+#define RELKIND_TOASTVALUE 't' /* for out-of-line values */
+#define RELKIND_VIEW 'v' /* view */
+#define RELKIND_MATVIEW 'm' /* materialized view */
+#define RELKIND_COMPOSITE_TYPE 'c' /* composite type */
+#define RELKIND_FOREIGN_TABLE 'f' /* foreign table */
+#define RELKIND_PARTITIONED_TABLE 'p' /* partitioned table */
+
+#define RELPERSISTENCE_PERMANENT 'p' /* regular table */
+#define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */
+#define RELPERSISTENCE_TEMP 't' /* temporary table */
/* default selection for replica identity (primary key or nothing) */
#define REPLICA_IDENTITY_DEFAULT 'd'
*/
#define REPLICA_IDENTITY_INDEX 'i'
-#endif /* PG_CLASS_H */
+#endif /* PG_CLASS_H */
#define COLLPROVIDER_ICU 'i'
#define COLLPROVIDER_LIBC 'c'
-#endif /* PG_COLLATION_H */
+#endif /* PG_COLLATION_H */
bool if_not_exists);
extern void RemoveCollationById(Oid collationOid);
-#endif /* PG_COLLATION_FN_H */
+#endif /* PG_COLLATION_FN_H */
* the FKCONSTR_MATCH_xxx constants defined in parsenodes.h.
*/
-#endif /* PG_CONSTRAINT_H */
+#endif /* PG_CONSTRAINT_H */
List *grouping_columns,
List **constraintDeps);
-#endif /* PG_CONSTRAINT_FN_H */
+#endif /* PG_CONSTRAINT_FN_H */
* example, WAL logs contain per-page magic numbers that can serve as
* version cues for the WAL log.
*/
- uint32 pg_control_version; /* PG_CONTROL_VERSION */
- uint32 catalog_version_no; /* see catversion.h */
+ uint32 pg_control_version; /* PG_CONTROL_VERSION */
+ uint32 catalog_version_no; /* see catversion.h */
/*
* System status data
*/
#define PG_CONTROL_SIZE 8192
-#endif /* PG_CONTROL_H */
+#endif /* PG_CONTROL_H */
* ---------------
*/
-#endif /* PG_CONVERSION_H */
+#endif /* PG_CONVERSION_H */
extern void RemoveConversionById(Oid conversionOid);
extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding, int32 to_encoding);
-#endif /* PG_CONVERSION_FN_H */
+#endif /* PG_CONVERSION_FN_H */
SHDESCR("default template for new databases");
#define TemplateDbOid 1
-#endif /* PG_DATABASE_H */
+#endif /* PG_DATABASE_H */
extern void ApplySetting(Snapshot snapshot, Oid databaseid, Oid roleid,
Relation relsetting, GucSource source);
-#endif /* PG_DB_ROLE_SETTING_H */
+#endif /* PG_DB_ROLE_SETTING_H */
* permissions through pg_default_acl. These codes are used in the
* defaclobjtype column.
*/
-#define DEFACLOBJ_RELATION 'r' /* table, view */
-#define DEFACLOBJ_SEQUENCE 'S' /* sequence */
-#define DEFACLOBJ_FUNCTION 'f' /* function */
-#define DEFACLOBJ_TYPE 'T' /* type */
-#define DEFACLOBJ_NAMESPACE 'n' /* namespace */
+#define DEFACLOBJ_RELATION 'r' /* table, view */
+#define DEFACLOBJ_SEQUENCE 'S' /* sequence */
+#define DEFACLOBJ_FUNCTION 'f' /* function */
+#define DEFACLOBJ_TYPE 'T' /* type */
+#define DEFACLOBJ_NAMESPACE 'n' /* namespace */
-#endif /* PG_DEFAULT_ACL_H */
+#endif /* PG_DEFAULT_ACL_H */
* convenient to find from the contents of other catalogs.
*/
-#endif /* PG_DEPEND_H */
+#endif /* PG_DEPEND_H */
* by genbki.pl and loaded during initdb.
*/
-#endif /* PG_DESCRIPTION_H */
+#endif /* PG_DESCRIPTION_H */
extern void RenameEnumLabel(Oid enumTypeOid,
const char *oldVal, const char *newVal);
-#endif /* PG_ENUM_H */
+#endif /* PG_ENUM_H */
#define Anum_pg_event_trigger_evtenabled 5
#define Anum_pg_event_trigger_evttags 6
-#endif /* PG_EVENT_TRIGGER_H */
+#endif /* PG_EVENT_TRIGGER_H */
* ----------------
*/
-#endif /* PG_EXTENSION_H */
+#endif /* PG_EXTENSION_H */
#define Anum_pg_foreign_data_wrapper_fdwacl 5
#define Anum_pg_foreign_data_wrapper_fdwoptions 6
-#endif /* PG_FOREIGN_DATA_WRAPPER_H */
+#endif /* PG_FOREIGN_DATA_WRAPPER_H */
#define Anum_pg_foreign_server_srvacl 6
#define Anum_pg_foreign_server_srvoptions 7
-#endif /* PG_FOREIGN_SERVER_H */
+#endif /* PG_FOREIGN_SERVER_H */
#define Anum_pg_foreign_table_ftserver 2
#define Anum_pg_foreign_table_ftoptions 3
-#endif /* PG_FOREIGN_TABLE_H */
+#endif /* PG_FOREIGN_TABLE_H */
#define IndexIsReady(indexForm) ((indexForm)->indisready)
#define IndexIsLive(indexForm) ((indexForm)->indislive)
-#endif /* PG_INDEX_H */
+#endif /* PG_INDEX_H */
* ----------------
*/
-#endif /* PG_INHERITS_H */
+#endif /* PG_INHERITS_H */
extern bool has_subclass(Oid relationId);
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
-#endif /* PG_INHERITS_FN_H */
+#endif /* PG_INHERITS_FN_H */
char privtype; /* from initdb or extension? */
#ifdef CATALOG_VARLEN /* variable-length fields start here */
- aclitem initprivs[1] BKI_FORCE_NOT_NULL; /* initial privs on
- * object */
+ aclitem initprivs[1] BKI_FORCE_NOT_NULL; /* initial privs on object */
#endif
} FormData_pg_init_privs;
* The initial contents are loaded near the end of initdb.
*/
-#endif /* PG_INIT_PRIVS_H */
+#endif /* PG_INIT_PRIVS_H */
DESCR("SQL-language functions");
#define SQLlanguageId 14
-#endif /* PG_LANGUAGE_H */
+#endif /* PG_LANGUAGE_H */
int32 pageno; /* Page number (starting from 0) */
/* data has variable length, but we allow direct access; see inv_api.c */
- bytea data BKI_FORCE_NOT_NULL; /* Data for page (may be
- * zero-length) */
+ bytea data BKI_FORCE_NOT_NULL; /* Data for page (may be
+ * zero-length) */
} FormData_pg_largeobject;
/* ----------------
extern void LargeObjectDrop(Oid loid);
extern bool LargeObjectExists(Oid loid);
-#endif /* PG_LARGEOBJECT_H */
+#endif /* PG_LARGEOBJECT_H */
#define Anum_pg_largeobject_metadata_lomowner 1
#define Anum_pg_largeobject_metadata_lomacl 2
-#endif /* PG_LARGEOBJECT_METADATA_H */
+#endif /* PG_LARGEOBJECT_METADATA_H */
*/
extern Oid NamespaceCreate(const char *nspName, Oid ownerId, bool isTemp);
-#endif /* PG_NAMESPACE_H */
+#endif /* PG_NAMESPACE_H */
DATA(insert ( 3580 box_inclusion_ops PGNSP PGUID 4104 603 t 603 ));
/* no brin opclass for the geometric types except box */
-#endif /* PG_OPCLASS_H */
+#endif /* PG_OPCLASS_H */
DATA(insert OID = 3287 ( "#-" PGNSP PGUID b f f 3802 1009 3802 0 0 jsonb_delete_path - - ));
DESCR("delete path");
-#endif /* PG_OPERATOR_H */
+#endif /* PG_OPERATOR_H */
extern void OperatorUpd(Oid baseId, Oid commId, Oid negId, bool isDelete);
-#endif /* PG_OPERATOR_FN_H */
+#endif /* PG_OPERATOR_FN_H */
DATA(insert OID = 4104 ( 3580 box_inclusion_ops PGNSP PGUID ));
DATA(insert OID = 5000 ( 4000 box_ops PGNSP PGUID ));
-#endif /* PG_OPFAMILY_H */
+#endif /* PG_OPFAMILY_H */
#define Anum_pg_partitioned_table_partcollation 6
#define Anum_pg_partitioned_table_partexprs 7
-#endif /* PG_PARTITIONED_TABLE_H */
+#endif /* PG_PARTITIONED_TABLE_H */
DATA(insert ( "plpython2u" f f "plpython2_call_handler" "plpython2_inline_handler" "plpython2_validator" "$libdir/plpython2" _null_ ));
DATA(insert ( "plpython3u" f f "plpython3_call_handler" "plpython3_inline_handler" "plpython3_validator" "$libdir/plpython3" _null_ ));
-#endif /* PG_PLTEMPLATE_H */
+#endif /* PG_PLTEMPLATE_H */
#define Anum_pg_policy_polqual 6
#define Anum_pg_policy_polwithcheck 7
-#endif /* PG_POLICY_H */
+#endif /* PG_POLICY_H */
oidvector proargtypes; /* parameter types (excludes OUT params) */
#ifdef CATALOG_VARLEN
- Oid proallargtypes[1]; /* all param types (NULL if IN only) */
+ Oid proallargtypes[1]; /* all param types (NULL if IN only) */
char proargmodes[1]; /* parameter modes (NULL if IN only) */
text proargnames[1]; /* parameter names (NULL if no names) */
pg_node_tree proargdefaults; /* list of expression trees for argument
* defaults (NULL if none) */
Oid protrftypes[1]; /* types for which to apply transforms */
- text prosrc BKI_FORCE_NOT_NULL; /* procedure source text */
+ text prosrc BKI_FORCE_NOT_NULL; /* procedure source text */
text probin; /* secondary procedure info (can be NULL) */
text proconfig[1]; /* procedure-local GUC settings */
aclitem proacl[1]; /* access permissions */
* must be labeled volatile to ensure they will not get optimized away,
* even if the actual return value is not changeable.
*/
-#define PROVOLATILE_IMMUTABLE 'i' /* never changes for given input */
-#define PROVOLATILE_STABLE 's' /* does not change within a scan */
-#define PROVOLATILE_VOLATILE 'v' /* can change even within a scan */
+#define PROVOLATILE_IMMUTABLE 'i' /* never changes for given input */
+#define PROVOLATILE_STABLE 's' /* does not change within a scan */
+#define PROVOLATILE_VOLATILE 'v' /* can change even within a scan */
/*
* Symbolic values for proparallel column: these indicate whether a function
* can be safely be run in a parallel backend, during parallelism but
* necessarily in the master, or only in non-parallel mode.
*/
-#define PROPARALLEL_SAFE 's' /* can run in worker or master */
-#define PROPARALLEL_RESTRICTED 'r' /* can run in parallel master only */
-#define PROPARALLEL_UNSAFE 'u' /* banned while in parallel mode */
+#define PROPARALLEL_SAFE 's' /* can run in worker or master */
+#define PROPARALLEL_RESTRICTED 'r' /* can run in parallel master only */
+#define PROPARALLEL_UNSAFE 'u' /* banned while in parallel mode */
/*
* Symbolic values for proargmodes column. Note that these must agree with
#define PROARGMODE_VARIADIC 'v'
#define PROARGMODE_TABLE 't'
-#endif /* PG_PROC_H */
+#endif /* PG_PROC_H */
extern List *oid_array_to_list(Datum datum);
-#endif /* PG_PROC_FN_H */
+#endif /* PG_PROC_FN_H */
extern Datum pg_get_publication_tables(PG_FUNCTION_ARGS);
-#endif /* PG_PUBLICATION_H */
+#endif /* PG_PUBLICATION_H */
#define Anum_pg_publication_rel_prpubid 1
#define Anum_pg_publication_rel_prrelid 2
-#endif /* PG_PUBLICATION_REL_H */
+#endif /* PG_PUBLICATION_REL_H */
RegProcedure rangeSubDiff);
extern void RangeDelete(Oid rangeTypeOid);
-#endif /* PG_RANGE_H */
+#endif /* PG_RANGE_H */
* ----------------
*/
-#endif /* PG_REPLICATION_ORIGIN_H */
+#endif /* PG_REPLICATION_ORIGIN_H */
#define Anum_pg_rewrite_ev_qual 6
#define Anum_pg_rewrite_ev_action 7
-#endif /* PG_REWRITE_H */
+#endif /* PG_REWRITE_H */
#ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider BKI_FORCE_NOT_NULL; /* name of label provider */
- text label BKI_FORCE_NOT_NULL; /* security label of the
- * object */
+ text label BKI_FORCE_NOT_NULL; /* security label of the object */
#endif
} FormData_pg_seclabel;
#define Anum_pg_seclabel_provider 4
#define Anum_pg_seclabel_label 5
-#endif /* PG_SECLABEL_H */
+#endif /* PG_SECLABEL_H */
#define Anum_pg_sequence_seqcache 7
#define Anum_pg_sequence_seqcycle 8
-#endif /* PG_SEQUENCE_H */
+#endif /* PG_SEQUENCE_H */
* are explicitly stored in pg_shdepend.
*/
-#endif /* PG_SHDEPEND_H */
+#endif /* PG_SHDEPEND_H */
* by genbki.pl and loaded during initdb.
*/
-#endif /* PG_SHDESCRIPTION_H */
+#endif /* PG_SHDESCRIPTION_H */
#ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider BKI_FORCE_NOT_NULL; /* name of label provider */
- text label BKI_FORCE_NOT_NULL; /* security label of the
- * object */
+ text label BKI_FORCE_NOT_NULL; /* security label of the object */
#endif
} FormData_pg_shseclabel;
#define Anum_pg_shseclabel_provider 3
#define Anum_pg_shseclabel_label 4
-#endif /* PG_SHSECLABEL_H */
+#endif /* PG_SHSECLABEL_H */
*/
#define STATISTIC_KIND_BOUNDS_HISTOGRAM 7
-#endif /* PG_STATISTIC_H */
+#endif /* PG_STATISTIC_H */
#define STATS_EXT_NDISTINCT 'd'
#define STATS_EXT_DEPENDENCIES 'f'
-#endif /* PG_STATISTIC_EXT_H */
+#endif /* PG_STATISTIC_EXT_H */
extern int CountDBSubscriptions(Oid dbid);
-#endif /* PG_SUBSCRIPTION_H */
+#endif /* PG_SUBSCRIPTION_H */
* substate constants
* ----------------
*/
-#define SUBREL_STATE_INIT 'i' /* initializing (sublsn NULL) */
-#define SUBREL_STATE_DATASYNC 'd' /* data is being synchronized (sublsn
- * NULL) */
-#define SUBREL_STATE_SYNCDONE 's' /* synchronization finished in front
- * of apply (sublsn set) */
-#define SUBREL_STATE_READY 'r' /* ready (sublsn set) */
+#define SUBREL_STATE_INIT 'i' /* initializing (sublsn NULL) */
+#define SUBREL_STATE_DATASYNC 'd' /* data is being synchronized (sublsn
+ * NULL) */
+#define SUBREL_STATE_SYNCDONE 's' /* synchronization finished in front of
+ * apply (sublsn set) */
+#define SUBREL_STATE_READY 'r' /* ready (sublsn set) */
/* These are never stored in the catalog, we only use them for IPC. */
#define SUBREL_STATE_UNKNOWN '\0' /* unknown state */
-#define SUBREL_STATE_SYNCWAIT 'w' /* waiting for sync */
-#define SUBREL_STATE_CATCHUP 'c' /* catching up with apply */
+#define SUBREL_STATE_SYNCWAIT 'w' /* waiting for sync */
+#define SUBREL_STATE_CATCHUP 'c' /* catching up with apply */
typedef struct SubscriptionRelState
{
extern List *GetSubscriptionRelations(Oid subid);
extern List *GetSubscriptionNotReadyRelations(Oid subid);
-#endif /* PG_SUBSCRIPTION_REL_H */
+#endif /* PG_SUBSCRIPTION_REL_H */
#define DEFAULTTABLESPACE_OID 1663
#define GLOBALTABLESPACE_OID 1664
-#endif /* PG_TABLESPACE_H */
+#endif /* PG_TABLESPACE_H */
#define Anum_pg_transform_trffromsql 3
#define Anum_pg_transform_trftosql 4
-#endif /* PG_TRANSFORM_H */
+#endif /* PG_TRANSFORM_H */
int2vector tgattr; /* column numbers, if trigger is on columns */
#ifdef CATALOG_VARLEN
- bytea tgargs BKI_FORCE_NOT_NULL; /* first\000second\000tgnargs\000 */
+ bytea tgargs BKI_FORCE_NOT_NULL; /* first\000second\000tgnargs\000 */
pg_node_tree tgqual; /* WHEN expression, or NULL if none */
NameData tgoldtable; /* old transition table, or NULL if none */
NameData tgnewtable; /* new transition table, or NULL if none */
#define TRIGGER_USES_TRANSITION_TABLE(namepointer) \
((namepointer) != (char *) NULL)
-#endif /* PG_TRIGGER_H */
+#endif /* PG_TRIGGER_H */
DATA(insert OID = 3748 ( "simple" PGNSP PGUID 3722 ));
DESCR("simple configuration");
-#endif /* PG_TS_CONFIG_H */
+#endif /* PG_TS_CONFIG_H */
DATA(insert ( 3748 21 1 3765 ));
DATA(insert ( 3748 22 1 3765 ));
-#endif /* PG_TS_CONFIG_MAP_H */
+#endif /* PG_TS_CONFIG_MAP_H */
DATA(insert OID = 3765 ( "simple" PGNSP PGUID 3727 _null_));
DESCR("simple dictionary: just lower case and check for stopword");
-#endif /* PG_TS_DICT_H */
+#endif /* PG_TS_DICT_H */
DATA(insert OID = 3722 ( "default" PGNSP prsd_start prsd_nexttoken prsd_end prsd_headline prsd_lextype ));
DESCR("default word parser");
-#endif /* PG_TS_PARSER_H */
+#endif /* PG_TS_PARSER_H */
DATA(insert OID = 3742 ( "thesaurus" PGNSP thesaurus_init thesaurus_lexize ));
DESCR("thesaurus dictionary: phrase by phrase substitution");
-#endif /* PG_TS_TEMPLATE_H */
+#endif /* PG_TS_TEMPLATE_H */
#define TYPCATEGORY_DATETIME 'D'
#define TYPCATEGORY_ENUM 'E'
#define TYPCATEGORY_GEOMETRIC 'G'
-#define TYPCATEGORY_NETWORK 'I' /* think INET */
+#define TYPCATEGORY_NETWORK 'I' /* think INET */
#define TYPCATEGORY_NUMERIC 'N'
#define TYPCATEGORY_PSEUDOTYPE 'P'
#define TYPCATEGORY_RANGE 'R'
#define TYPCATEGORY_STRING 'S'
#define TYPCATEGORY_TIMESPAN 'T'
#define TYPCATEGORY_USER 'U'
-#define TYPCATEGORY_BITSTRING 'V' /* er ... "varbit"? */
+#define TYPCATEGORY_BITSTRING 'V' /* er ... "varbit"? */
#define TYPCATEGORY_UNKNOWN 'X'
/* Is a type OID a polymorphic pseudotype? (Beware of multiple evaluation) */
(typid) == ANYENUMOID || \
(typid) == ANYRANGEOID)
-#endif /* PG_TYPE_H */
+#endif /* PG_TYPE_H */
extern bool moveArrayTypeName(Oid typeOid, const char *typeName,
Oid typeNamespace);
-#endif /* PG_TYPE_FN_H */
+#endif /* PG_TYPE_FN_H */
#define Anum_pg_user_mapping_umserver 2
#define Anum_pg_user_mapping_umoptions 3
-#endif /* PG_USER_MAPPING_H */
+#endif /* PG_USER_MAPPING_H */
extern void AtSubAbort_smgr(void);
extern void PostPrepare_smgr(void);
-#endif /* STORAGE_H */
+#endif /* STORAGE_H */
extern void smgr_desc(StringInfo buf, XLogReaderState *record);
extern const char *smgr_identify(uint8 info);
-#endif /* STORAGE_XLOG_H */
+#endif /* STORAGE_XLOG_H */
#define PgShseclabelToastTable 4060
#define PgShseclabelToastIndex 4061
-#endif /* TOASTING_H */
+#endif /* TOASTING_H */
extern void AlterObjectOwner_internal(Relation catalog, Oid objectId,
Oid new_ownerId);
-#endif /* ALTER_H */
+#endif /* ALTER_H */
/* process interrupts */
extern void ProcessNotifyInterrupt(void);
-#endif /* ASYNC_H */
+#endif /* ASYNC_H */
MultiXactId minMulti,
char newrelpersistence);
-#endif /* CLUSTER_H */
+#endif /* CLUSTER_H */
extern void IsThereCollationInNamespace(const char *collname, Oid nspOid);
extern ObjectAddress AlterCollation(AlterCollationStmt *stmt);
-#endif /* COLLATIONCMDS_H */
+#endif /* COLLATIONCMDS_H */
extern char *GetComment(Oid oid, Oid classoid, int32 subid);
-#endif /* COMMENT_H */
+#endif /* COMMENT_H */
extern ObjectAddress CreateConversionCommand(CreateConversionStmt *parsetree);
-#endif /* CONVERSIONCMDS_H */
+#endif /* CONVERSIONCMDS_H */
extern DestReceiver *CreateCopyDestReceiver(void);
-#endif /* COPY_H */
+#endif /* COPY_H */
extern DestReceiver *CreateIntoRelDestReceiver(IntoClause *intoClause);
-#endif /* CREATEAS_H */
+#endif /* CREATEAS_H */
extern void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype);
-#endif /* DBCOMMANDS_H */
+#endif /* DBCOMMANDS_H */
extern void dbase_desc(StringInfo buf, XLogReaderState *rptr);
extern const char *dbase_identify(uint8 info);
-#endif /* DBCOMMANDS_XLOG_H */
+#endif /* DBCOMMANDS_XLOG_H */
extern int defGetTypeLength(DefElem *def);
extern List *defGetStringList(DefElem *def);
-#endif /* DEFREM_H */
+#endif /* DEFREM_H */
extern void DiscardCommand(DiscardStmt *stmt, bool isTopLevel);
-#endif /* DISCARD_H */
+#endif /* DISCARD_H */
Oid cfgId, Oid *dictIds, int ndicts);
extern void EventTriggerCollectAlterDefPrivs(AlterDefaultPrivilegesStmt *stmt);
-#endif /* EVENT_TRIGGER_H */
+#endif /* EVENT_TRIGGER_H */
List *rtable; /* range table */
List *rtable_names; /* alias names for RTEs */
List *deparse_cxt; /* context list for deparsing expressions */
- Bitmapset *printed_subplans; /* ids of SubPlans we've printed */
+ Bitmapset *printed_subplans; /* ids of SubPlans we've printed */
} ExplainState;
/* Hook for plugins to get control in ExplainOneQuery() */
extern void ExplainPropertyBool(const char *qlabel, bool value,
ExplainState *es);
-#endif /* EXPLAIN_H */
+#endif /* EXPLAIN_H */
extern void AlterExtensionOwner_oid(Oid extensionOid, Oid newOwnerId);
-#endif /* EXTENSION_H */
+#endif /* EXTENSION_H */
*/
extern void LockTableCommand(LockStmt *lockstmt);
-#endif /* LOCKCMDS_H */
+#endif /* LOCKCMDS_H */
extern bool MatViewIncrementalMaintenanceIsEnabled(void);
-#endif /* MATVIEW_H */
+#endif /* MATVIEW_H */
extern bool relation_has_policies(Relation rel);
-#endif /* POLICY_H */
+#endif /* POLICY_H */
extern void PersistHoldablePortal(Portal portal);
-#endif /* PORTALCMDS_H */
+#endif /* PORTALCMDS_H */
{
/* dynahash.c requires key to be first field */
char stmt_name[NAMEDATALEN];
- CachedPlanSource *plansource; /* the actual cached plan */
+ CachedPlanSource *plansource; /* the actual cached plan */
bool from_sql; /* prepared via SQL, not FE/BE protocol? */
TimestampTz prepare_time; /* the time when the stmt was prepared */
} PreparedStatement;
extern void DropAllPreparedStatements(void);
-#endif /* PREPARE_H */
+#endif /* PREPARE_H */
extern bool PLTemplateExists(const char *languageName);
extern Oid get_language_oid(const char *langname, bool missing_ok);
-#endif /* PROCLANG_H */
+#endif /* PROCLANG_H */
extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
-#endif /* PUBLICATIONCMDS_H */
+#endif /* PUBLICATIONCMDS_H */
extern ObjectAddress AlterSchemaOwner(const char *name, Oid newOwnerId);
extern void AlterSchemaOwner_oid(Oid schemaOid, Oid newOwnerId);
-#endif /* SCHEMACMDS_H */
+#endif /* SCHEMACMDS_H */
extern void register_label_provider(const char *provider,
check_object_relabel_type hook);
-#endif /* SECLABEL_H */
+#endif /* SECLABEL_H */
extern const char *seq_identify(uint8 info);
extern void seq_mask(char *pagedata, BlockNumber blkno);
-#endif /* SEQUENCE_H */
+#endif /* SEQUENCE_H */
extern ObjectAddress AlterSubscriptionOwner(const char *name, Oid newOwnerId);
extern void AlterSubscriptionOwner_oid(Oid subid, Oid newOwnerId);
-#endif /* SUBSCRIPTIONCMDS_H */
+#endif /* SUBSCRIPTIONCMDS_H */
extern void RangeVarCallbackOwnsRelation(const RangeVar *relation,
Oid relId, Oid oldRelId, void *noCatalogs);
-#endif /* TABLECMDS_H */
+#endif /* TABLECMDS_H */
extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
extern const char *tblspc_identify(uint8 info);
-#endif /* TABLESPACE_H */
+#endif /* TABLESPACE_H */
extern int RI_FKey_trigger_type(Oid tgfoid);
-#endif /* TRIGGER_H */
+#endif /* TRIGGER_H */
bool errorOnTableType,
ObjectAddresses *objsMoved);
-#endif /* TYPECMDS_H */
+#endif /* TYPECMDS_H */
extern void ReassignOwnedObjects(ReassignOwnedStmt *stmt);
extern List *roleSpecsToIds(List *memberNames);
-#endif /* USER_H */
+#endif /* USER_H */
typedef struct VacuumParams
{
int freeze_min_age; /* min freeze age, -1 to use default */
- int freeze_table_age; /* age at which to scan whole table */
- int multixact_freeze_min_age; /* min multixact freeze age,
- * -1 to use default */
- int multixact_freeze_table_age; /* multixact age at which to
- * scan whole table */
+ int freeze_table_age; /* age at which to scan whole table */
+ int multixact_freeze_min_age; /* min multixact freeze age, -1 to
+ * use default */
+ int multixact_freeze_table_age; /* multixact age at which to scan
+ * whole table */
bool is_wraparound; /* force a for-wraparound vacuum */
- int log_min_duration; /* minimum execution threshold in ms
- * at which verbose logs are
- * activated, -1 to use default */
+ int log_min_duration; /* minimum execution threshold in ms at
+ * which verbose logs are activated, -1
+ * to use default */
} VacuumParams;
/* GUC parameters */
-extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for
- * PostGIS */
+extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for PostGIS */
extern int vacuum_freeze_min_age;
extern int vacuum_freeze_table_age;
extern int vacuum_multixact_freeze_min_age;
extern double anl_init_selection_state(int n);
extern double anl_get_next_S(double t, int n, double *stateptr);
-#endif /* VACUUM_H */
+#endif /* VACUUM_H */
extern void assign_role(const char *newval, void *extra);
extern const char *show_role(void);
-#endif /* VARIABLE_H */
+#endif /* VARIABLE_H */
extern void StoreViewQuery(Oid viewOid, Query *viewParse, bool replace);
-#endif /* VIEW_H */
+#endif /* VIEW_H */
extern int pg_b64_enc_len(int srclen);
extern int pg_b64_dec_len(int srclen);
-#endif /* BASE64_H */
+#endif /* BASE64_H */
extern ConfigData *get_configdata(const char *my_exec_path,
size_t *configdata_len);
-#endif /* COMMON_CONFIG_INFO_H */
+#endif /* COMMON_CONFIG_INFO_H */
extern ControlFileData *get_controlfile(const char *DataDir, const char *progname, bool *crc_ok_p);
-#endif /* COMMON_CONTROLDATA_UTILS_H */
+#endif /* COMMON_CONTROLDATA_UTILS_H */
extern char *psprintf(const char *fmt,...) pg_attribute_printf(1, 2);
extern size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3, 0);
-#endif /* FE_MEMUTILS_H */
+#endif /* FE_MEMUTILS_H */
const char *progname);
extern int fsync_parent_path(const char *fname, const char *progname);
-#endif /* FILE_UTILS_H */
+#endif /* FILE_UTILS_H */
return (int64) val.lo;
}
-#endif /* USE_NATIVE_INT128 */
+#endif /* USE_NATIVE_INT128 */
-#endif /* INT128_H */
+#endif /* INT128_H */
char *service, int servicelen,
int flags);
-#endif /* IP_H */
+#endif /* IP_H */
const ScanKeyword *keywords,
int num_keywords);
-#endif /* KEYWORDS_H */
+#endif /* KEYWORDS_H */
extern int32 pglz_decompress(const char *source, int32 slen, char *dest,
int32 rawsize);
-#endif /* _PG_LZCOMPRESS_H_ */
+#endif /* _PG_LZCOMPRESS_H_ */
#define relpath(rnode, forknum) \
relpathbackend((rnode).node, (rnode).backend, forknum)
-#endif /* RELPATH_H */
+#endif /* RELPATH_H */
HANDLE CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo, const char *progname);
#endif
-#endif /* COMMON_RESTRICTED_TOKEN_H */
+#endif /* COMMON_RESTRICTED_TOKEN_H */
extern pg_saslprep_rc pg_saslprep(const char *input, char **output);
-#endif /* SASLPREP_H */
+#endif /* SASLPREP_H */
extern char *scram_build_verifier(const char *salt, int saltlen, int iterations,
const char *password);
-#endif /* SCRAM_COMMON_H */
+#endif /* SCRAM_COMMON_H */
} pg_sha512_ctx;
typedef struct pg_sha256_ctx pg_sha224_ctx;
typedef struct pg_sha512_ctx pg_sha384_ctx;
-#endif /* USE_SSL */
+#endif /* USE_SSL */
/* Interface routines for SHA224/256/384/512 */
extern void pg_sha224_init(pg_sha224_ctx *ctx);
size_t len);
extern void pg_sha512_final(pg_sha512_ctx *ctx, uint8 *dest);
-#endif /* _PG_SHA2_H_ */
+#endif /* _PG_SHA2_H_ */
extern bool pg_str_endswith(const char *str, const char *end);
-#endif /* COMMON_STRING_H */
+#endif /* COMMON_STRING_H */
extern pg_wchar *unicode_normalize_kc(const pg_wchar *input);
-#endif /* UNICODE_NORM_H */
+#endif /* UNICODE_NORM_H */
static const pg_unicode_decomposition UnicodeDecompMain[6532] =
{
{0x00A0, 0, 1 | DECOMP_INLINE, 0x0020},
- {0x00A8, 0, 2 | DECOMP_NO_COMPOSE, 0}, /* compatibility mapping */
+ {0x00A8, 0, 2 | DECOMP_NO_COMPOSE, 0}, /* compatibility mapping */
{0x00AA, 0, 1 | DECOMP_INLINE, 0x0061},
- {0x00AF, 0, 2 | DECOMP_NO_COMPOSE, 2}, /* compatibility mapping */
+ {0x00AF, 0, 2 | DECOMP_NO_COMPOSE, 2}, /* compatibility mapping */
{0x00B2, 0, 1 | DECOMP_INLINE, 0x0032},
{0x00B3, 0, 1 | DECOMP_INLINE, 0x0033},
- {0x00B4, 0, 2 | DECOMP_NO_COMPOSE, 4}, /* compatibility mapping */
+ {0x00B4, 0, 2 | DECOMP_NO_COMPOSE, 4}, /* compatibility mapping */
{0x00B5, 0, 1 | DECOMP_INLINE, 0x03BC},
- {0x00B8, 0, 2 | DECOMP_NO_COMPOSE, 6}, /* compatibility mapping */
+ {0x00B8, 0, 2 | DECOMP_NO_COMPOSE, 6}, /* compatibility mapping */
{0x00B9, 0, 1 | DECOMP_INLINE, 0x0031},
{0x00BA, 0, 1 | DECOMP_INLINE, 0x006F},
{0x00BC, 0, 3, 8},
extern const char *get_user_name(char **errstr);
extern const char *get_user_name_or_exit(const char *progname);
-#endif /* USERNAME_H */
+#endif /* USERNAME_H */
/* First allowed date, and first disallowed date, in Julian-date form */
#define DATETIME_MIN_JULIAN (0)
#define DATE_END_JULIAN (2147483494) /* == date2j(JULIAN_MAXYEAR, 1, 1) */
-#define TIMESTAMP_END_JULIAN (109203528) /* == date2j(294277, 1, 1) */
+#define TIMESTAMP_END_JULIAN (109203528) /* == date2j(294277, 1, 1) */
/* Timestamp limits */
#define MIN_TIMESTAMP INT64CONST(-211813488000000000)
/* Range-check a timestamp */
#define IS_VALID_TIMESTAMP(t) (MIN_TIMESTAMP <= (t) && (t) < END_TIMESTAMP)
-#endif /* DATATYPE_TIMESTAMP_H */
+#endif /* DATATYPE_TIMESTAMP_H */
bool first; /* first time through, need to initialize? */
bool slow; /* need runtime check for nulls? */
TupleDesc tupdesc; /* descriptor for resulting tuples */
- JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
+ JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
} wholerow;
/* for EEOP_ASSIGN_*_VAR */
struct
{
FmgrInfo *finfo; /* function's lookup data */
- FunctionCallInfo fcinfo_data; /* arguments etc */
+ FunctionCallInfo fcinfo_data; /* arguments etc */
/* faster to access without additional indirection: */
PGFunction fn_addr; /* actual call address */
int nargs; /* number of arguments */
struct
{
bool *anynull; /* track if any input was NULL */
- int jumpdone; /* jump here if result determined */
+ int jumpdone; /* jump here if result determined */
} boolexpr;
/* for EEOP_QUAL */
struct
{
- int jumpdone; /* jump here on false or null */
+ int jumpdone; /* jump here on false or null */
} qualexpr;
/* for EEOP_JUMP[_CONDITION] */
struct
{
- int jumpdone; /* target instruction's index */
+ int jumpdone; /* target instruction's index */
} jump;
/* for EEOP_NULLTEST_ROWIS[NOT]NULL */
struct
{
int paramid; /* numeric ID for parameter */
- Oid paramtype; /* OID of parameter's datatype */
+ Oid paramtype; /* OID of parameter's datatype */
} param;
/* for EEOP_CASE_TESTVAL/DOMAIN_TESTVAL */
/* for EEOP_ARRAYEXPR */
struct
{
- Datum *elemvalues; /* element values get stored here */
+ Datum *elemvalues; /* element values get stored here */
bool *elemnulls;
int nelems; /* length of the above arrays */
- Oid elemtype; /* array element type */
- int16 elemlength; /* typlen of the array element type */
- bool elembyval; /* is the element type pass-by-value? */
- char elemalign; /* typalign of the element type */
- bool multidims; /* is array expression multi-D? */
+ Oid elemtype; /* array element type */
+ int16 elemlength; /* typlen of the array element type */
+ bool elembyval; /* is the element type pass-by-value? */
+ char elemalign; /* typalign of the element type */
+ bool multidims; /* is array expression multi-D? */
} arrayexpr;
/* for EEOP_ARRAYCOERCE */
{
ArrayCoerceExpr *coerceexpr;
Oid resultelemtype; /* element type of result array */
- FmgrInfo *elemfunc; /* lookup info for element coercion
- * function */
- struct ArrayMapState *amstate; /* workspace for array_map */
+ FmgrInfo *elemfunc; /* lookup info for element coercion
+ * function */
+ struct ArrayMapState *amstate; /* workspace for array_map */
} arraycoerce;
/* for EEOP_ROW */
/* for EEOP_FIELDSELECT */
struct
{
- AttrNumber fieldnum; /* field number to extract */
- Oid resulttype; /* field's type */
+ AttrNumber fieldnum; /* field number to extract */
+ Oid resulttype; /* field's type */
/* cached tupdesc pointer - filled at runtime */
TupleDesc argdesc;
} fieldselect;
struct ArrayRefState *state;
int off; /* 0-based index of this subscript */
bool isupper; /* is it upper or lower subscript? */
- int jumpdone; /* jump here on null */
+ int jumpdone; /* jump here on null */
} arrayref_subscript;
/* for EEOP_ARRAYREF_OLD / ASSIGN / FETCH */
/* for EEOP_CONVERT_ROWTYPE */
struct
{
- ConvertRowtypeExpr *convert; /* original expression */
+ ConvertRowtypeExpr *convert; /* original expression */
/* these three fields are filled at runtime: */
TupleDesc indesc; /* tupdesc for input type */
TupleDesc outdesc; /* tupdesc for output type */
bool typbyval;
char typalign;
FmgrInfo *finfo; /* function's lookup data */
- FunctionCallInfo fcinfo_data; /* arguments etc */
+ FunctionCallInfo fcinfo_data; /* arguments etc */
/* faster to access without additional indirection: */
PGFunction fn_addr; /* actual call address */
} scalararrayop;
extern void ExecEvalWholeRowVar(ExprState *state, ExprEvalStep *op,
ExprContext *econtext);
-#endif /* EXEC_EXPR_H */
+#endif /* EXEC_EXPR_H */
extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc);
-#endif /* EXECPARALLEL_H */
+#endif /* EXECPARALLEL_H */
#define NL_printf(s)
#define NL1_printf(s, a)
#define ENL1_printf(message)
-#endif /* EXEC_NESTLOOPDEBUG */
+#endif /* EXEC_NESTLOOPDEBUG */
/* ----------------
* sort node debugging defines
#define SO_nodeDisplay(l)
#define SO_printf(s)
#define SO1_printf(s, p)
-#endif /* EXEC_SORTDEBUG */
+#endif /* EXEC_SORTDEBUG */
/* ----------------
* merge join debugging defines
#define MJ_DEBUG_COMPARE(res)
#define MJ_DEBUG_QUAL(clause, res)
#define MJ_DEBUG_PROC_NODE(slot)
-#endif /* EXEC_MERGEJOINDEBUG */
+#endif /* EXEC_MERGEJOINDEBUG */
-#endif /* EXECDEBUG_H */
+#endif /* EXECDEBUG_H */
DestReceiver *dest; /* the destination for tuple output */
ParamListInfo params; /* param values being passed in */
QueryEnvironment *queryEnv; /* query environment passed in */
- int instrument_options; /* OR of InstrumentOption flags */
+ int instrument_options; /* OR of InstrumentOption flags */
/* These fields are set by ExecutorStart */
TupleDesc tupDesc; /* descriptor for result tuples */
PlanState *planstate; /* tree of per-plan-node state */
/* This field is set by ExecutorRun */
- bool already_executed; /* true if previously executed */
+ bool already_executed; /* true if previously executed */
/* This is always set NULL by the core system, but plugins can change it */
struct Instrumentation *totaltime; /* total time spent in ExecutorRun */
extern void FreeQueryDesc(QueryDesc *qdesc);
-#endif /* EXECDESC_H */
+#endif /* EXECDESC_H */
extern void CheckSubscriptionRelkind(char relkind, const char *nspname,
const char *relname);
-#endif /* EXECUTOR_H */
+#endif /* EXECUTOR_H */
extern DestReceiver *CreateSQLFunctionDestReceiver(void);
-#endif /* FUNCTIONS_H */
+#endif /* FUNCTIONS_H */
typedef struct HashJoinTupleData
{
- struct HashJoinTupleData *next; /* link to next tuple in same bucket */
+ struct HashJoinTupleData *next; /* link to next tuple in same bucket */
uint32 hashvalue; /* tuple's hash code */
/* Tuple data, in MinimalTuple format, follows on a MAXALIGN boundary */
} HashJoinTupleData;
int nbuckets; /* # buckets in the in-memory hash table */
int log2_nbuckets; /* its log2 (nbuckets must be a power of 2) */
- int nbuckets_original; /* # buckets when starting the first
- * hash */
- int nbuckets_optimal; /* optimal # buckets (per batch) */
+ int nbuckets_original; /* # buckets when starting the first hash */
+ int nbuckets_optimal; /* optimal # buckets (per batch) */
int log2_nbuckets_optimal; /* log2(nbuckets_optimal) */
/* buckets[i] is head of list of tuples in i'th in-memory bucket */
Size spaceAllowed; /* upper limit for space used */
Size spacePeak; /* peak space used */
Size spaceUsedSkew; /* skew hash table's current space usage */
- Size spaceAllowedSkew; /* upper limit for skew hashtable */
+ Size spaceAllowedSkew; /* upper limit for skew hashtable */
MemoryContext hashCxt; /* context for whole-hash-join storage */
MemoryContext batchCxt; /* context for this-batch-only storage */
HashMemoryChunk chunks; /* one list for the whole batch */
} HashJoinTableData;
-#endif /* HASHJOIN_H */
+#endif /* HASHJOIN_H */
typedef struct BufferUsage
{
long shared_blks_hit; /* # of shared buffer hits */
- long shared_blks_read; /* # of shared disk blocks read */
+ long shared_blks_read; /* # of shared disk blocks read */
long shared_blks_dirtied; /* # of shared blocks dirtied */
long shared_blks_written; /* # of shared disk blocks written */
long local_blks_hit; /* # of local buffer hits */
long local_blks_read; /* # of local disk blocks read */
- long local_blks_dirtied; /* # of shared blocks dirtied */
- long local_blks_written; /* # of local disk blocks written */
+ long local_blks_dirtied; /* # of shared blocks dirtied */
+ long local_blks_written; /* # of local disk blocks written */
long temp_blks_read; /* # of temp blocks read */
- long temp_blks_written; /* # of temp blocks written */
+ long temp_blks_written; /* # of temp blocks written */
instr_time blk_read_time; /* time spent reading */
instr_time blk_write_time; /* time spent writing */
} BufferUsage;
extern void InstrEndParallelQuery(BufferUsage *result);
extern void InstrAccumParallelQuery(BufferUsage *result);
-#endif /* INSTRUMENT_H */
+#endif /* INSTRUMENT_H */
extern Datum aggregate_dummy(PG_FUNCTION_ARGS);
-#endif /* NODEAGG_H */
+#endif /* NODEAGG_H */
extern void ExecEndAppend(AppendState *node);
extern void ExecReScanAppend(AppendState *node);
-#endif /* NODEAPPEND_H */
+#endif /* NODEAPPEND_H */
extern void ExecEndBitmapAnd(BitmapAndState *node);
extern void ExecReScanBitmapAnd(BitmapAndState *node);
-#endif /* NODEBITMAPAND_H */
+#endif /* NODEBITMAPAND_H */
extern void ExecBitmapHeapInitializeWorker(BitmapHeapScanState *node,
shm_toc *toc);
-#endif /* NODEBITMAPHEAPSCAN_H */
+#endif /* NODEBITMAPHEAPSCAN_H */
extern void ExecEndBitmapIndexScan(BitmapIndexScanState *node);
extern void ExecReScanBitmapIndexScan(BitmapIndexScanState *node);
-#endif /* NODEBITMAPINDEXSCAN_H */
+#endif /* NODEBITMAPINDEXSCAN_H */
extern void ExecEndBitmapOr(BitmapOrState *node);
extern void ExecReScanBitmapOr(BitmapOrState *node);
-#endif /* NODEBITMAPOR_H */
+#endif /* NODEBITMAPOR_H */
extern void ExecEndCteScan(CteScanState *node);
extern void ExecReScanCteScan(CteScanState *node);
-#endif /* NODECTESCAN_H */
+#endif /* NODECTESCAN_H */
shm_toc *toc);
extern void ExecShutdownCustomScan(CustomScanState *node);
-#endif /* NODECUSTOM_H */
+#endif /* NODECUSTOM_H */
shm_toc *toc);
extern void ExecShutdownForeignScan(ForeignScanState *node);
-#endif /* NODEFOREIGNSCAN_H */
+#endif /* NODEFOREIGNSCAN_H */
extern void ExecEndFunctionScan(FunctionScanState *node);
extern void ExecReScanFunctionScan(FunctionScanState *node);
-#endif /* NODEFUNCTIONSCAN_H */
+#endif /* NODEFUNCTIONSCAN_H */
extern void ExecShutdownGather(GatherState *node);
extern void ExecReScanGather(GatherState *node);
-#endif /* NODEGATHER_H */
+#endif /* NODEGATHER_H */
extern void ExecReScanGatherMerge(GatherMergeState *node);
extern void ExecShutdownGatherMerge(GatherMergeState *node);
-#endif /* NODEGATHERMERGE_H */
+#endif /* NODEGATHERMERGE_H */
extern void ExecEndGroup(GroupState *node);
extern void ExecReScanGroup(GroupState *node);
-#endif /* NODEGROUP_H */
+#endif /* NODEGROUP_H */
int *num_skew_mcvs);
extern int ExecHashGetSkewBucket(HashJoinTable hashtable, uint32 hashvalue);
-#endif /* NODEHASH_H */
+#endif /* NODEHASH_H */
extern void ExecHashJoinSaveTuple(MinimalTuple tuple, uint32 hashvalue,
BufFile **fileptr);
-#endif /* NODEHASHJOIN_H */
+#endif /* NODEHASHJOIN_H */
extern void ExecIndexOnlyScanInitializeWorker(IndexOnlyScanState *node,
shm_toc *toc);
-#endif /* NODEINDEXONLYSCAN_H */
+#endif /* NODEINDEXONLYSCAN_H */
IndexArrayKeyInfo *arrayKeys, int numArrayKeys);
extern bool ExecIndexAdvanceArrayKeys(IndexArrayKeyInfo *arrayKeys, int numArrayKeys);
-#endif /* NODEINDEXSCAN_H */
+#endif /* NODEINDEXSCAN_H */
extern void ExecEndLimit(LimitState *node);
extern void ExecReScanLimit(LimitState *node);
-#endif /* NODELIMIT_H */
+#endif /* NODELIMIT_H */
extern void ExecEndLockRows(LockRowsState *node);
extern void ExecReScanLockRows(LockRowsState *node);
-#endif /* NODELOCKROWS_H */
+#endif /* NODELOCKROWS_H */
extern void ExecMaterialRestrPos(MaterialState *node);
extern void ExecReScanMaterial(MaterialState *node);
-#endif /* NODEMATERIAL_H */
+#endif /* NODEMATERIAL_H */
extern void ExecEndMergeAppend(MergeAppendState *node);
extern void ExecReScanMergeAppend(MergeAppendState *node);
-#endif /* NODEMERGEAPPEND_H */
+#endif /* NODEMERGEAPPEND_H */
extern void ExecEndMergeJoin(MergeJoinState *node);
extern void ExecReScanMergeJoin(MergeJoinState *node);
-#endif /* NODEMERGEJOIN_H */
+#endif /* NODEMERGEJOIN_H */
extern void ExecEndModifyTable(ModifyTableState *node);
extern void ExecReScanModifyTable(ModifyTableState *node);
-#endif /* NODEMODIFYTABLE_H */
+#endif /* NODEMODIFYTABLE_H */
extern void ExecEndNamedTuplestoreScan(NamedTuplestoreScanState *node);
extern void ExecReScanNamedTuplestoreScan(NamedTuplestoreScanState *node);
-#endif /* NODENAMEDTUPLESTORESCAN_H */
+#endif /* NODENAMEDTUPLESTORESCAN_H */
extern void ExecEndNestLoop(NestLoopState *node);
extern void ExecReScanNestLoop(NestLoopState *node);
-#endif /* NODENESTLOOP_H */
+#endif /* NODENESTLOOP_H */
extern void ExecEndProjectSet(ProjectSetState *node);
extern void ExecReScanProjectSet(ProjectSetState *node);
-#endif /* NODEPROJECTSET_H */
+#endif /* NODEPROJECTSET_H */
extern void ExecEndRecursiveUnion(RecursiveUnionState *node);
extern void ExecReScanRecursiveUnion(RecursiveUnionState *node);
-#endif /* NODERECURSIVEUNION_H */
+#endif /* NODERECURSIVEUNION_H */
extern void ExecResultRestrPos(ResultState *node);
extern void ExecReScanResult(ResultState *node);
-#endif /* NODERESULT_H */
+#endif /* NODERESULT_H */
extern void ExecEndSampleScan(SampleScanState *node);
extern void ExecReScanSampleScan(SampleScanState *node);
-#endif /* NODESAMPLESCAN_H */
+#endif /* NODESAMPLESCAN_H */
extern void ExecSeqScanInitializeDSM(SeqScanState *node, ParallelContext *pcxt);
extern void ExecSeqScanInitializeWorker(SeqScanState *node, shm_toc *toc);
-#endif /* NODESEQSCAN_H */
+#endif /* NODESEQSCAN_H */
extern void ExecEndSetOp(SetOpState *node);
extern void ExecReScanSetOp(SetOpState *node);
-#endif /* NODESETOP_H */
+#endif /* NODESETOP_H */
extern void ExecSortRestrPos(SortState *node);
extern void ExecReScanSort(SortState *node);
-#endif /* NODESORT_H */
+#endif /* NODESORT_H */
extern void ExecSetParamPlan(SubPlanState *node, ExprContext *econtext);
-#endif /* NODESUBPLAN_H */
+#endif /* NODESUBPLAN_H */
extern void ExecEndSubqueryScan(SubqueryScanState *node);
extern void ExecReScanSubqueryScan(SubqueryScanState *node);
-#endif /* NODESUBQUERYSCAN_H */
+#endif /* NODESUBQUERYSCAN_H */
extern void ExecEndTableFuncScan(TableFuncScanState *node);
extern void ExecReScanTableFuncScan(TableFuncScanState *node);
-#endif /* NODETABLEFUNCSCAN_H */
+#endif /* NODETABLEFUNCSCAN_H */
extern void ExecEndTidScan(TidScanState *node);
extern void ExecReScanTidScan(TidScanState *node);
-#endif /* NODETIDSCAN_H */
+#endif /* NODETIDSCAN_H */
extern void ExecEndUnique(UniqueState *node);
extern void ExecReScanUnique(UniqueState *node);
-#endif /* NODEUNIQUE_H */
+#endif /* NODEUNIQUE_H */
extern void ExecEndValuesScan(ValuesScanState *node);
extern void ExecReScanValuesScan(ValuesScanState *node);
-#endif /* NODEVALUESSCAN_H */
+#endif /* NODEVALUESSCAN_H */
extern void ExecEndWindowAgg(WindowAggState *node);
extern void ExecReScanWindowAgg(WindowAggState *node);
-#endif /* NODEWINDOWAGG_H */
+#endif /* NODEWINDOWAGG_H */
extern void ExecEndWorkTableScan(WorkTableScanState *node);
extern void ExecReScanWorkTableScan(WorkTableScanState *node);
-#endif /* NODEWORKTABLESCAN_H */
+#endif /* NODEWORKTABLESCAN_H */
extern void AtEOXact_SPI(bool isCommit);
extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid);
-#endif /* SPI_H */
+#endif /* SPI_H */
MemoryContext procCxt; /* procedure context */
MemoryContext execCxt; /* executor context */
MemoryContext savedcxt; /* context of SPI_connect's caller */
- SubTransactionId connectSubid; /* ID of connecting subtransaction */
+ SubTransactionId connectSubid; /* ID of connecting subtransaction */
QueryEnvironment *queryEnv; /* query environment setup for SPI level */
} _SPI_connection;
void *parserSetupArg;
} _SPI_plan;
-#endif /* SPI_PRIV_H */
+#endif /* SPI_PRIV_H */
void (*DestroyOpaque) (struct TableFuncScanState *state);
} TableFuncRoutine;
-#endif /* _TABLEFUNC_H */
+#endif /* _TABLEFUNC_H */
extern HeapTuple TupleQueueReaderNext(TupleQueueReader *reader,
bool nowait, bool *done);
-#endif /* TQUEUE_H */
+#endif /* TQUEUE_H */
MemoryContext tContext,
bool detoast);
-#endif /* TSTORE_RECEIVER_H */
+#endif /* TSTORE_RECEIVER_H */
NodeTag type;
bool tts_isempty; /* true = slot is empty */
bool tts_shouldFree; /* should pfree tts_tuple? */
- bool tts_shouldFreeMin; /* should pfree tts_mintuple? */
+ bool tts_shouldFreeMin; /* should pfree tts_mintuple? */
bool tts_slow; /* saved state for slot_deform_tuple */
HeapTuple tts_tuple; /* physical tuple, or NULL if virtual */
TupleDesc tts_tupleDescriptor; /* slot's tuple descriptor */
extern void slot_getsomeattrs(TupleTableSlot *slot, int attnum);
extern bool slot_attisnull(TupleTableSlot *slot, int attnum);
-#endif /* TUPTABLE_H */
+#endif /* TUPTABLE_H */
extern void pg_wcssize(const unsigned char *pwcs, size_t len, int encoding,
int *width, int *height, int *format_size);
-#endif /* MBPRINT_H */
+#endif /* MBPRINT_H */
{
/* A complete line style */
const char *name; /* for display purposes */
- printTextLineFormat lrule[4]; /* indexed by enum printTextRule */
+ printTextLineFormat lrule[4]; /* indexed by enum printTextRule */
const char *midvrule_nl; /* vertical line for continue after newline */
const char *midvrule_wrap; /* vertical line for wrapped data */
const char *midvrule_blank; /* vertical line for blank data */
const char *nl_right; /* right mark for newline */
const char *wrap_left; /* left mark after wrapped data */
const char *wrap_right; /* right mark for wrapped data */
- bool wrap_right_border; /* use right-hand border for wrap
- * marks when border=0? */
+ bool wrap_right_border; /* use right-hand border for wrap marks
+ * when border=0? */
} printTextFormat;
typedef enum unicode_linestyle
char *nullPrint; /* how to print null entities */
char *title; /* override title */
char **footers; /* override footer (default is "(xx rows)") */
- bool translate_header; /* do gettext on column headers */
- const bool *translate_columns; /* translate_columns[i-1] => do
- * gettext on col i */
+ bool translate_header; /* do gettext on column headers */
+ const bool *translate_columns; /* translate_columns[i-1] => do gettext on
+ * col i */
int n_translate_columns; /* length of translate_columns[] */
} printQueryOpt;
extern const printTextFormat *get_line_style(const printTableOpt *opt);
extern void refresh_utf8format(const printTableOpt *opt);
-#endif /* PRINT_H */
+#endif /* PRINT_H */
extern bool psql_scan_in_quote(PsqlScanState state);
-#endif /* PSQLSCAN_H */
+#endif /* PSQLSCAN_H */
const char *txt, int len,
PsqlScanQuoteType quote);
-#endif /* PSQLSCAN_INT_H */
+#endif /* PSQLSCAN_INT_H */
struct SimpleStringListCell *next;
bool touched; /* true, when this string was searched and
* touched */
- char val[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string here */
+ char val[FLEXIBLE_ARRAY_MEMBER]; /* null-terminated string here */
} SimpleStringListCell;
typedef struct SimpleStringList
extern const char *simple_string_list_not_touched(SimpleStringList *list);
-#endif /* SIMPLE_LIST_H */
+#endif /* SIMPLE_LIST_H */
const char *schemavar, const char *namevar,
const char *altnamevar, const char *visibilityrule);
-#endif /* STRING_UTILS_H */
+#endif /* STRING_UTILS_H */
Oid fncollation; /* collation for function to use */
bool isnull; /* function must set true if result is NULL */
short nargs; /* # arguments actually passed */
- Datum arg[FUNC_MAX_ARGS]; /* Arguments passed to function */
+ Datum arg[FUNC_MAX_ARGS]; /* Arguments passed to function */
bool argnull[FUNC_MAX_ARGS]; /* T if arg[i] is actually NULL */
} FunctionCallInfoData;
*/
/* AggCheckCallContext can return one of the following codes, or 0: */
-#define AGG_CONTEXT_AGGREGATE 1 /* regular aggregate */
-#define AGG_CONTEXT_WINDOW 2 /* window function */
+#define AGG_CONTEXT_AGGREGATE 1 /* regular aggregate */
+#define AGG_CONTEXT_WINDOW 2 /* window function */
extern int AggCheckCallContext(FunctionCallInfo fcinfo,
MemoryContext *aggcontext);
*/
extern char *fmgr(Oid procedureId,...);
-#endif /* FMGR_H */
+#endif /* FMGR_H */
ImportForeignSchemaStmt *stmt);
extern Path *GetExistingLocalJoinPath(RelOptInfo *joinrel);
-#endif /* FDWAPI_H */
+#endif /* FDWAPI_H */
extern Oid get_foreign_data_wrapper_oid(const char *fdwname, bool missing_ok);
extern Oid get_foreign_server_oid(const char *servername, bool missing_ok);
-#endif /* FOREIGN_H */
+#endif /* FOREIGN_H */
PG_RETURN_NULL(); \
} while (0)
-#endif /* FUNCAPI_H */
+#endif /* FUNCAPI_H */
#define EAI_NONAME WSAHOST_NOT_FOUND
#define EAI_SERVICE WSATYPE_NOT_FOUND
#define EAI_SOCKTYPE WSAESOCKTNOSUPPORT
-#endif /* !WIN32 */
-#endif /* !EAI_FAIL */
+#endif /* !WIN32 */
+#endif /* !EAI_FAIL */
#ifndef AI_PASSIVE
#define AI_PASSIVE 0x0001
struct addrinfo *ai_next;
};
#endif
-#endif /* HAVE_STRUCT_ADDRINFO */
+#endif /* HAVE_STRUCT_ADDRINFO */
#ifndef HAVE_GETADDRINFO
extern int getnameinfo(const struct sockaddr *sa, int salen,
char *node, int nodelen,
char *service, int servicelen, int flags);
-#endif /* HAVE_GETADDRINFO */
+#endif /* HAVE_GETADDRINFO */
-#endif /* GETADDRINFO_H */
+#endif /* GETADDRINFO_H */
const struct option *longopts, int *longindex);
#endif
-#endif /* GETOPT_LONG_H */
+#endif /* GETOPT_LONG_H */
#define binaryheap_empty(h) ((h)->bh_size == 0)
-#endif /* BINARYHEAP_H */
+#endif /* BINARYHEAP_H */
extern void BipartiteMatchFree(BipartiteMatchState *state);
-#endif /* BIPARTITE_MATCH_H */
+#endif /* BIPARTITE_MATCH_H */
extern double estimateHyperLogLog(hyperLogLogState *cState);
extern void freeHyperLogLog(hyperLogLogState *cState);
-#endif /* HYPERLOGLOG_H */
+#endif /* HYPERLOGLOG_H */
*/
#define dlist_check(head) ((void) (head))
#define slist_check(head) ((void) (head))
-#endif /* ILIST_DEBUG */
+#endif /* ILIST_DEBUG */
/* doubly linked list implementation */
(iter).cur = (iter).next, \
(iter).next = (iter).next ? (iter).next->next : NULL)
-#endif /* ILIST_H */
+#endif /* ILIST_H */
extern Bitmapset *DiscreteKnapsack(int max_weight, int num_items,
int *item_weights, double *item_values);
-#endif /* KNAPSACK_H */
+#endif /* KNAPSACK_H */
#define pairingheap_is_singular(h) \
((h)->ph_root && (h)->ph_root->first_child == NULL)
-#endif /* PAIRINGHEAP_H */
+#endif /* PAIRINGHEAP_H */
RBTreeIterator *iter);
extern RBNode *rb_iterate(RBTreeIterator *iter);
-#endif /* RBTREE_H */
+#endif /* RBTREE_H */
SH_SCOPE SH_ELEMENT_TYPE *SH_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter);
SH_SCOPE void SH_STAT(SH_TYPE * tb);
-#endif /* SH_DECLARE */
+#endif /* SH_DECLARE */
/* generate implementation of the hash table */
* Iterate backwards, that allows the current element to be deleted, even
* if there are backward shifts.
*/
- iter->cur = at & tb->sizemask; /* ensure at is within a valid range */
+ iter->cur = at & tb->sizemask; /* ensure at is within a valid range */
iter->end = iter->cur;
iter->done = false;
}
total_collisions, max_collisions, avg_collisions);
}
-#endif /* SH_DEFINE */
+#endif /* SH_DEFINE */
/* undefine external parameters, so next hash table can be defined */
*/
extern void enlargeStringInfo(StringInfo str, int needed);
-#endif /* STRINGINFO_H */
+#endif /* STRINGINFO_H */
typedef void (*ClientAuthentication_hook_type) (Port *, int);
extern PGDLLIMPORT ClientAuthentication_hook_type ClientAuthentication_hook;
-#endif /* AUTH_H */
+#endif /* AUTH_H */
extern void AtEOSubXact_LargeObject(bool isCommit, SubTransactionId mySubid,
SubTransactionId parentSubid);
-#endif /* BE_FSSTUBS_H */
+#endif /* BE_FSSTUBS_H */
bool case_sensitive);
extern bool pg_isblank(const char c);
-#endif /* HBA_H */
+#endif /* HBA_H */
extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data);
-#endif /* IFADDR_H */
+#endif /* IFADDR_H */
#include
#else
#include
-#endif /* HAVE_GSSAPI_H */
+#endif /* HAVE_GSSAPI_H */
/*
* GSSAPI brings in headers that set a lot of things in the global namespace on win32,
* that doesn't match the msvc build. It gives a bunch of compiler warnings that we ignore,
#ifdef _MSC_VER
#undef HAVE_GETADDRINFO
#endif
-#endif /* ENABLE_GSS */
+#endif /* ENABLE_GSS */
#ifdef ENABLE_SSPI
#define SECURITY_WIN32
int length;
} gss_buffer_desc;
#endif
-#endif /* ENABLE_SSPI */
+#endif /* ENABLE_SSPI */
#include "datatype/timestamp.h"
#include "libpq/hba.h"
char *remote_hostname; /* name (not ip addr) of remote host, if
* available */
int remote_hostname_resolv; /* see above */
- int remote_hostname_errcode; /* see above */
+ int remote_hostname_errcode; /* see above */
char *remote_port; /* text rep of remote port */
CAC_state canAcceptConnections; /* postmaster connection status */
* but since it gets used by elog.c in the same way as database_name and
* other members of this struct, we may as well keep it here.
*/
- TimestampTz SessionStartTime; /* backend start time */
+ TimestampTz SessionStartTime; /* backend start time */
/*
* TCP keepalive settings.
extern int pq_setkeepalivesinterval(int interval, Port *port);
extern int pq_setkeepalivescount(int count, Port *port);
-#endif /* LIBPQ_BE_H */
+#endif /* LIBPQ_BE_H */
#define INV_WRITE 0x00020000
#define INV_READ 0x00040000
-#endif /* LIBPQ_FS_H */
+#endif /* LIBPQ_FS_H */
extern char *SSLECDHCurve;
extern bool SSLPreferServerCiphers;
-#endif /* LIBPQ_H */
+#endif /* LIBPQ_H */
#define ss_len ss_stuff.sa.sa_len
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
#endif
-#endif /* HAVE_STRUCT_SOCKADDR_STORAGE */
+#endif /* HAVE_STRUCT_SOCKADDR_STORAGE */
typedef struct
{
#define SM_DATABASE 64
#define SM_USER 32
/* We append database name if db_user_namespace true. */
-#define SM_DATABASE_USER (SM_DATABASE+SM_USER+1) /* +1 for @ */
+#define SM_DATABASE_USER (SM_DATABASE+SM_USER+1) /* +1 for @ */
#define SM_OPTIONS 64
#define SM_UNUSED 64
#define SM_TTY 64
typedef struct StartupPacket
{
- ProtocolVersion protoVersion; /* Protocol version */
+ ProtocolVersion protoVersion; /* Protocol version */
char database[SM_DATABASE]; /* Database name */
/* Db_user_namespace appends dbname */
char user[SM_USER]; /* User name */
char options[SM_OPTIONS]; /* Optional additional args */
- char unused[SM_UNUSED]; /* Unused */
+ char unused[SM_UNUSED]; /* Unused */
char tty[SM_TTY]; /* Tty for debug output */
} StartupPacket;
typedef struct CancelRequestPacket
{
/* Note that each field is stored in network byte order! */
- MsgType cancelRequestCode; /* code to identify a cancel request */
+ MsgType cancelRequestCode; /* code to identify a cancel request */
uint32 backendPID; /* PID of client's backend */
uint32 cancelAuthCode; /* secret key to authorize cancel */
} CancelRequestPacket;
*/
#define NEGOTIATE_SSL_CODE PG_PROTOCOL(1234,5679)
-#endif /* PQCOMM_H */
+#endif /* PQCOMM_H */
extern const char *pq_getmsgrawstring(StringInfo msg);
extern void pq_getmsgend(StringInfo msg);
-#endif /* PQFORMAT_H */
+#endif /* PQFORMAT_H */
extern void pq_parse_errornotice(StringInfo str, ErrorData *edata);
-#endif /* PQMQ_H */
+#endif /* PQMQ_H */
#define sigfillset(set) (*(set) = ~0)
#define sigaddset(set, signum) (*(set) |= (sigmask(signum)))
#define sigdelset(set, signum) (*(set) &= ~(sigmask(signum)))
-#endif /* WIN32 */
+#endif /* WIN32 */
extern sigset_t UnBlockSig,
BlockSig,
extern void pqinitmask(void);
-#endif /* PQSIGNAL_H */
+#endif /* PQSIGNAL_H */
extern bool scram_verify_plain_password(const char *username,
const char *password, const char *verifier);
-#endif /* PG_SCRAM_H */
+#endif /* PG_SCRAM_H */
typedef struct
{
- mb2wchar_with_len_converter mb2wchar_with_len; /* convert a multibyte
- * string to a wchar */
- wchar2mb_with_len_converter wchar2mb_with_len; /* convert a wchar
- * string to a multibyte */
+ mb2wchar_with_len_converter mb2wchar_with_len; /* convert a multibyte
+ * string to a wchar */
+ wchar2mb_with_len_converter wchar2mb_with_len; /* convert a wchar string
+ * to a multibyte */
mblen_converter mblen; /* get byte length of a char */
- mbdisplaylen_converter dsplen; /* get display width of a char */
+ mbdisplaylen_converter dsplen; /* get display width of a char */
mbverifier mbverify; /* verify multibyte sequence */
int maxmblen; /* max bytes for a char in this encoding */
} pg_wchar_tbl;
extern WCHAR *pgwin32_message_to_UTF16(const char *str, int len, int *utf16len);
#endif
-#endif /* PG_WCHAR_H */
+#endif /* PG_WCHAR_H */
if (InterruptPending) \
ProcessInterrupts(); \
} while(0)
-#endif /* WIN32 */
+#endif /* WIN32 */
#define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
extern bool BackupInProgress(void);
extern void CancelBackup(void);
-#endif /* MISCADMIN_H */
+#endif /* MISCADMIN_H */
/* support for hashtables using Bitmapsets as keys: */
extern uint32 bms_hash_value(const Bitmapset *a);
-#endif /* BITMAPSET_H */
+#endif /* BITMAPSET_H */
List *ii_Predicate; /* list of Expr */
ExprState *ii_PredicateState;
Oid *ii_ExclusionOps; /* array with one entry per column */
- Oid *ii_ExclusionProcs; /* array with one entry per column */
- uint16 *ii_ExclusionStrats; /* array with one entry per column */
+ Oid *ii_ExclusionProcs; /* array with one entry per column */
+ uint16 *ii_ExclusionStrats; /* array with one entry per column */
Oid *ii_UniqueOps; /* array with one entry per column */
Oid *ii_UniqueProcs; /* array with one entry per column */
uint16 *ii_UniqueStrats; /* array with one entry per column */
MemoryContext ecxt_per_tuple_memory;
/* Values to substitute for Param nodes in expression */
- ParamExecData *ecxt_param_exec_vals; /* for PARAM_EXEC params */
+ ParamExecData *ecxt_param_exec_vals; /* for PARAM_EXEC params */
ParamListInfo ecxt_param_list_info; /* for other param types */
/*
{
SFRM_ValuePerCall = 0x01, /* one value returned per call */
SFRM_Materialize = 0x02, /* result set instantiated in Tuplestore */
- SFRM_Materialize_Random = 0x04, /* Tuplestore needs randomAccess */
+ SFRM_Materialize_Random = 0x04, /* Tuplestore needs randomAccess */
SFRM_Materialize_Preferred = 0x08 /* caller prefers Tuplestore */
} SetFunctionReturnMode;
/* Info about target table(s) for insert/update/delete queries: */
ResultRelInfo *es_result_relations; /* array of ResultRelInfos */
- int es_num_result_relations; /* length of array */
- ResultRelInfo *es_result_relation_info; /* currently active array elt */
+ int es_num_result_relations; /* length of array */
+ ResultRelInfo *es_result_relation_info; /* currently active array elt */
/*
* Info about the target partitioned target table root(s) for
int es_num_root_result_relations; /* length of the array */
/* Stuff used for firing triggers: */
- List *es_trig_target_relations; /* trigger-only ResultRelInfos */
+ List *es_trig_target_relations; /* trigger-only ResultRelInfos */
TupleTableSlot *es_trig_tuple_slot; /* for trigger output tuples */
- TupleTableSlot *es_trig_oldtup_slot; /* for TriggerEnabled */
- TupleTableSlot *es_trig_newtup_slot; /* for TriggerEnabled */
+ TupleTableSlot *es_trig_oldtup_slot; /* for TriggerEnabled */
+ TupleTableSlot *es_trig_newtup_slot; /* for TriggerEnabled */
/* Parameter info: */
ParamListInfo es_param_list_info; /* values of external params */
ParamExecData *es_param_exec_vals; /* values of internal params */
- QueryEnvironment *es_queryEnv; /* query environment */
+ QueryEnvironment *es_queryEnv; /* query environment */
/* Other working state: */
MemoryContext es_query_cxt; /* per-query context in which EState lives */
List *es_exprcontexts; /* List of ExprContexts within EState */
- List *es_subplanstates; /* List of PlanState for SubPlans */
+ List *es_subplanstates; /* List of PlanState for SubPlans */
- List *es_auxmodifytables; /* List of secondary ModifyTableStates */
+ List *es_auxmodifytables; /* List of secondary ModifyTableStates */
/*
* this ExprContext is for per-output-tuple operations, such as constraint
* output. If so, it's stored here.
*/
TupleDesc funcResultDesc;
- bool funcReturnsTuple; /* valid when funcResultDesc isn't
- * NULL */
+ bool funcReturnsTuple; /* valid when funcResultDesc isn't NULL */
/*
* Remember whether the function is declared to return a set. This is set
typedef struct DomainConstraintState
{
NodeTag type;
- DomainConstraintType constrainttype; /* constraint type */
+ DomainConstraintType constrainttype; /* constraint type */
char *name; /* name of constraint (for error msgs) */
Expr *check_expr; /* for CHECK, a boolean expression */
ExprState *check_exprstate; /* check_expr's eval state, or NULL */
Node **elems; /* array of expression states */
ExprDoneCond *elemdone; /* array of per-SRF is-done states */
int nelems; /* length of elemdone[] array */
- bool pending_srf_tuples; /* still evaluating srfs in tlist? */
+ bool pending_srf_tuples; /* still evaluating srfs in tlist? */
} ProjectSetState;
/* ----------------
PlanState **mt_plans; /* subplans (one per target rel) */
int mt_nplans; /* number of plans in the array */
int mt_whichplan; /* which one is being executed (0..n-1) */
- ResultRelInfo *resultRelInfo; /* per-subplan target relations */
+ ResultRelInfo *resultRelInfo; /* per-subplan target relations */
ResultRelInfo *rootResultRelInfo; /* root target relation (partitioned
* table root) */
List **mt_arowmarks; /* per-subplan ExecAuxRowMark lists */
EPQState mt_epqstate; /* for evaluating EvalPlanQual rechecks */
bool fireBSTriggers; /* do we need to fire stmt triggers? */
- OnConflictAction mt_onconflict; /* ON CONFLICT type */
- List *mt_arbiterindexes; /* unique index OIDs to arbitrate
- * taking alt path */
+ OnConflictAction mt_onconflict; /* ON CONFLICT type */
+ List *mt_arbiterindexes; /* unique index OIDs to arbitrate taking
+ * alt path */
TupleTableSlot *mt_existing; /* slot to store existing target tuple in */
- List *mt_excludedtlist; /* the excluded pseudo relation's
- * tlist */
- TupleTableSlot *mt_conflproj; /* CONFLICT ... SET ... projection
- * target */
+ List *mt_excludedtlist; /* the excluded pseudo relation's tlist */
+ TupleTableSlot *mt_conflproj; /* CONFLICT ... SET ... projection target */
struct PartitionDispatchData **mt_partition_dispatch_info;
/* Tuple-routing support info */
int mt_num_dispatch; /* Number of entries in the above array */
- int mt_num_partitions; /* Number of members in the following
- * arrays */
- ResultRelInfo *mt_partitions; /* Per partition result relation */
+ int mt_num_partitions; /* Number of members in the following
+ * arrays */
+ ResultRelInfo *mt_partitions; /* Per partition result relation */
TupleConversionMap **mt_partition_tupconv_maps;
/* Per partition tuple conversion map */
TupleTableSlot *mt_partition_tuple_slot;
List *args; /* expr states for TABLESAMPLE params */
ExprState *repeatable; /* expr state for REPEATABLE expr */
/* use struct pointer to avoid including tsmapi.h here */
- struct TsmRoutine *tsmroutine; /* descriptor for tablesample method */
+ struct TsmRoutine *tsmroutine; /* descriptor for tablesample method */
void *tsm_state; /* tablesample method can keep state here */
bool use_bulkread; /* use bulkread buffer access strategy? */
bool use_pagemode; /* use page-at-a-time visibility checking? */
bool simple;
int64 ordinal;
int nfuncs;
- struct FunctionScanPerFuncState *funcstates; /* array of length
- * nfuncs */
+ struct FunctionScanPerFuncState *funcstates; /* array of length nfuncs */
MemoryContext argcontext;
} FunctionScanState;
List *ns_uris; /* list of states of namespace uri exprs */
Bitmapset *notnulls; /* nullability flag for each output column */
void *opaque; /* table builder private space */
- const struct TableFuncRoutine *routine; /* table builder methods */
+ const struct TableFuncRoutine *routine; /* table builder methods */
FmgrInfo *in_functions; /* input function for each column */
Oid *typioparams; /* typioparam for each column */
int64 ordinal; /* row number to be output next */
typedef struct ForeignScanState
{
ScanState ss; /* its first field is NodeTag */
- ExprState *fdw_recheck_quals; /* original quals not in ss.ps.qual */
+ ExprState *fdw_recheck_quals; /* original quals not in ss.ps.qual */
Size pscan_len; /* size of parallel coordination information */
/* use struct pointer to avoid including fdwapi.h here */
struct FdwRoutine *fdwroutine;
{
JoinState js; /* its first field is NodeTag */
ExprState *hashclauses;
- List *hj_OuterHashKeys; /* list of ExprState nodes */
- List *hj_InnerHashKeys; /* list of ExprState nodes */
- List *hj_HashOperators; /* list of operator OIDs */
+ List *hj_OuterHashKeys; /* list of ExprState nodes */
+ List *hj_InnerHashKeys; /* list of ExprState nodes */
+ List *hj_HashOperators; /* list of operator OIDs */
HashJoinTable hj_HashTable;
uint32 hj_CurHashValue;
int hj_CurBucketNo;
ExprContext **aggcontexts; /* econtexts for long-lived data (per GS) */
ExprContext *tmpcontext; /* econtext for input expressions */
ExprContext *curaggcontext; /* currently active aggcontext */
- AggStatePerTrans curpertrans; /* currently active trans state */
+ AggStatePerTrans curpertrans; /* currently active trans state */
bool input_done; /* indicates end of input */
bool agg_done; /* indicates completion of Agg scan */
int projected_set; /* The last projected grouping set */
int current_set; /* The current grouping set being evaluated */
Bitmapset *grouped_cols; /* grouped cols in current projection */
- List *all_grouped_cols; /* list of all grouped cols in DESC
- * order */
+ List *all_grouped_cols; /* list of all grouped cols in DESC order */
/* These fields are for grouping set phase data */
int maxsets; /* The max number of sets in any phase */
AggStatePerPhase phases; /* array of all phases */
int64 frameheadpos; /* current frame head position */
int64 frametailpos; /* current frame tail position */
/* use struct pointer to avoid including windowapi.h here */
- struct WindowObjectData *agg_winobj; /* winobj for aggregate
- * fetches */
+ struct WindowObjectData *agg_winobj; /* winobj for aggregate fetches */
int64 aggregatedbase; /* start row for current aggregates */
int64 aggregatedupto; /* rows before this one are aggregated */
int frameOptions; /* frame_clause options, see WindowDef */
ExprState *startOffset; /* expression for starting bound offset */
ExprState *endOffset; /* expression for ending bound offset */
- Datum startOffsetValue; /* result of startOffset evaluation */
+ Datum startOffsetValue; /* result of startOffset evaluation */
Datum endOffsetValue; /* result of endOffset evaluation */
MemoryContext partcontext; /* context for partition-lifespan data */
bool all_first; /* true if the scan is starting */
bool all_done; /* true if the scan is finished */
- bool partition_spooled; /* true if all tuples in current
- * partition have been spooled into
- * tuplestore */
+ bool partition_spooled; /* true if all tuples in current partition
+ * have been spooled into tuplestore */
bool more_partitions; /* true if there's more partitions after
* this one */
bool framehead_valid; /* true if frameheadpos is known up to
bool need_to_scan_locally;
int gm_nkeys;
SortSupport gm_sortkeys; /* array of length ms_nkeys */
- struct GMReaderTupleBuffer *gm_tuple_buffers; /* tuple buffer per
- * reader */
+ struct GMReaderTupleBuffer *gm_tuple_buffers; /* tuple buffer per reader */
} GatherMergeState;
/* ----------------
TupleTableSlot *subSlot; /* tuple last obtained from subplan */
} LimitState;
-#endif /* EXECNODES_H */
+#endif /* EXECNODES_H */
extern const CustomScanMethods *GetCustomScanMethods(const char *CustomName,
bool missing_ok);
-#endif /* EXTENSIBLE_H */
+#endif /* EXTENSIBLE_H */
LockWaitError
} LockWaitPolicy;
-#endif /* LOCKOPTIONS_H */
+#endif /* LOCKOPTIONS_H */
extern GroupingSet *makeGroupingSet(GroupingSetKind kind, List *content, int location);
-#endif /* MAKEFUNC_H */
+#endif /* MAKEFUNC_H */
NodeTag type; /* identifies exact kind of context */
/* these two fields are placed here to minimize alignment wastage: */
bool isReset; /* T = no space alloced since last reset */
- bool allowInCritSection; /* allow palloc in critical section */
- MemoryContextMethods *methods; /* virtual function table */
+ bool allowInCritSection; /* allow palloc in critical section */
+ MemoryContextMethods *methods; /* virtual function table */
MemoryContext parent; /* NULL if no parent (toplevel context) */
MemoryContext firstchild; /* head of linked list of children */
MemoryContext prevchild; /* previous child of same parent */
((context) != NULL && \
(IsA((context), AllocSetContext) || IsA((context), SlabContext)))
-#endif /* MEMNODES_H */
+#endif /* MEMNODES_H */
/* flags bits for query_tree_walker and query_tree_mutator */
-#define QTW_IGNORE_RT_SUBQUERIES 0x01 /* subqueries in rtable */
-#define QTW_IGNORE_CTE_SUBQUERIES 0x02 /* subqueries in cteList */
-#define QTW_IGNORE_RC_SUBQUERIES 0x03 /* both of above */
-#define QTW_IGNORE_JOINALIASES 0x04 /* JOIN alias var lists */
-#define QTW_IGNORE_RANGE_TABLE 0x08 /* skip rangetable entirely */
-#define QTW_EXAMINE_RTES 0x10 /* examine RTEs */
-#define QTW_DONT_COPY_QUERY 0x20 /* do not copy top Query */
+#define QTW_IGNORE_RT_SUBQUERIES 0x01 /* subqueries in rtable */
+#define QTW_IGNORE_CTE_SUBQUERIES 0x02 /* subqueries in cteList */
+#define QTW_IGNORE_RC_SUBQUERIES 0x03 /* both of above */
+#define QTW_IGNORE_JOINALIASES 0x04 /* JOIN alias var lists */
+#define QTW_IGNORE_RANGE_TABLE 0x08 /* skip rangetable entirely */
+#define QTW_EXAMINE_RTES 0x10 /* examine RTEs */
+#define QTW_DONT_COPY_QUERY 0x20 /* do not copy top Query */
/* callback function for check_functions_in_node */
typedef bool (*check_function_callback) (Oid func_id, void *context);
extern bool planstate_tree_walker(struct PlanState *planstate, bool (*walker) (),
void *context);
-#endif /* NODEFUNCS_H */
+#endif /* NODEFUNCS_H */
newNodeMacroHolder->type = (tag), \
newNodeMacroHolder \
)
-#endif /* __GNUC__ */
+#endif /* __GNUC__ */
#define makeNode(_type_) ((_type_ *) newNode(sizeof(_type_),T_##_type_))
#define castNode(_type_, nodeptr) ((_type_ *) castNodeImpl(T_##_type_, nodeptr))
#else
#define castNode(_type_, nodeptr) ((_type_ *) (nodeptr))
-#endif /* USE_ASSERT_CHECKING */
+#endif /* USE_ASSERT_CHECKING */
/* ----------------------------------------------------------------
ONCONFLICT_UPDATE /* ON CONFLICT ... DO UPDATE */
} OnConflictAction;
-#endif /* NODES_H */
+#endif /* NODES_H */
* ----------------
*/
-#define PARAM_FLAG_CONST 0x0001 /* parameter is constant */
+#define PARAM_FLAG_CONST 0x0001 /* parameter is constant */
typedef struct ParamExternData
{
extern void SerializeParamList(ParamListInfo paramLI, char **start_address);
extern ParamListInfo RestoreParamList(char **start_address);
-#endif /* PARAMS_H */
+#endif /* PARAMS_H */
List *constraintDeps; /* a list of pg_constraint OIDs that the query
* depends on to be semantically valid */
- List *withCheckOptions; /* a list of WithCheckOption's, which
- * are only added during rewrite and
- * therefore are not written out as
- * part of Query. */
+ List *withCheckOptions; /* a list of WithCheckOption's, which are
+ * only added during rewrite and therefore
+ * are not written out as part of Query. */
/*
* The following two fields identify the portion of the source text string
List *args; /* the arguments (list of exprs) */
List *agg_order; /* ORDER BY (list of SortBy) */
Node *agg_filter; /* FILTER clause, if any */
- bool agg_within_group; /* ORDER BY appeared in WITHIN GROUP */
+ bool agg_within_group; /* ORDER BY appeared in WITHIN GROUP */
bool agg_star; /* argument was really '*' */
bool agg_distinct; /* arguments were labeled DISTINCT */
bool func_variadic; /* last argument was labeled VARIADIC */
*/
Oid relid; /* OID of the relation */
char relkind; /* relation kind (see pg_class.relkind) */
- struct TableSampleClause *tablesample; /* sampling info, or NULL */
+ struct TableSampleClause *tablesample; /* sampling info, or NULL */
/*
* Fields valid for a subquery RTE (else NULL):
*/
Query *subquery; /* the sub-query */
- bool security_barrier; /* is from security_barrier view? */
+ bool security_barrier; /* is from security_barrier view? */
/*
* Fields valid for a join RTE (else NULL/zero):
List *funccolnames; /* column names (list of String) */
List *funccoltypes; /* OID list of column type OIDs */
List *funccoltypmods; /* integer list of column typmods */
- List *funccolcollations; /* OID list of column collation OIDs */
+ List *funccolcollations; /* OID list of column collation OIDs */
/* This is set during planning for use by the executor: */
Bitmapset *funcparams; /* PARAM_EXEC Param IDs affecting this func */
} RangeTblFunction;
List *ctecolnames; /* list of output column names */
List *ctecoltypes; /* OID list of output column type OIDs */
List *ctecoltypmods; /* integer list of output column typmods */
- List *ctecolcollations; /* OID list of column collation OIDs */
+ List *ctecolcollations; /* OID list of column collation OIDs */
} CommonTableExpr;
/* Convenience macro to get the output tlist of a CTE's query */
AT_ReAddConstraint, /* internal to commands/tablecmds.c */
AT_AlterConstraint, /* alter constraint */
AT_ValidateConstraint, /* validate constraint */
- AT_ValidateConstraintRecurse, /* internal to commands/tablecmds.c */
+ AT_ValidateConstraintRecurse, /* internal to commands/tablecmds.c */
AT_ProcessedConstraint, /* pre-processed add constraint (local in
* parser/parse_utilcmd.c) */
AT_AddIndexConstraint, /* add constraint using existing index */
AT_DropConstraintRecurse, /* internal to commands/tablecmds.c */
AT_ReAddComment, /* internal to commands/tablecmds.c */
AT_AlterColumnType, /* alter column type */
- AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
+ AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
AT_ChangeOwner, /* change owner */
AT_ClusterOn, /* CLUSTER ON */
AT_DropCluster, /* SET WITHOUT CLUSTER */
NodeTag type;
List *objname; /* qualified name of function/operator */
List *objargs; /* list of Typename nodes */
- bool args_unspecified; /* argument list was omitted, so name
- * must be unique (note that objargs
- * == NIL means zero args) */
+ bool args_unspecified; /* argument list was omitted, so name must
+ * be unique (note that objargs == NIL
+ * means zero args) */
} ObjectWithArgs;
/*
List *tableElts; /* column definitions (list of ColumnDef) */
List *inhRelations; /* relations to inherit from (list of
* inhRelation) */
- PartitionBoundSpec *partbound; /* FOR VALUES clause */
+ PartitionBoundSpec *partbound; /* FOR VALUES clause */
PartitionSpec *partspec; /* PARTITION BY clause */
TypeName *ofTypename; /* OF typename */
List *constraints; /* constraints (list of Constraint nodes) */
char *newVal; /* new enum value's name */
char *newValNeighbor; /* neighboring enum value, if specified */
bool newValIsAfter; /* place new enum value after neighbor? */
- bool skipIfNewValExists; /* no error if new already exists? */
+ bool skipIfNewValExists; /* no error if new already exists? */
} AlterEnumStmt;
/* ----------------------
VACOPT_FULL = 1 << 4, /* FULL (non-concurrent) vacuum */
VACOPT_NOWAIT = 1 << 5, /* don't wait to get lock (autovacuum only) */
VACOPT_SKIPTOAST = 1 << 6, /* don't process the TOAST table, if any */
- VACOPT_DISABLE_PAGE_SKIPPING = 1 << 7 /* don't skip any pages */
+ VACOPT_DISABLE_PAGE_SKIPPING = 1 << 7 /* don't skip any pages */
} VacuumOption;
typedef struct VacuumStmt
*/
/* Reindex options */
-#define REINDEXOPT_VERBOSE 1 << 0 /* print progress info */
+#define REINDEXOPT_VERBOSE 1 << 0 /* print progress info */
typedef enum ReindexObjectType
{
{
NodeTag type;
List *conversion_name; /* Name of the conversion */
- char *for_encoding_name; /* source encoding name */
- char *to_encoding_name; /* destination encoding name */
+ char *for_encoding_name; /* source encoding name */
+ char *to_encoding_name; /* destination encoding name */
List *func_name; /* qualified conversion function name */
bool def; /* is this a default conversion? */
} CreateConversionStmt;
DropBehavior behavior; /* RESTRICT or CASCADE behavior */
} DropSubscriptionStmt;
-#endif /* PARSENODES_H */
+#endif /* PARSENODES_H */
#define listCopy(list) list_copy(list)
extern int length(List *list);
-#endif /* ENABLE_LIST_COMPAT */
+#endif /* ENABLE_LIST_COMPAT */
-#endif /* PG_LIST_H */
+#endif /* PG_LIST_H */
bool dependsOnRole; /* is plan specific to current role? */
- bool parallelModeNeeded; /* parallel mode required to execute? */
+ bool parallelModeNeeded; /* parallel mode required to execute? */
struct Plan *planTree; /* tree of Plan nodes */
List *partitioned_rels;
List *resultRelations; /* integer list of RT indexes */
int resultRelIndex; /* index of first resultRel in plan's list */
- int rootResultRelIndex; /* index of the partitioned table root */
+ int rootResultRelIndex; /* index of the partitioned table root */
List *plans; /* plan(s) producing source data */
List *withCheckOptionLists; /* per-target-table WCO lists */
List *returningLists; /* per-target-table RETURNING tlists */
List *indexqual; /* list of index quals (usually OpExprs) */
List *indexqualorig; /* the same in original form */
List *indexorderby; /* list of index ORDER BY exprs */
- List *indexorderbyorig; /* the same in original form */
+ List *indexorderbyorig; /* the same in original form */
List *indexorderbyops; /* OIDs of sort ops for ORDER BY exprs */
ScanDirection indexorderdir; /* forward or backward or don't care */
} IndexScan;
List *fdw_exprs; /* expressions that FDW may evaluate */
List *fdw_private; /* private data for FDW */
List *fdw_scan_tlist; /* optional tlist describing scan tuple */
- List *fdw_recheck_quals; /* original quals not in
- * scan.plan.qual */
+ List *fdw_recheck_quals; /* original quals not in scan.plan.qual */
Bitmapset *fs_relids; /* RTIs generated by this scan */
bool fsSystemCol; /* true if any "system column" is needed */
} ForeignScan;
List *custom_plans; /* list of Plan nodes, if any */
List *custom_exprs; /* expressions that custom code may evaluate */
List *custom_private; /* private data for custom code */
- List *custom_scan_tlist; /* optional tlist describing scan
- * tuple */
+ List *custom_scan_tlist; /* optional tlist describing scan tuple */
Bitmapset *custom_relids; /* RTIs generated by this scan */
const struct CustomScanMethods *methods;
} CustomScan;
typedef struct MergeJoin
{
Join join;
- bool skip_mark_restore; /* Can we skip mark/restore calls? */
+ bool skip_mark_restore; /* Can we skip mark/restore calls? */
List *mergeclauses; /* mergeclauses as expression trees */
/* these are arrays, but have the same length as the mergeclauses list: */
Oid *mergeFamilies; /* per-clause OIDs of btree opfamilies */
uint32 hashValue; /* hash value of object's cache lookup key */
} PlanInvalItem;
-#endif /* PLANNODES_H */
+#endif /* PLANNODES_H */
* are very useful for debugging and interpreting completed plans, so we keep
* them around.
*/
-#define INNER_VAR 65000 /* reference to inner subplan */
-#define OUTER_VAR 65001 /* reference to outer subplan */
-#define INDEX_VAR 65002 /* reference to index column */
+#define INNER_VAR 65000 /* reference to inner subplan */
+#define OUTER_VAR 65001 /* reference to outer subplan */
+#define INDEX_VAR 65002 /* reference to index column */
#define IS_SPECIAL_VARNO(varno) ((varno) >= INNER_VAR)
/* Extra data useful for determining subplan's output type: */
Oid firstColType; /* Type of first column of subplan result */
int32 firstColTypmod; /* Typmod of first column of subplan result */
- Oid firstColCollation; /* Collation of first column of
- * subplan result */
+ Oid firstColCollation; /* Collation of first column of subplan
+ * result */
/* Information about execution strategy: */
bool useHashTable; /* TRUE to store subselect output in a hash
* table (implies we are doing "IN") */
List *exclRelTlist; /* tlist of the EXCLUDED pseudo relation */
} OnConflictExpr;
-#endif /* PRIMNODES_H */
+#endif /* PRIMNODES_H */
extern void print_tl(const List *tlist, const List *rtable);
extern void print_slot(TupleTableSlot *slot);
-#endif /* PRINT_H */
+#endif /* PRINT_H */
*/
extern Node *parseNodeString(void);
-#endif /* READFUNCS_H */
+#endif /* READFUNCS_H */
bool parallelModeOK; /* parallel mode potentially OK? */
- bool parallelModeNeeded; /* parallel mode actually required? */
+ bool parallelModeNeeded; /* parallel mode actually required? */
- char maxParallelHazard; /* worst PROPARALLEL hazard level */
+ char maxParallelHazard; /* worst PROPARALLEL hazard level */
} PlannerGlobal;
/* macro for fetching the Plan associated with a SubPlan node */
* does not correspond to a base relation, such as a join RTE or an
* unreferenced view RTE; or if the RelOptInfo hasn't been made yet.
*/
- struct RelOptInfo **simple_rel_array; /* All 1-rel RelOptInfos */
+ struct RelOptInfo **simple_rel_array; /* All 1-rel RelOptInfos */
int simple_rel_array_size; /* allocated size of array */
/*
List *cte_plan_ids; /* per-CTE-item list of subplan IDs */
- List *multiexpr_params; /* List of Lists of Params for
- * MULTIEXPR subquery outputs */
+ List *multiexpr_params; /* List of Lists of Params for MULTIEXPR
+ * subquery outputs */
List *eq_classes; /* list of active EquivalenceClasses */
List *canon_pathkeys; /* list of "canonical" PathKeys */
- List *left_join_clauses; /* list of RestrictInfos for
- * mergejoinable outer join clauses
- * w/nonnullable var on left */
+ List *left_join_clauses; /* list of RestrictInfos for mergejoinable
+ * outer join clauses w/nonnullable var on
+ * left */
- List *right_join_clauses; /* list of RestrictInfos for
- * mergejoinable outer join clauses
- * w/nonnullable var on right */
+ List *right_join_clauses; /* list of RestrictInfos for mergejoinable
+ * outer join clauses w/nonnullable var on
+ * right */
- List *full_join_clauses; /* list of RestrictInfos for
- * mergejoinable full join clauses */
+ List *full_join_clauses; /* list of RestrictInfos for mergejoinable
+ * full join clauses */
List *join_info_list; /* list of SpecialJoinInfos */
List *rowMarks; /* list of PlanRowMarks */
- List *placeholder_list; /* list of PlaceHolderInfos */
+ List *placeholder_list; /* list of PlaceHolderInfos */
List *fkey_list; /* list of ForeignKeyOptInfos */
List *group_pathkeys; /* groupClause pathkeys, if any */
List *window_pathkeys; /* pathkeys of bottom window, if any */
- List *distinct_pathkeys; /* distinctClause pathkeys, if any */
+ List *distinct_pathkeys; /* distinctClause pathkeys, if any */
List *sort_pathkeys; /* sortClause pathkeys, if any */
List *initial_rels; /* RelOptInfos we are now trying to join */
MemoryContext planner_cxt; /* context holding PlannerInfo */
- double total_table_pages; /* # of pages in all tables of query */
+ double total_table_pages; /* # of pages in all tables of query */
double tuple_fraction; /* tuple_fraction passed to query_planner */
double limit_tuples; /* limit_tuples passed to query_planner */
Index qual_security_level; /* minimum security_level for quals */
/* Note: qual_security_level is zero if there are no securityQuals */
- bool hasInheritedTarget; /* true if parse->resultRelation is an
- * inheritance child rel */
+ bool hasInheritedTarget; /* true if parse->resultRelation is an
+ * inheritance child rel */
bool hasJoinRTEs; /* true if any RTEs are RTE_JOIN kind */
bool hasLateralRTEs; /* true if any RTEs are marked LATERAL */
bool hasDeletedRTEs; /* true if any RTE was deleted from jointree */
double rows; /* estimated number of result tuples */
/* per-relation planner control flags */
- bool consider_startup; /* keep cheap-startup-cost paths? */
+ bool consider_startup; /* keep cheap-startup-cost paths? */
bool consider_param_startup; /* ditto, for parameterized paths? */
- bool consider_parallel; /* consider parallel paths? */
+ bool consider_parallel; /* consider parallel paths? */
/* default result targetlist for Paths scanning this relation */
- struct PathTarget *reltarget; /* list of Vars/Exprs, cost, width */
+ struct PathTarget *reltarget; /* list of Vars/Exprs, cost, width */
/* materialization information */
List *pathlist; /* Path structures */
List *ppilist; /* ParamPathInfos used in pathlist */
- List *partial_pathlist; /* partial Paths */
+ List *partial_pathlist; /* partial Paths */
struct Path *cheapest_startup_path;
struct Path *cheapest_total_path;
struct Path *cheapest_unique_path;
List *non_unique_for_rels; /* known not unique for these set(s) */
/* used by various scans and joins: */
- List *baserestrictinfo; /* RestrictInfo structures (if base
- * rel) */
- QualCost baserestrictcost; /* cost of evaluating the above */
- Index baserestrict_min_security; /* min security_level found in
- * baserestrictinfo */
+ List *baserestrictinfo; /* RestrictInfo structures (if base rel) */
+ QualCost baserestrictcost; /* cost of evaluating the above */
+ Index baserestrict_min_security; /* min security_level found in
+ * baserestrictinfo */
List *joininfo; /* RestrictInfo structures for join clauses
* involving this rel */
- bool has_eclass_joins; /* T means joininfo is incomplete */
+ bool has_eclass_joins; /* T means joininfo is incomplete */
/* used by "other" relations */
- Relids top_parent_relids; /* Relids of topmost parents */
+ Relids top_parent_relids; /* Relids of topmost parents */
} RelOptInfo;
/*
Index ref_relid; /* RT index of the referenced table */
int nkeys; /* number of columns in the foreign key */
AttrNumber conkey[INDEX_MAX_KEYS]; /* cols in referencing table */
- AttrNumber confkey[INDEX_MAX_KEYS]; /* cols in referenced table */
- Oid conpfeqop[INDEX_MAX_KEYS]; /* PK = FK operator OIDs */
+ AttrNumber confkey[INDEX_MAX_KEYS]; /* cols in referenced table */
+ Oid conpfeqop[INDEX_MAX_KEYS]; /* PK = FK operator OIDs */
/* Derived info about whether FK's equality conditions match the query: */
int nmatched_ec; /* # of FK cols matched by ECs */
Expr *em_expr; /* the expression represented */
Relids em_relids; /* all relids appearing in em_expr */
- Relids em_nullable_relids; /* nullable by lower outer joins */
+ Relids em_nullable_relids; /* nullable by lower outer joins */
bool em_is_const; /* expression is pseudoconstant? */
bool em_is_child; /* derived version for a child relation? */
Oid em_datatype; /* the "nominal type" used by the opfamily */
bool parallel_aware; /* engage parallel-aware logic? */
bool parallel_safe; /* OK to use as part of parallel plan? */
- int parallel_workers; /* desired # of workers; 0 = not
- * parallel */
+ int parallel_workers; /* desired # of workers; 0 = not parallel */
/* estimated size/costs for path (see costsize.c for more info) */
double rows; /* estimated number of result tuples */
Path *outerjoinpath; /* path for the outer side of the join */
Path *innerjoinpath; /* path for the inner side of the join */
- List *joinrestrictinfo; /* RestrictInfos to apply to join */
+ List *joinrestrictinfo; /* RestrictInfos to apply to join */
/*
* See the notes for RelOptInfo and ParamPathInfo to understand why
typedef struct MergePath
{
JoinPath jpath;
- List *path_mergeclauses; /* join clauses to be used for merge */
+ List *path_mergeclauses; /* join clauses to be used for merge */
List *outersortkeys; /* keys for explicit sort, if any */
List *innersortkeys; /* keys for explicit sort, if any */
- bool skip_mark_restore; /* can executor skip mark/restore? */
- bool materialize_inner; /* add Materialize to inner? */
+ bool skip_mark_restore; /* can executor skip mark/restore? */
+ bool materialize_inner; /* add Materialize to inner? */
} MergePath;
/*
typedef struct HashPath
{
JoinPath jpath;
- List *path_hashclauses; /* join clauses used for hashing */
+ List *path_hashclauses; /* join clauses used for hashing */
int num_batches; /* number of batches expected */
} HashPath;
bool is_pushed_down; /* TRUE if clause was pushed down in level */
- bool outerjoin_delayed; /* TRUE if delayed by lower outer join */
+ bool outerjoin_delayed; /* TRUE if delayed by lower outer join */
bool can_join; /* see comment above */
bool outer_is_left; /* T = outer var on left, F = on right */
/* valid if clause is hashjoinable, else InvalidOid: */
- Oid hashjoinoperator; /* copy of clause operator */
+ Oid hashjoinoperator; /* copy of clause operator */
/* cache space for hashclause processing; -1 if not yet set */
Selectivity left_bucketsize; /* avg bucketsize of left side */
- Selectivity right_bucketsize; /* avg bucketsize of right side */
+ Selectivity right_bucketsize; /* avg bucketsize of right side */
} RestrictInfo;
/*
Relids syn_righthand; /* base relids syntactically within RHS */
JoinType jointype; /* always INNER, LEFT, FULL, SEMI, or ANTI */
bool lhs_strict; /* joinclause is strict for some LHS rel */
- bool delay_upper_joins; /* can't commute with upper RHS */
+ bool delay_upper_joins; /* can't commute with upper RHS */
/* Remaining fields are set only for JOIN_SEMI jointype: */
bool semi_can_btree; /* true if semi_operators are all btree */
bool semi_can_hash; /* true if semi_operators are all hash */
int numbatches;
} JoinCostWorkspace;
-#endif /* RELATION_H */
+#endif /* RELATION_H */
NodeTag type;
} SQLCmd;
-#endif /* REPLNODES_H */
+#endif /* REPLNODES_H */
extern TBMSharedIterator *tbm_attach_shared_iterate(dsa_area *dsa,
dsa_pointer dp);
-#endif /* TIDBITMAP_H */
+#endif /* TIDBITMAP_H */
extern Value *makeString(char *str);
extern Value *makeBitString(char *str);
-#endif /* VALUE_H */
+#endif /* VALUE_H */
extern Query *inline_set_returning_function(PlannerInfo *root,
RangeTblEntry *rte);
-#endif /* CLAUSES_H */
+#endif /* CLAUSES_H */
{
CONSTRAINT_EXCLUSION_OFF, /* do not use c_e */
CONSTRAINT_EXCLUSION_ON, /* apply c_e to all rels */
- CONSTRAINT_EXCLUSION_PARTITION /* apply c_e to otherrels only */
+ CONSTRAINT_EXCLUSION_PARTITION /* apply c_e to otherrels only */
} ConstraintExclusionType;
Cost input_startup_cost, Cost input_total_cost,
double *rows);
-#endif /* COST_H */
+#endif /* COST_H */
typedef struct
{
List *initial_rels; /* the base relations we are joining */
- unsigned short random_state[3]; /* state for pg_erand48() */
+ unsigned short random_state[3]; /* state for pg_erand48() */
} GeqoPrivateData;
extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
-#endif /* GEQO_H */
+#endif /* GEQO_H */
extern void geqo_copy(PlannerInfo *root, Chromosome *chromo1, Chromosome *chromo2, int string_length);
-#endif /* GEQO_COPY_H */
+#endif /* GEQO_COPY_H */
int string_length;
} Pool;
-#endif /* GEQO_GENE_H */
+#endif /* GEQO_GENE_H */
extern void print_pool(FILE *fp, Pool *pool, int start, int stop);
extern void print_gen(FILE *fp, Pool *pool, int generation);
extern void print_edge_table(FILE *fp, Edge *edge_table, int num_gene);
-#endif /* GEQO_DEBUG */
+#endif /* GEQO_DEBUG */
-#endif /* GEQO_MISC_H */
+#endif /* GEQO_MISC_H */
extern void geqo_mutation(PlannerInfo *root, Gene *tour, int num_gene);
-#endif /* GEQO_MUTATION_H */
+#endif /* GEQO_MUTATION_H */
extern void sort_pool(PlannerInfo *root, Pool *pool);
-#endif /* GEQO_POOL_H */
+#endif /* GEQO_POOL_H */
#define geqo_randint(root, upper, lower) \
( (int) floor( geqo_rand(root)*(((upper)-(lower))+0.999999) ) + (lower) )
-#endif /* GEQO_RANDOM_H */
+#endif /* GEQO_RANDOM_H */
extern void ox2(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring,
int num_gene, City *city_table);
-#endif /* GEQO_RECOMBINATION_H */
+#endif /* GEQO_RECOMBINATION_H */
Chromosome *momma, Chromosome *daddy,
Pool *pool, double bias);
-#endif /* GEQO_SELECTION_H */
+#endif /* GEQO_SELECTION_H */
RestrictInfo *restrictinfo,
Relids join_relids);
-#endif /* JOININFO_H */
+#endif /* JOININFO_H */
extern void extract_restriction_or_clauses(PlannerInfo *root);
-#endif /* ORCLAUSES_H */
+#endif /* ORCLAUSES_H */
extern ParamPathInfo *get_appendrel_parampathinfo(RelOptInfo *appendrel,
Relids required_outer);
-#endif /* PATHNODE_H */
+#endif /* PATHNODE_H */
EquivalenceClass *eclass, Oid opfamily,
int strategy, bool nulls_first);
-#endif /* PATHS_H */
+#endif /* PATHS_H */
extern void add_placeholders_to_joinrel(PlannerInfo *root, RelOptInfo *joinrel,
RelOptInfo *outer_rel, RelOptInfo *inner_rel);
-#endif /* PLACEHOLDER_H */
+#endif /* PLACEHOLDER_H */
extern bool has_row_triggers(PlannerInfo *root, Index rti, CmdType event);
-#endif /* PLANCAT_H */
+#endif /* PLANCAT_H */
List **invalItems,
bool *hasRowSecurity);
-#endif /* PLANMAIN_H */
+#endif /* PLANMAIN_H */
extern List *get_partitioned_child_rels(PlannerInfo *root, Index rti);
-#endif /* PLANNER_H */
+#endif /* PLANNER_H */
extern bool predicate_refuted_by(List *predicate_list, List *clause_list,
bool clause_is_check);
-#endif /* PREDTEST_H */
+#endif /* PREDTEST_H */
extern Node *adjust_appendrel_attrs_multilevel(PlannerInfo *root, Node *node,
RelOptInfo *child_rel);
-#endif /* PREP_H */
+#endif /* PREP_H */
Relids currentrelids,
Relids current_and_outer);
-#endif /* RESTRICTINFO_H */
+#endif /* RESTRICTINFO_H */
PlaceHolderVar *phv);
extern int SS_assign_special_param(PlannerInfo *root);
-#endif /* SUBSELECT_H */
+#endif /* SUBSELECT_H */
#define create_pathtarget(root, tlist) \
set_pathtarget_cost_width(root, make_pathtarget_from_tlist(tlist))
-#endif /* TLIST_H */
+#endif /* TLIST_H */
#define PVC_RECURSE_AGGREGATES 0x0002 /* recurse into Aggref arguments */
#define PVC_INCLUDE_WINDOWFUNCS 0x0004 /* include WindowFuncs in output list */
#define PVC_RECURSE_WINDOWFUNCS 0x0008 /* recurse into WindowFunc arguments */
-#define PVC_INCLUDE_PLACEHOLDERS 0x0010 /* include PlaceHolderVars in
- * output list */
-#define PVC_RECURSE_PLACEHOLDERS 0x0020 /* recurse into PlaceHolderVar
- * arguments */
+#define PVC_INCLUDE_PLACEHOLDERS 0x0010 /* include PlaceHolderVars in
+ * output list */
+#define PVC_RECURSE_PLACEHOLDERS 0x0020 /* recurse into PlaceHolderVar
+ * arguments */
extern Relids pull_varnos(Node *node);
extern List *pull_var_clause(Node *node, int flags);
extern Node *flatten_join_alias_vars(PlannerInfo *root, Node *node);
-#endif /* VAR_H */
+#endif /* VAR_H */
LockClauseStrength strength,
LockWaitPolicy waitPolicy, bool pushedDown);
-#endif /* ANALYZE_H */
+#endif /* ANALYZE_H */
*/
bool have_lookahead; /* is lookahead info valid? */
int lookahead_token; /* one-token lookahead */
- core_YYSTYPE lookahead_yylval; /* yylval for lookahead token */
- YYLTYPE lookahead_yylloc; /* yylloc for lookahead token */
+ core_YYSTYPE lookahead_yylval; /* yylval for lookahead token */
+ YYLTYPE lookahead_yylloc; /* yylloc for lookahead token */
char *lookahead_end; /* end of current token */
char lookahead_hold_char; /* to be put back at *lookahead_end */
extern void parser_init(base_yy_extra_type *yyext);
extern int base_yyparse(core_yyscan_t yyscanner);
-#endif /* GRAMPARSE_H */
+#endif /* GRAMPARSE_H */
Oid finalfn_oid,
Expr **finalfnexpr);
-#endif /* PARSE_AGG_H */
+#endif /* PARSE_AGG_H */
extern Index assignSortGroupRef(TargetEntry *tle, List *tlist);
extern bool targetIsInSortList(TargetEntry *tle, Oid sortop, List *sortList);
-#endif /* PARSE_CLAUSE_H */
+#endif /* PARSE_CLAUSE_H */
extern CoercionPathType find_typmod_coercion_function(Oid typeId,
Oid *funcid);
-#endif /* PARSE_COERCE_H */
+#endif /* PARSE_COERCE_H */
extern Oid select_common_collation(ParseState *pstate, List *exprs, bool none_ok);
-#endif /* PARSE_COLLATE_H */
+#endif /* PARSE_COLLATE_H */
extern void analyzeCTETargetList(ParseState *pstate, CommonTableExpr *cte,
List *tlist);
-#endif /* PARSE_CTE_H */
+#endif /* PARSE_CTE_H */
extern bool name_matches_visible_ENR(ParseState *pstate, const char *refname);
extern EphemeralNamedRelationMetadata get_visible_ENR(ParseState *pstate, const char *refname);
-#endif /* PARSE_ENR_H */
+#endif /* PARSE_ENR_H */
extern const char *ParseExprKindName(ParseExprKind exprKind);
-#endif /* PARSE_EXPR_H */
+#endif /* PARSE_EXPR_H */
extern void check_srf_call_placement(ParseState *pstate, Node *last_srf,
int location);
-#endif /* PARSE_FUNC_H */
+#endif /* PARSE_FUNC_H */
EXPR_KIND_FILTER, /* FILTER */
EXPR_KIND_WINDOW_PARTITION, /* window definition PARTITION BY */
EXPR_KIND_WINDOW_ORDER, /* window definition ORDER BY */
- EXPR_KIND_WINDOW_FRAME_RANGE, /* window frame clause with RANGE */
+ EXPR_KIND_WINDOW_FRAME_RANGE, /* window frame clause with RANGE */
EXPR_KIND_WINDOW_FRAME_ROWS, /* window frame clause with ROWS */
EXPR_KIND_SELECT_TARGET, /* SELECT target list item */
EXPR_KIND_INSERT_TARGET, /* INSERT target list item */
EXPR_KIND_FUNCTION_DEFAULT, /* default parameter value for function */
EXPR_KIND_INDEX_EXPRESSION, /* index expression */
EXPR_KIND_INDEX_PREDICATE, /* index predicate */
- EXPR_KIND_ALTER_COL_TRANSFORM, /* transform expr in ALTER COLUMN TYPE */
+ EXPR_KIND_ALTER_COL_TRANSFORM, /* transform expr in ALTER COLUMN TYPE */
EXPR_KIND_EXECUTE_PARAMETER, /* parameter value in EXECUTE */
EXPR_KIND_TRIGGER_WHEN, /* WHEN condition in CREATE TRIGGER */
EXPR_KIND_POLICY, /* USING or WITH CHECK expr in policy */
- EXPR_KIND_PARTITION_EXPRESSION /* PARTITION BY expression */
+ EXPR_KIND_PARTITION_EXPRESSION /* PARTITION BY expression */
} ParseExprKind;
*/
struct ParseState
{
- struct ParseState *parentParseState; /* stack link */
+ struct ParseState *parentParseState; /* stack link */
const char *p_sourcetext; /* source text, or NULL if not available */
List *p_rtable; /* range table so far */
List *p_joinexprs; /* JoinExprs for RTE_JOIN p_rtable entries */
* node's fromlist) */
List *p_namespace; /* currently-referenceable RTEs (List of
* ParseNamespaceItem) */
- bool p_lateral_active; /* p_lateral_only items visible? */
+ bool p_lateral_active; /* p_lateral_only items visible? */
List *p_ctenamespace; /* current namespace for common table exprs */
List *p_future_ctes; /* common table exprs not yet in namespace */
- CommonTableExpr *p_parent_cte; /* this query's containing CTE */
- Relation p_target_relation; /* INSERT/UPDATE/DELETE target rel */
- RangeTblEntry *p_target_rangetblentry; /* target rel's RTE */
+ CommonTableExpr *p_parent_cte; /* this query's containing CTE */
+ Relation p_target_relation; /* INSERT/UPDATE/DELETE target rel */
+ RangeTblEntry *p_target_rangetblentry; /* target rel's RTE */
bool p_is_insert; /* process assignment like INSERT not UPDATE */
List *p_windowdefs; /* raw representations of window clauses */
ParseExprKind p_expr_kind; /* what kind of expression we're parsing */
int p_next_resno; /* next targetlist resno to assign */
List *p_multiassign_exprs; /* junk tlist entries for multiassign */
- List *p_locking_clause; /* raw FOR UPDATE/FOR SHARE info */
+ List *p_locking_clause; /* raw FOR UPDATE/FOR SHARE info */
bool p_locked_from_parent; /* parent has marked this subquery
* with FOR UPDATE/FOR SHARE */
- bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs
- * as type text */
+ bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs as
+ * type text */
- QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing
- * env */
+ QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing env */
/* Flags telling about things found in the query: */
bool p_hasAggs;
PostParseColumnRefHook p_post_columnref_hook;
ParseParamRefHook p_paramref_hook;
CoerceParamHook p_coerce_param_hook;
- void *p_ref_hook_state; /* common passthrough link for above */
+ void *p_ref_hook_state; /* common passthrough link for above */
};
/*
Node *assignFrom);
extern Const *make_const(ParseState *pstate, Value *value, int location);
-#endif /* PARSE_NODE_H */
+#endif /* PARSE_NODE_H */
bool useOr,
Node *ltree, Node *rtree, int location);
-#endif /* PARSE_OPER_H */
+#endif /* PARSE_OPER_H */
extern void check_variable_parameters(ParseState *pstate, Query *query);
extern bool query_contains_extern_params(Query *query);
-#endif /* PARSE_PARAM_H */
+#endif /* PARSE_PARAM_H */
extern Oid attnumCollationId(Relation rd, int attid);
extern bool isQueryUsingTempRelation(Query *query);
-#endif /* PARSE_RELATION_H */
+#endif /* PARSE_RELATION_H */
extern char *FigureColname(Node *node);
extern char *FigureIndexColname(Node *node);
-#endif /* PARSE_TARGET_H */
+#endif /* PARSE_TARGET_H */
#define ISCOMPLEX(typeid) (typeidTypeRelid(typeid) != InvalidOid)
-#endif /* PARSE_TYPE_H */
+#endif /* PARSE_TYPE_H */
extern PartitionBoundSpec *transformPartitionBound(ParseState *pstate, Relation parent,
PartitionBoundSpec *spec);
-#endif /* PARSE_UTILCMD_H */
+#endif /* PARSE_UTILCMD_H */
extern List *SystemFuncName(char *name);
extern TypeName *SystemTypeName(char *name);
-#endif /* PARSER_H */
+#endif /* PARSER_H */
extern RowMarkClause *get_parse_rowmark(Query *qry, Index rtindex);
-#endif /* PARSETREE_H */
+#endif /* PARSETREE_H */
extern int scanner_errposition(int location, core_yyscan_t yyscanner);
extern void scanner_yyerror(const char *message, core_yyscan_t yyscanner) pg_attribute_noreturn();
-#endif /* SCANNER_H */
+#endif /* SCANNER_H */
extern bool scanner_isspace(char ch);
-#endif /* SCANSUP_H */
+#endif /* SCANSUP_H */
extern int opterr;
extern int optopt;
-#endif /* HAVE_GETOPT_H */
+#endif /* HAVE_GETOPT_H */
/*
* Some platforms have optreset but fail to declare it in , so cope.
extern int getopt(int nargc, char *const *nargv, const char *ostr);
#endif
-#endif /* PG_GETOPT_H */
+#endif /* PG_GETOPT_H */
#include "utils/probes.h" /* pgrminclude ignore */
-#endif /* PG_TRACE_H */
+#endif /* PG_TRACE_H */
{
Oid t_id; /* table's OID */
bool t_shared; /* is it a shared catalog? */
- struct PgStat_TableXactStatus *trans; /* lowest subxact's counts */
+ struct PgStat_TableXactStatus *trans; /* lowest subxact's counts */
PgStat_TableCounts t_counts; /* event counts to be sent */
} PgStat_TableStatus;
*/
typedef struct PgStat_TableXactStatus
{
- PgStat_Counter tuples_inserted; /* tuples inserted in (sub)xact */
- PgStat_Counter tuples_updated; /* tuples updated in (sub)xact */
- PgStat_Counter tuples_deleted; /* tuples deleted in (sub)xact */
+ PgStat_Counter tuples_inserted; /* tuples inserted in (sub)xact */
+ PgStat_Counter tuples_updated; /* tuples updated in (sub)xact */
+ PgStat_Counter tuples_deleted; /* tuples deleted in (sub)xact */
bool truncated; /* relation truncated in this (sub)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 */
int nest_level; /* subtransaction nest level */
/* links to other structs for same relation: */
- struct PgStat_TableXactStatus *upper; /* next higher subxact if any */
+ struct PgStat_TableXactStatus *upper; /* next higher subxact if any */
PgStat_TableStatus *parent; /* per-table status */
/* structs of same subxact level are linked here: */
- struct PgStat_TableXactStatus *next; /* next of same subxact */
+ struct PgStat_TableXactStatus *next; /* next of same subxact */
} PgStat_TableXactStatus;
PgStat_Counter m_buf_written_backend;
PgStat_Counter m_buf_fsync_backend;
PgStat_Counter m_buf_alloc;
- PgStat_Counter m_checkpoint_write_time; /* times in milliseconds */
+ PgStat_Counter m_checkpoint_write_time; /* times in milliseconds */
PgStat_Counter m_checkpoint_sync_time;
} PgStat_MsgBgWriter;
PgStat_Counter blocks_fetched;
PgStat_Counter blocks_hit;
- TimestampTz vacuum_timestamp; /* user initiated vacuum */
+ TimestampTz vacuum_timestamp; /* user initiated vacuum */
PgStat_Counter vacuum_count;
- TimestampTz autovac_vacuum_timestamp; /* autovacuum initiated */
+ TimestampTz autovac_vacuum_timestamp; /* autovacuum initiated */
PgStat_Counter autovac_vacuum_count;
- TimestampTz analyze_timestamp; /* user initiated */
+ TimestampTz analyze_timestamp; /* user initiated */
PgStat_Counter analyze_count;
- TimestampTz autovac_analyze_timestamp; /* autovacuum initiated */
+ TimestampTz autovac_analyze_timestamp; /* autovacuum initiated */
PgStat_Counter autovac_analyze_count;
} PgStat_StatTabEntry;
*/
typedef struct PgStat_ArchiverStats
{
- PgStat_Counter archived_count; /* archival successes */
+ PgStat_Counter archived_count; /* archival successes */
char last_archived_wal[MAX_XFN_CHARS + 1]; /* last WAL file
* archived */
- TimestampTz last_archived_timestamp; /* last archival success time */
+ TimestampTz last_archived_timestamp; /* last archival success time */
PgStat_Counter failed_count; /* failed archival attempts */
- char last_failed_wal[MAX_XFN_CHARS + 1]; /* WAL file involved in
- * last failure */
+ char last_failed_wal[MAX_XFN_CHARS + 1]; /* WAL file involved in
+ * last failure */
TimestampTz last_failed_timestamp; /* last archival failure time */
TimestampTz stat_reset_timestamp;
} PgStat_ArchiverStats;
TimestampTz stats_timestamp; /* time of stats file update */
PgStat_Counter timed_checkpoints;
PgStat_Counter requested_checkpoints;
- PgStat_Counter checkpoint_write_time; /* times in milliseconds */
+ PgStat_Counter checkpoint_write_time; /* times in milliseconds */
PgStat_Counter checkpoint_sync_time;
PgStat_Counter buf_written_checkpoints;
PgStat_Counter buf_written_clean;
/* Information about SSL connection */
int ssl_bits;
bool ssl_compression;
- char ssl_version[NAMEDATALEN]; /* MUST be null-terminated */
- char ssl_cipher[NAMEDATALEN]; /* MUST be null-terminated */
- char ssl_clientdn[NAMEDATALEN]; /* MUST be null-terminated */
+ char ssl_version[NAMEDATALEN]; /* MUST be null-terminated */
+ char ssl_cipher[NAMEDATALEN]; /* MUST be null-terminated */
+ char ssl_clientdn[NAMEDATALEN]; /* MUST be null-terminated */
} PgBackendSSLStatus;
Oid st_databaseid;
Oid st_userid;
SockAddr st_clientaddr;
- char *st_clienthostname; /* MUST be null-terminated */
+ char *st_clienthostname; /* MUST be null-terminated */
/* Information about SSL connection */
bool st_ssl;
extern PgStat_ArchiverStats *pgstat_fetch_stat_archiver(void);
extern PgStat_GlobalStats *pgstat_fetch_global(void);
-#endif /* PGSTAT_H */
+#endif /* PGSTAT_H */
extern pg_tz *pg_tzenumerate_next(pg_tzenum *dir);
extern void pg_tzenumerate_end(pg_tzenum *dir);
-#endif /* _PGTIME_H */
+#endif /* _PGTIME_H */
#define fprintf pg_fprintf
#define printf pg_printf
#endif
-#endif /* USE_REPL_SNPRINTF */
+#endif /* USE_REPL_SNPRINTF */
#if defined(WIN32)
/*
extern char *pgwin32_setlocale(int category, const char *locale);
#define setlocale(a,b) pgwin32_setlocale(a,b)
-#endif /* WIN32 */
+#endif /* WIN32 */
/* Portable prompt handling */
extern void simple_prompt(const char *prompt, char *destination, size_t destlen,
#define rename(from, to) pgrename(from, to)
#define unlink(path) pgunlink(path)
-#endif /* defined(WIN32) || defined(__CYGWIN__) */
+#endif /* defined(WIN32) || defined(__CYGWIN__) */
/*
* Win32 also doesn't have symlinks, but we can emulate them with
* close() does them all.
*/
#define closesocket close
-#endif /* WIN32 */
+#endif /* WIN32 */
/*
* On Windows, setvbuf() does not support _IOLBF mode, and interprets that
/* port/wait_error.c */
extern char *wait_result_to_str(int exit_status);
-#endif /* PG_PORT_H */
+#endif /* PG_PORT_H */
#undef INSIDE_ATOMICS_H
-#endif /* ATOMICS_H */
+#endif /* ATOMICS_H */
(((x) << 8) & 0x00ff0000) | \
(((x) >> 8) & 0x0000ff00) | \
(((x) >> 24) & 0x000000ff))
-#endif /* HAVE__BUILTIN_BSWAP32 */
+#endif /* HAVE__BUILTIN_BSWAP32 */
#ifdef HAVE__BUILTIN_BSWAP64
#define BSWAP64(x) __builtin_bswap64(x)
(((x) >> 24) & UINT64CONST(0x0000000000ff0000)) | \
(((x) >> 40) & UINT64CONST(0x000000000000ff00)) | \
(((x) >> 56) & UINT64CONST(0x00000000000000ff)))
-#endif /* HAVE__BUILTIN_BSWAP64 */
+#endif /* HAVE__BUILTIN_BSWAP64 */
/*
* Rearrange the bytes of a Datum from big-endian order into the native byte
#define DatumBigEndianToNative(x) BSWAP64(x)
#else /* SIZEOF_DATUM != 8 */
#define DatumBigEndianToNative(x) BSWAP32(x)
-#endif /* SIZEOF_DATUM == 8 */
-#endif /* WORDS_BIGENDIAN */
+#endif /* SIZEOF_DATUM == 8 */
+#endif /* WORDS_BIGENDIAN */
-#endif /* PG_BSWAP_H */
+#endif /* PG_BSWAP_H */
#endif
-#endif /* PG_CRC32C_H */
+#endif /* PG_CRC32C_H */
/* Pulled from Makefile.port in mingw */
#define DLSUFFIX ".dll"
-#endif /* _MSC_VER */
+#endif /* _MSC_VER */
/* These aren't provided by either MingW or MSVC */
#define S_IRGRP 0
*/
#undef gai_strerror
-#endif /* WIN32_SYS_SOCKET_H */
+#endif /* WIN32_SYS_SOCKET_H */
#define INSTR_TIME_GET_MICROSEC(t) \
(((uint64) (t).tv_sec * (uint64) 1000000) + (uint64) (t).tv_usec)
-#endif /* HAVE_CLOCK_GETTIME */
+#endif /* HAVE_CLOCK_GETTIME */
#else /* WIN32 */
return (double) f.QuadPart;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
-#endif /* INSTR_TIME_H */
+#endif /* INSTR_TIME_H */
#define MAP_FAILED ((void *) -1)
#endif
-#endif /* MEM_H */
+#endif /* MEM_H */
{
uint32 va_header;
uint32 va_rawsize; /* Original data size (excludes header) */
- char va_data[FLEXIBLE_ARRAY_MEMBER]; /* Compressed data */
+ char va_data[FLEXIBLE_ARRAY_MEMBER]; /* Compressed data */
} va_compressed;
} varattrib_4b;
#define SET_VARTAG_1B_E(PTR,tag) \
(((varattrib_1b_e *) (PTR))->va_header = 0x01, \
((varattrib_1b_e *) (PTR))->va_tag = (tag))
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
#define VARHDRSZ_SHORT offsetof(varattrib_1b, va_data)
#define VARATT_SHORT_MAX 0x7F
const char *errorType,
const char *fileName, int lineNumber) pg_attribute_noreturn();
-#endif /* POSTGRES_H */
+#endif /* POSTGRES_H */
#define PG_DIAG_SOURCE_LINE 'L'
#define PG_DIAG_SOURCE_FUNCTION 'R'
-#endif /* POSTGRES_EXT_H */
+#endif /* POSTGRES_EXT_H */
#include "common/fe_memutils.h"
-#endif /* POSTGRES_FE_H */
+#endif /* POSTGRES_FE_H */
extern Size AutoVacuumShmemSize(void);
extern void AutoVacuumShmemInit(void);
-#endif /* AUTOVACUUM_H */
+#endif /* AUTOVACUUM_H */
char bgw_name[BGW_MAXLEN];
int bgw_flags;
BgWorkerStartTime bgw_start_time;
- int bgw_restart_time; /* in seconds, or BGW_NEVER_RESTART */
+ int bgw_restart_time; /* in seconds, or BGW_NEVER_RESTART */
char bgw_library_name[BGW_MAXLEN];
char bgw_function_name[BGW_MAXLEN];
Datum bgw_main_arg;
extern void BackgroundWorkerBlockSignals(void);
extern void BackgroundWorkerUnblockSignals(void);
-#endif /* BGWORKER_H */
+#endif /* BGWORKER_H */
extern BackgroundWorker *BackgroundWorkerEntry(int slotno);
#endif
-#endif /* BGWORKER_INTERNALS_H */
+#endif /* BGWORKER_INTERNALS_H */
extern bool FirstCallSinceLastCheckpoint(void);
-#endif /* _BGWRITER_H */
+#endif /* _BGWRITER_H */
extern pid_t fork_process(void);
-#endif /* FORK_PROCESS_H */
+#endif /* FORK_PROCESS_H */
extern void PgArchiverMain(int argc, char *argv[]) pg_attribute_noreturn();
#endif
-#endif /* _PGARCH_H */
+#endif /* _PGARCH_H */
* Constants that represent which of postmaster_alive_fds is held by
* postmaster, and which is used in children to check for postmaster death.
*/
-#define POSTMASTER_FD_WATCH 0 /* used in children to check for
- * postmaster death */
-#define POSTMASTER_FD_OWN 1 /* kept open by postmaster only */
+#define POSTMASTER_FD_WATCH 0 /* used in children to check for
+ * postmaster death */
+#define POSTMASTER_FD_OWN 1 /* kept open by postmaster only */
#endif
extern const char *progname;
*/
#define MAX_BACKENDS 0x3FFFF
-#endif /* _POSTMASTER_H */
+#endif /* _POSTMASTER_H */
extern bool IsPromoteTriggered(void);
extern void ResetPromoteTriggered(void);
-#endif /* _STARTUP_H */
+#endif /* _STARTUP_H */
#define LOG_METAINFO_DATAFILE "current_logfiles"
#define LOG_METAINFO_DATAFILE_TMP LOG_METAINFO_DATAFILE ".tmp"
-#endif /* _SYSLOGGER_H */
+#endif /* _SYSLOGGER_H */
extern void WalWriterMain(void) pg_attribute_noreturn();
-#endif /* _WALWRITER_H */
+#endif /* _WALWRITER_H */
extern void pg_regfree(regex_t *);
extern size_t pg_regerror(int, const regex_t *, char *, size_t);
-#endif /* _REGEX_H_ */
+#endif /* _REGEX_H_ */
extern void pg_reg_getcharacters(const regex_t *regex, int co,
pg_wchar *chars, int chars_len);
-#endif /* _REGEXPORT_H_ */
+#endif /* _REGEXPORT_H_ */
color *locolormap; /* simple array indexed by chr code */
/* mapping data for chrs > MAX_SIMPLE_CHR: */
- int classbits[NUM_CCLASSES]; /* see comment above */
+ int classbits[NUM_CCLASSES]; /* see comment above */
int numcmranges; /* number of colormapranges */
colormaprange *cmranges; /* ranges of high chrs */
color *hicolormap; /* 2-D array of color entries */
extern int64 sendTablespace(char *path, bool sizeonly);
-#endif /* _BASEBACKUP_H */
+#endif /* _BASEBACKUP_H */
extern bool IsLogicalLauncher(void);
-#endif /* LOGICALLAUNCHER_H */
+#endif /* LOGICALLAUNCHER_H */
extern void logicalrep_write_typ(StringInfo out, Oid typoid);
extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
-#endif /* LOGICALREP_PROTO_H */
+#endif /* LOGICALREP_PROTO_H */
typedef struct LogicalRepRelMapEntry
{
- LogicalRepRelation remoterel; /* key is remoterel.remoteid */
+ LogicalRepRelation remoterel; /* key is remoterel.remoteid */
/* Mapping to local relation, filled as needed. */
Oid localreloid; /* local relation id */
extern void logicalrep_typmap_update(LogicalRepTyp *remotetyp);
extern Oid logicalrep_typmap_getid(Oid remoteid);
-#endif /* LOGICALRELATION_H */
+#endif /* LOGICALRELATION_H */
extern bool IsLogicalWorker(void);
-#endif /* LOGICALWORKER_H */
+#endif /* LOGICALWORKER_H */
void logicalmsg_desc(StringInfo buf, XLogReaderState *record);
const char *logicalmsg_identify(uint8 info);
-#endif /* PG_LOGICAL_MESSAGE_H */
+#endif /* PG_LOGICAL_MESSAGE_H */
extern Size ReplicationOriginShmemSize(void);
extern void ReplicationOriginShmemInit(void);
-#endif /* PG_ORIGIN_H */
+#endif /* PG_ORIGIN_H */
extern void OutputPluginWrite(struct LogicalDecodingContext *ctx, bool last_write);
extern void OutputPluginUpdateProgress(struct LogicalDecodingContext *ctx);
-#endif /* OUTPUT_PLUGIN_H */
+#endif /* OUTPUT_PLUGIN_H */
List *publications;
} PGOutputData;
-#endif /* PGOUTPUT_H */
+#endif /* PGOUTPUT_H */
extern void CheckSlotRequirements(void);
-#endif /* SLOT_H */
+#endif /* SLOT_H */
struct xl_running_xacts *running);
extern void SnapBuildSerializationPoint(SnapBuild *builder, XLogRecPtr lsn);
-#endif /* SNAPBUILD_H */
+#endif /* SNAPBUILD_H */
extern void syncrep_scanner_init(const char *query_string);
extern void syncrep_scanner_finish(void);
-#endif /* _SYNCREP_H */
+#endif /* _SYNCREP_H */
struct
{
uint32 proto_version; /* Logical protocol version */
- List *publication_names; /* String list of publications */
+ List *publication_names; /* String list of publications */
} logical;
} proto;
} WalRcvStreamOptions;
extern int GetReplicationTransferLatency(void);
extern void WalRcvForceReply(void);
-#endif /* _WALRECEIVER_H */
+#endif /* _WALRECEIVER_H */
} \
} while (0)
-#endif /* _WALSENDER_H */
+#endif /* _WALSENDER_H */
extern Node *replication_parse_result;
-#endif /* _WALSENDER_PRIVATE_H */
+#endif /* _WALSENDER_PRIVATE_H */
return OidIsValid(MyLogicalRepWorker->relid);
}
-#endif /* WORKER_INTERNAL_H */
+#endif /* WORKER_INTERNAL_H */
RewriteRule **rules;
} RuleLock;
-#endif /* REWRITE_H */
+#endif /* REWRITE_H */
extern void EnableDisableRule(Relation rel, const char *rulename,
char fires_when);
-#endif /* REWRITEDEFINE_H */
+#endif /* REWRITEDEFINE_H */
bool include_triggers,
Bitmapset *include_cols);
-#endif /* REWRITEHANDLER_H */
+#endif /* REWRITEHANDLER_H */
void *callback_arg; /* context data for callback function */
int target_varno; /* RTE index to search for */
int sublevels_up; /* (current) nesting depth */
- bool inserted_sublink; /* have we inserted a SubLink? */
+ bool inserted_sublink; /* have we inserted a SubLink? */
};
typedef enum ReplaceVarsNoMatchOption
int nomatch_varno,
bool *outer_hasSubLinks);
-#endif /* REWRITEMANIP_H */
+#endif /* REWRITEMANIP_H */
extern void RemoveRewriteRuleById(Oid ruleOid);
-#endif /* REWRITEREMOVE_H */
+#endif /* REWRITEREMOVE_H */
extern Oid get_rewrite_oid(Oid relid, const char *rulename, bool missing_ok);
-#endif /* REWRITESUPPORT_H */
+#endif /* REWRITESUPPORT_H */
List **securityQuals, List **withCheckOptions,
bool *hasRowSecurity, bool *hasSubLinks);
-#endif /* ROWSECURITY_H */
+#endif /* ROWSECURITY_H */
extern int getrusage(int who, struct rusage *rusage);
-#endif /* RUSAGESTUB_H */
+#endif /* RUSAGESTUB_H */
#endif
#define free(a) pfree(a)
-#endif /* SNOWBALL_HEADR_H */
+#endif /* SNOWBALL_HEADR_H */
extern int multi_sort_compare_dims(int start, int end, const SortItem *a,
const SortItem *b, MultiSortSupport mss);
-#endif /* EXTENDED_STATS_INTERNAL_H */
+#endif /* EXTENDED_STATS_INTERNAL_H */
#include "commands/vacuum.h"
#include "nodes/relation.h"
-#define STATS_MAX_DIMENSIONS 8 /* max number of attributes */
+#define STATS_MAX_DIMENSIONS 8 /* max number of attributes */
/* Multivariate distinct coefficients */
#define STATS_NDISTINCT_MAGIC 0xA352BFA4 /* struct identifier */
/* size of the struct excluding the items array */
#define SizeOfMVNDistinct (offsetof(MVNDistinct, nitems) + sizeof(uint32))
-#define STATS_DEPS_MAGIC 0xB4549A2C /* marks serialized bytea */
-#define STATS_DEPS_TYPE_BASIC 1 /* basic dependencies type */
+#define STATS_DEPS_MAGIC 0xB4549A2C /* marks serialized bytea */
+#define STATS_DEPS_TYPE_BASIC 1 /* basic dependencies type */
/*
* Functional dependencies, tracking column-level relationships (values
{
double degree; /* degree of validity (0-1) */
AttrNumber nattributes; /* number of attributes */
- AttrNumber attributes[FLEXIBLE_ARRAY_MEMBER]; /* attribute numbers */
+ AttrNumber attributes[FLEXIBLE_ARRAY_MEMBER]; /* attribute numbers */
} MVDependency;
/* size of the struct excluding the deps array */
extern StatisticExtInfo *choose_best_statistics(List *stats,
Bitmapset *attnums, char requiredkind);
-#endif /* STATISTICS_H */
+#endif /* STATISTICS_H */
#define InvalidBackendId (-1)
-extern PGDLLIMPORT BackendId MyBackendId; /* backend id of this backend */
+extern PGDLLIMPORT BackendId MyBackendId; /* backend id of this backend */
/* backend id of our parallel session leader, or InvalidBackendId if none */
extern PGDLLIMPORT BackendId ParallelMasterBackendId;
#define BackendIdForTempRelations() \
(ParallelMasterBackendId == InvalidBackendId ? MyBackendId : ParallelMasterBackendId)
-#endif /* BACKENDID_H */
+#endif /* BACKENDID_H */
(BlockNumber) (((blockId)->bi_hi << 16) | ((uint16) (blockId)->bi_lo)) \
)
-#endif /* BLOCK_H */
+#endif /* BLOCK_H */
*/
typedef struct BufferAccessStrategyData *BufferAccessStrategy;
-#endif /* BUF_H */
+#endif /* BUF_H */
* Note: TAG_VALID essentially means that there is a buffer hashtable
* entry associated with the buffer's tag.
*/
-#define BM_LOCKED (1U << 22) /* buffer header is locked */
-#define BM_DIRTY (1U << 23) /* data needs writing */
-#define BM_VALID (1U << 24) /* data is valid */
-#define BM_TAG_VALID (1U << 25) /* tag is assigned */
-#define BM_IO_IN_PROGRESS (1U << 26) /* read or write in progress */
-#define BM_IO_ERROR (1U << 27) /* previous I/O failed */
-#define BM_JUST_DIRTIED (1U << 28) /* dirtied since write started */
-#define BM_PIN_COUNT_WAITER (1U << 29) /* have waiter for sole pin */
-#define BM_CHECKPOINT_NEEDED (1U << 30) /* must write for checkpoint */
-#define BM_PERMANENT (1U << 31) /* permanent buffer (not
- * unlogged, or init fork) */
+#define BM_LOCKED (1U << 22) /* buffer header is locked */
+#define BM_DIRTY (1U << 23) /* data needs writing */
+#define BM_VALID (1U << 24) /* data is valid */
+#define BM_TAG_VALID (1U << 25) /* tag is assigned */
+#define BM_IO_IN_PROGRESS (1U << 26) /* read or write in progress */
+#define BM_IO_ERROR (1U << 27) /* previous I/O failed */
+#define BM_JUST_DIRTIED (1U << 28) /* dirtied since write started */
+#define BM_PIN_COUNT_WAITER (1U << 29) /* have waiter for sole pin */
+#define BM_CHECKPOINT_NEEDED (1U << 30) /* must write for checkpoint */
+#define BM_PERMANENT (1U << 31) /* permanent buffer (not unlogged,
+ * or init fork) */
/*
* The maximum allowed value of usage_count represents a tradeoff between
* accuracy and speed of the clock-sweep buffer management algorithm. A
/* state of the tag, containing flags, refcount and usagecount */
pg_atomic_uint32 state;
- int wait_backend_pid; /* backend PID of pin-count waiter */
+ int wait_backend_pid; /* backend PID of pin-count waiter */
int freeNext; /* link in freelist chain */
LWLock content_lock; /* to lock access to buffer contents */
extern void DropRelFileNodeAllLocalBuffers(RelFileNode rnode);
extern void AtEOXact_LocalBuffers(bool isCommit);
-#endif /* BUFMGR_INTERNALS_H */
+#endif /* BUFMGR_INTERNALS_H */
extern void BufFileTell(BufFile *file, int *fileno, off_t *offset);
extern int BufFileSeekBlock(BufFile *file, long blknum);
-#endif /* BUFFILE_H */
+#endif /* BUFFILE_H */
#define MAX_IO_CONCURRENCY 1000
/* special block number for ReadBuffer() */
-#define P_NEW InvalidBlockNumber /* grow the file to get a new page */
+#define P_NEW InvalidBlockNumber /* grow the file to get a new page */
/*
* Buffer content lock modes (mode argument for LockBuffer())
TestForOldSnapshot_impl(snapshot, relation);
}
-#endif /* FRONTEND */
+#endif /* FRONTEND */
-#endif /* BUFMGR_H */
+#endif /* BUFMGR_H */
* page for its new tuple version; this suggests that a prune is needed.
* Again, this is just a hint.
*/
-#define PD_HAS_FREE_LINES 0x0001 /* are there any unused line pointers? */
-#define PD_PAGE_FULL 0x0002 /* not enough free space for new
- * tuple? */
-#define PD_ALL_VISIBLE 0x0004 /* all tuples on page are visible to
- * everyone */
+#define PD_HAS_FREE_LINES 0x0001 /* are there any unused line pointers? */
+#define PD_PAGE_FULL 0x0002 /* not enough free space for new tuple? */
+#define PD_ALL_VISIBLE 0x0004 /* all tuples on page are visible to
+ * everyone */
-#define PD_VALID_FLAG_BITS 0x0007 /* OR of all valid pd_flags bits */
+#define PD_VALID_FLAG_BITS 0x0007 /* OR of all valid pd_flags bits */
/*
* Page layout version number 0 is for pre-7.3 Postgres releases.
extern char *PageSetChecksumCopy(Page page, BlockNumber blkno);
extern void PageSetChecksumInplace(Page page, BlockNumber blkno);
-#endif /* BUFPAGE_H */
+#endif /* BUFPAGE_H */
*/
extern uint16 pg_checksum_page(char *page, BlockNumber blkno);
-#endif /* CHECKSUM_H */
+#endif /* CHECKSUM_H */
extern bool ConditionVariableSignal(ConditionVariable *);
extern int ConditionVariableBroadcast(ConditionVariable *);
-#endif /* CONDITION_VARIABLE_H */
+#endif /* CONDITION_VARIABLE_H */
extern void copydir(char *fromdir, char *todir, bool recurse);
extern void copy_file(char *fromfile, char *tofile);
-#endif /* COPYDIR_H */
+#endif /* COPYDIR_H */
on_dsm_detach_callback function, Datum arg);
extern void reset_on_dsm_detach(void);
-#endif /* DSM_H */
+#endif /* DSM_H */
void **impl_private_pm_handle);
extern void dsm_impl_unpin_segment(dsm_handle handle, void **impl_private);
-#endif /* DSM_IMPL_H */
+#endif /* DSM_IMPL_H */
#define PG_TEMP_FILES_DIR "pgsql_tmp"
#define PG_TEMP_FILE_PREFIX "pgsql_tmp"
-#endif /* FD_H */
+#endif /* FD_H */
BlockNumber endBlkNum,
Size freespace);
-#endif /* FREESPACE_H_ */
+#endif /* FREESPACE_H_ */
extern bool fsm_truncate_avail(Page page, int nslots);
extern bool fsm_rebuild_page(Page page);
-#endif /* FSM_INTERNALS_H */
+#endif /* FSM_INTERNALS_H */
extern void IndexFreeSpaceMapVacuum(Relation rel);
-#endif /* INDEXFSM_H_ */
+#endif /* INDEXFSM_H_ */
extern void CreateSharedMemoryAndSemaphores(bool makePrivate, int port);
-#endif /* IPC_H */
+#endif /* IPC_H */
typedef Pointer Item;
-#endif /* ITEM_H */
+#endif /* ITEM_H */
(itemId)->lp_flags = LP_DEAD \
)
-#endif /* ITEMID_H */
+#endif /* ITEMID_H */
extern bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2);
extern int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2);
-#endif /* ITEMPTR_H */
+#endif /* ITEMPTR_H */
extern int inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes);
extern void inv_truncate(LargeObjectDesc *obj_desc, int64 len);
-#endif /* LARGE_OBJECT_H */
+#endif /* LARGE_OBJECT_H */
#define latch_sigusr1_handler() ((void) 0)
#endif
-#endif /* LATCH_H */
+#endif /* LATCH_H */
extern const char *GetLockNameFromTagType(uint16 locktag_type);
-#endif /* LMGR_H */
+#endif /* LMGR_H */
extern bool Trace_userlocks;
extern int Trace_lock_table;
extern bool Debug_deadlocks;
-#endif /* LOCK_DEBUG */
+#endif /* LOCK_DEBUG */
/*
typedef struct
{
BackendId backendId; /* determined at backend startup */
- LocalTransactionId localTransactionId; /* backend-local transaction
- * id */
+ LocalTransactionId localTransactionId; /* backend-local transaction id */
} VirtualTransactionId;
#define InvalidLocalTransactionId 0
LOCKMASK waitMask; /* bitmask for lock types awaited */
SHM_QUEUE procLocks; /* list of PROCLOCK objects assoc. with lock */
PROC_QUEUE waitProcs; /* list of PGPROC objects waiting on lock */
- int requested[MAX_LOCKMODES]; /* counts of requested locks */
+ int requested[MAX_LOCKMODES]; /* counts of requested locks */
int nRequested; /* total of requested[] array */
int granted[MAX_LOCKMODES]; /* counts of granted locks */
int nGranted; /* total of granted[] array */
extern void VirtualXactLockTableCleanup(void);
extern bool VirtualXactLock(VirtualTransactionId vxid, bool wait);
-#endif /* LOCK_H */
+#endif /* LOCK_H */
/* NoLock is not a lock mode, but a flag value meaning "don't get a lock" */
#define NoLock 0
-#define AccessShareLock 1 /* SELECT */
-#define RowShareLock 2 /* SELECT FOR UPDATE/FOR SHARE */
-#define RowExclusiveLock 3 /* INSERT, UPDATE, DELETE */
-#define ShareUpdateExclusiveLock 4 /* VACUUM (non-FULL),ANALYZE, CREATE
- * INDEX CONCURRENTLY */
-#define ShareLock 5 /* CREATE INDEX (WITHOUT CONCURRENTLY) */
-#define ShareRowExclusiveLock 6 /* like EXCLUSIVE MODE, but allows ROW
- * SHARE */
-#define ExclusiveLock 7 /* blocks ROW SHARE/SELECT...FOR
- * UPDATE */
-#define AccessExclusiveLock 8 /* ALTER TABLE, DROP TABLE, VACUUM
- * FULL, and unqualified LOCK TABLE */
+#define AccessShareLock 1 /* SELECT */
+#define RowShareLock 2 /* SELECT FOR UPDATE/FOR SHARE */
+#define RowExclusiveLock 3 /* INSERT, UPDATE, DELETE */
+#define ShareUpdateExclusiveLock 4 /* VACUUM (non-FULL),ANALYZE, CREATE INDEX
+ * CONCURRENTLY */
+#define ShareLock 5 /* CREATE INDEX (WITHOUT CONCURRENTLY) */
+#define ShareRowExclusiveLock 6 /* like EXCLUSIVE MODE, but allows ROW
+ * SHARE */
+#define ExclusiveLock 7 /* blocks ROW SHARE/SELECT...FOR UPDATE */
+#define AccessExclusiveLock 8 /* ALTER TABLE, DROP TABLE, VACUUM FULL,
+ * and unqualified LOCK TABLE */
typedef struct xl_standby_lock
{
Oid relOid;
} xl_standby_lock;
-#endif /* LOCKDEF_H_ */
+#endif /* LOCKDEF_H_ */
*/
typedef LWLock *LWLockId;
-#endif /* LWLOCK_H */
+#endif /* LWLOCK_H */
#define InvalidOffsetNumber ((OffsetNumber) 0)
#define FirstOffsetNumber ((OffsetNumber) 1)
#define MaxOffsetNumber ((OffsetNumber) (BLCKSZ / sizeof(ItemIdData)))
-#define OffsetNumberMask (0xffff) /* valid uint16 bits */
+#define OffsetNumberMask (0xffff) /* valid uint16 bits */
/* ----------------
* support macros
#define OffsetNumberPrev(offsetNumber) \
((OffsetNumber) (-1 + (offsetNumber)))
-#endif /* OFF_H */
+#endif /* OFF_H */
/* Lock a semaphore only if able to do so without blocking */
extern bool PGSemaphoreTryLock(PGSemaphore sema);
-#endif /* PG_SEMA_H */
+#endif /* PG_SEMA_H */
extern bool PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2);
extern void PGSharedMemoryDetach(void);
-#endif /* PG_SHMEM_H */
+#endif /* PG_SHMEM_H */
PMSIGNAL_WAKEN_ARCHIVER, /* send a NOTIFY signal to xlog archiver */
PMSIGNAL_ROTATE_LOGFILE, /* send SIGUSR1 to syslogger to rotate logfile */
PMSIGNAL_START_AUTOVAC_LAUNCHER, /* start an autovacuum launcher */
- PMSIGNAL_START_AUTOVAC_WORKER, /* start an autovacuum worker */
+ PMSIGNAL_START_AUTOVAC_WORKER, /* start an autovacuum worker */
PMSIGNAL_BACKGROUND_WORKER_CHANGE, /* background worker state change */
PMSIGNAL_START_WALRECEIVER, /* start a walreceiver */
- PMSIGNAL_ADVANCE_STATE_MACHINE, /* advance postmaster's state machine */
+ PMSIGNAL_ADVANCE_STATE_MACHINE, /* advance postmaster's state machine */
NUM_PMSIGNALS /* Must be last value of enum! */
} PMSignalReason;
extern void MarkPostmasterChildWalSender(void);
extern bool PostmasterIsAlive(void);
-#endif /* PMSIGNAL_H */
+#endif /* PMSIGNAL_H */
extern void predicatelock_twophase_recover(TransactionId xid, uint16 info,
void *recdata, uint32 len);
-#endif /* PREDICATE_H */
+#endif /* PREDICATE_H */
/* these values are not both interesting at the same time */
union
{
- SerCommitSeqNo earliestOutConflictCommit; /* when committed with
- * conflict out */
- SerCommitSeqNo lastCommitBeforeSnapshot; /* when not committed or
- * no conflict out */
+ SerCommitSeqNo earliestOutConflictCommit; /* when committed with
+ * conflict out */
+ SerCommitSeqNo lastCommitBeforeSnapshot; /* when not committed or
+ * no conflict out */
} SeqNo;
SHM_QUEUE outConflicts; /* list of write transactions whose data we
* couldn't read. */
TransactionId topXid; /* top level xid for the transaction, if one
* exists; else invalid */
- TransactionId finishedBefore; /* invalid means still running; else
- * the struct expires when no
- * serializable xids are before this. */
+ TransactionId finishedBefore; /* invalid means still running; else the
+ * struct expires when no serializable
+ * xids are before this. */
TransactionId xmin; /* the transaction's snapshot xmin */
uint32 flags; /* OR'd combination of values defined below */
int pid; /* pid of associated process */
} SERIALIZABLEXACT;
-#define SXACT_FLAG_COMMITTED 0x00000001 /* already committed */
-#define SXACT_FLAG_PREPARED 0x00000002 /* about to commit */
-#define SXACT_FLAG_ROLLED_BACK 0x00000004 /* already rolled back */
-#define SXACT_FLAG_DOOMED 0x00000008 /* will roll back */
+#define SXACT_FLAG_COMMITTED 0x00000001 /* already committed */
+#define SXACT_FLAG_PREPARED 0x00000002 /* about to commit */
+#define SXACT_FLAG_ROLLED_BACK 0x00000004 /* already rolled back */
+#define SXACT_FLAG_DOOMED 0x00000008 /* will roll back */
/*
* The following flag actually means that the flagged transaction has a
* conflict out *to a transaction which committed ahead of it*. It's hard
* but are not needed outside the predicate.c source file. Protected by
* SerializableXactHashLock.
*/
- TransactionId SxactGlobalXmin; /* global xmin for active serializable
- * transactions */
+ TransactionId SxactGlobalXmin; /* global xmin for active serializable
+ * transactions */
int SxactGlobalXminCount; /* how many active serializable
* transactions have this xmin */
- int WritableSxactCount; /* how many non-read-only serializable
- * transactions are active */
- SerCommitSeqNo LastSxactCommitSeqNo; /* a strictly monotonically
- * increasing number for
- * commits of serializable
- * transactions */
+ int WritableSxactCount; /* how many non-read-only serializable
+ * transactions are active */
+ SerCommitSeqNo LastSxactCommitSeqNo; /* a strictly monotonically
+ * increasing number for commits
+ * of serializable transactions */
/* Protected by SerializableXactHashLock. */
- SerCommitSeqNo CanPartialClearThrough; /* can clear predicate locks
- * and inConflicts for
- * committed transactions
- * through this seq no */
+ SerCommitSeqNo CanPartialClearThrough; /* can clear predicate locks and
+ * inConflicts for committed
+ * transactions through this seq
+ * no */
/* Protected by SerializableFinishedListLock. */
SerCommitSeqNo HavePartialClearedThrough; /* have cleared through this
* seq no */
- SERIALIZABLEXACT *OldCommittedSxact; /* shared copy of dummy sxact */
+ SERIALIZABLEXACT *OldCommittedSxact; /* shared copy of dummy sxact */
PredXactListElement element;
} PredXactListData;
extern int GetSafeSnapshotBlockingPids(int blocked_pid,
int *output, int output_size);
-#endif /* PREDICATE_INTERNALS_H */
+#endif /* PREDICATE_INTERNALS_H */
Oid databaseId; /* OID of database this backend is using */
Oid roleId; /* OID of role using this backend */
- bool isBackgroundWorker; /* true if background worker. */
+ bool isBackgroundWorker; /* true if background worker. */
/*
* While in hot standby mode, shows that a conflict signal has been sent
/* Lock manager data, recording fast-path locks taken by this backend. */
uint64 fpLockBits; /* lock modes held for each fast-path slot */
- Oid fpRelId[FP_LOCK_SLOTS_PER_BACKEND]; /* slots for rel oids */
+ Oid fpRelId[FP_LOCK_SLOTS_PER_BACKEND]; /* slots for rel oids */
bool fpVXIDLock; /* are we holding a fast-path VXID lock? */
LocalTransactionId fpLocalTransactionId; /* lxid for fast-path VXID
* lock */
* leader to get the LWLock protecting these fields.
*/
PGPROC *lockGroupLeader; /* lock group leader, if I'm a member */
- dlist_head lockGroupMembers; /* list of members, if I'm a leader */
+ dlist_head lockGroupMembers; /* list of members, if I'm a leader */
dlist_node lockGroupLink; /* my member link, if I'm a member */
};
extern void BecomeLockGroupLeader(void);
extern bool BecomeLockGroupMember(PGPROC *leader, int pid);
-#endif /* PROC_H */
+#endif /* PROC_H */
* to avoid forcing to include proc.h when including procarray.h. So if you modify
* PROC_XXX flags, you need to modify these flags.
*/
-#define PROCARRAY_VACUUM_FLAG 0x02 /* currently running
- * lazy vacuum */
-#define PROCARRAY_ANALYZE_FLAG 0x04 /* currently running
- * analyze */
-#define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing
- * logical decoding
- * outside xact */
-
-#define PROCARRAY_SLOTS_XMIN 0x20 /* replication slot
- * xmin, catalog_xmin */
+#define PROCARRAY_VACUUM_FLAG 0x02 /* currently running lazy
+ * vacuum */
+#define PROCARRAY_ANALYZE_FLAG 0x04 /* currently running
+ * analyze */
+#define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing logical
+ * decoding outside xact */
+
+#define PROCARRAY_SLOTS_XMIN 0x20 /* replication slot xmin,
+ * catalog_xmin */
/*
* Only flags in PROCARRAY_PROC_FLAGS_MASK are considered when matching
* PGXACT->vacuumFlags. Other flags are used for different purposes and
extern void ProcArrayGetReplicationSlotXmin(TransactionId *xmin,
TransactionId *catalog_xmin);
-#endif /* PROCARRAY_H */
+#endif /* PROCARRAY_H */
PROCSIG_CATCHUP_INTERRUPT, /* sinval catchup interrupt */
PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */
PROCSIG_PARALLEL_MESSAGE, /* message from cooperating parallel backend */
- PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for
- * shutdown */
+ PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for shutdown */
/* Recovery conflict reasons */
PROCSIG_RECOVERY_CONFLICT_DATABASE,
extern void procsignal_sigusr1_handler(SIGNAL_ARGS);
-#endif /* PROCSIGNAL_H */
+#endif /* PROCSIGNAL_H */
#define UNLOGGED_RELATION_CLEANUP 0x0001
#define UNLOGGED_RELATION_INIT 0x0002
-#endif /* REINIT_H */
+#endif /* REINIT_H */
(node1).backend == (node2).backend && \
(node1).node.spcNode == (node2).node.spcNode)
-#endif /* RELFILENODE_H */
+#endif /* RELFILENODE_H */
/* Smallest possible queue. */
extern PGDLLIMPORT const Size shm_mq_minimum_size;
-#endif /* SHM_MQ_H */
+#endif /* SHM_MQ_H */
extern Size shm_toc_estimate(shm_toc_estimator *e);
-#endif /* SHM_TOC_H */
+#endif /* SHM_TOC_H */
/* this is a hash bucket in the shmem index table */
typedef struct
{
- char key[SHMEM_INDEX_KEYSIZE]; /* string name */
+ char key[SHMEM_INDEX_KEYSIZE]; /* string name */
void *location; /* location in shared mem */
Size size; /* # bytes allocated for the structure */
} ShmemIndexEnt;
extern bool SHMQueueEmpty(const SHM_QUEUE *queue);
extern bool SHMQueueIsDetached(const SHM_QUEUE *queue);
-#endif /* SHMEM_H */
+#endif /* SHMEM_H */
extern void LocalExecuteInvalidationMessage(SharedInvalidationMessage *msg);
-#endif /* SINVAL_H */
+#endif /* SINVAL_H */
extern LocalTransactionId GetNextLocalTransactionId(void);
-#endif /* SINVALADT_H */
+#endif /* SINVALADT_H */
typedef struct SMgrRelationData
{
/* rnode is the hashtable lookup key, so it must be first! */
- RelFileNodeBackend smgr_rnode; /* relation physical identifier */
+ RelFileNodeBackend smgr_rnode; /* relation physical identifier */
/* pointer to owning pointer, or NULL if none */
struct SMgrRelationData **smgr_owner;
* happens. In all three cases, InvalidBlockNumber means "unknown".
*/
BlockNumber smgr_targblock; /* current insertion target block */
- BlockNumber smgr_fsm_nblocks; /* last known size of fsm fork */
+ BlockNumber smgr_fsm_nblocks; /* last known size of fsm fork */
BlockNumber smgr_vm_nblocks; /* last known size of vm fork */
/* additional public fields may someday exist here */
extern void ForgetRelationFsyncRequests(RelFileNode rnode, ForkNumber forknum);
extern void ForgetDatabaseFsyncRequests(Oid dbid);
-#endif /* SMGR_H */
+#endif /* SMGR_H */
extern PGSemaphore *SpinlockSemaArray;
#endif
-#endif /* SPIN_H */
+#endif /* SPIN_H */
int subxcnt; /* # of subxact ids in xids[] */
bool subxid_overflow; /* snapshot overflowed, subxids missing */
TransactionId nextXid; /* copy of ShmemVariableCache->nextXid */
- TransactionId oldestRunningXid; /* *not* oldestXmin */
+ TransactionId oldestRunningXid; /* *not* oldestXmin */
TransactionId latestCompletedXid; /* so we can set xmax */
TransactionId *xids; /* array of (sub)xids still running */
extern void LogStandbyInvalidations(int nmsgs, SharedInvalidationMessage *msgs,
bool relcacheInitFileInval);
-#endif /* STANDBY_H */
+#endif /* STANDBY_H */
int subxcnt; /* # of subxact ids in xids[] */
bool subxid_overflow; /* snapshot overflowed, subxids missing */
TransactionId nextXid; /* copy of ShmemVariableCache->nextXid */
- TransactionId oldestRunningXid; /* *not* oldestXmin */
+ TransactionId oldestRunningXid; /* *not* oldestXmin */
TransactionId latestCompletedXid; /* so we can set xmax */
TransactionId xids[FLEXIBLE_ARRAY_MEMBER];
#define MinSizeOfInvalidations offsetof(xl_invalidations, msgs)
-#endif /* STANDBYDEFS_H */
+#endif /* STANDBYDEFS_H */
} d;
} CollectedCommand;
-#endif /* DEPARSE_UTILITY_H */
+#endif /* DEPARSE_UTILITY_H */
/* Private fields might appear beyond this point... */
};
-extern DestReceiver *None_Receiver; /* permanent receiver for DestNone */
+extern DestReceiver *None_Receiver; /* permanent receiver for DestNone */
/* The primary destination management functions */
extern void NullCommand(CommandDest dest);
extern void ReadyForQuery(CommandDest dest);
-#endif /* DEST_H */
+#endif /* DEST_H */
extern int GetOldFunctionMessage(StringInfo buf);
extern void HandleFunctionRequest(StringInfo msgBuf);
-#endif /* FASTPATH_H */
+#endif /* FASTPATH_H */
long count,
DestReceiver *dest);
-#endif /* PQUERY_H */
+#endif /* PQUERY_H */
GucContext context, GucSource source);
extern const char *get_stats_option_name(const char *arg);
-#endif /* TCOPPROT_H */
+#endif /* TCOPPROT_H */
extern bool CommandIsReadOnly(PlannedStmt *pstmt);
-#endif /* UTILITY_H */
+#endif /* UTILITY_H */
extern bool check_TSCurrentConfig(char **newval, void **extra, GucSource source);
extern void assign_TSCurrentConfig(const char *newval, void *extra);
-#endif /* TS_CACHE_H */
+#endif /* TS_CACHE_H */
#define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
#define COPYCHAR(d,s) (*((unsigned char *) (d)) = TOUCHAR(s))
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
extern char *lowerstr(const char *str);
extern char *lowerstr_with_len(const char *str, int len);
extern char *t_readline(FILE *fp);
-#endif /* __TSLOCALE_H__ */
+#endif /* __TSLOCALE_H__ */
* getnext == true */
} DictSubState;
-#endif /* _PG_TS_PUBLIC_H_ */
+#endif /* _PG_TS_PUBLIC_H_ */
#define PG_GETARG_TSQUERY_COPY(n) DatumGetTSQueryCopy(PG_GETARG_DATUM(n))
#define PG_RETURN_TSQUERY(x) return TSQueryGetDatum(x)
-#endif /* _PG_TSTYPE_H_ */
+#endif /* _PG_TSTYPE_H_ */
typedef void (*PushFunction) (Datum opaque, TSQueryParserState state,
char *token, int tokenlen,
- int16 tokenweights, /* bitmap as described
- * in QueryOperand
- * struct */
+ int16 tokenweights, /* bitmap as described in
+ * QueryOperand struct */
bool prefix);
extern TSQuery parse_tsquery(char *buf,
extern QTNode *findsubquery(QTNode *root, QTNode *ex, QTNode *subs,
bool *isfind);
-#endif /* _PG_TS_UTILS_H_ */
+#endif /* _PG_TS_UTILS_H_ */
* External representations of the privilege bits --- aclitemin/aclitemout
* represent each possible privilege bit with a distinct 1-character code
*/
-#define ACL_INSERT_CHR 'a' /* formerly known as "append" */
-#define ACL_SELECT_CHR 'r' /* formerly known as "read" */
-#define ACL_UPDATE_CHR 'w' /* formerly known as "write" */
+#define ACL_INSERT_CHR 'a' /* formerly known as "append" */
+#define ACL_SELECT_CHR 'r' /* formerly known as "read" */
+#define ACL_UPDATE_CHR 'w' /* formerly known as "write" */
#define ACL_DELETE_CHR 'd'
-#define ACL_TRUNCATE_CHR 'D' /* super-delete, as it were */
+#define ACL_TRUNCATE_CHR 'D' /* super-delete, as it were */
#define ACL_REFERENCES_CHR 'x'
#define ACL_TRIGGER_CHR 't'
#define ACL_EXECUTE_CHR 'X'
extern bool has_createrole_privilege(Oid roleid);
extern bool has_bypassrls_privilege(Oid roleid);
-#endif /* ACL_H */
+#endif /* ACL_H */
} InternalGrant;
-#endif /* ACLCHK_INTERNAL_H */
+#endif /* ACLCHK_INTERNAL_H */
extern AnyArrayType *DatumGetAnyArray(Datum d);
extern void deconstruct_expanded_array(ExpandedArrayHeader *eah);
-#endif /* ARRAY_H */
+#endif /* ARRAY_H */
return ret;
}
-#endif /* ARRAYACCESS_H */
+#endif /* ARRAYACCESS_H */
extern void ascii_safe_strlcpy(char *dest, const char *src, size_t destsiz);
-#endif /* _ASCII_H_ */
+#endif /* _ASCII_H_ */
AttributeOpts *get_attribute_options(Oid spcid, int attnum);
-#endif /* ATTOPTCACHE_H */
+#endif /* ATTOPTCACHE_H */
extern void BackendRandomShmemInit(void);
extern bool pg_backend_random(char *dst, int len);
-#endif /* BACKEND_RANDOM_H */
+#endif /* BACKEND_RANDOM_H */
/* quote.c */
extern char *quote_literal_cstr(const char *rawstr);
-#endif /* BUILTINS_H */
+#endif /* BUILTINS_H */
extern int bytea_output; /* ByteaOutputType, but int for GUC enum */
-#endif /* BYTEA_H */
+#endif /* BYTEA_H */
#define PG_GETARG_CASH(n) DatumGetCash(PG_GETARG_DATUM(n))
#define PG_RETURN_CASH(x) return CashGetDatum(x)
-#endif /* CASH_H */
+#endif /* CASH_H */
int cc_ntup; /* # of tuples currently in this cache */
int cc_nbuckets; /* # of hash buckets in this cache */
int cc_nkeys; /* # of keys (1..CATCACHE_MAXKEYS) */
- int cc_key[CATCACHE_MAXKEYS]; /* AttrNumber of each key */
+ int cc_key[CATCACHE_MAXKEYS]; /* AttrNumber of each key */
PGFunction cc_hashfunc[CATCACHE_MAXKEYS]; /* hash function for each key */
- ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for
- * heap scans */
+ ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for heap
+ * scans */
bool cc_isname[CATCACHE_MAXKEYS]; /* flag "name" key columns */
dlist_head cc_lists; /* list of CatCList structs */
dlist_head *cc_bucket; /* hash buckets */
extern void PrintCatCacheLeakWarning(HeapTuple tuple);
extern void PrintCatCacheListLeakWarning(CatCList *list);
-#endif /* CATCACHE_H */
+#endif /* CATCACHE_H */
extern void SerializeComboCIDState(Size maxsize, char *start_address);
extern Size EstimateComboCIDStateSpace(void);
-#endif /* COMBOCID_H */
+#endif /* COMBOCID_H */
extern TimeTzADT *GetSQLCurrentTime(int32 typmod);
extern TimeADT GetSQLLocalTime(int32 typmod);
-#endif /* DATE_H */
+#endif /* DATE_H */
* Include check for leap year.
*/
-extern const char *const months[]; /* months (3-char abbreviations) */
+extern const char *const months[]; /* months (3-char abbreviations) */
extern const char *const days[]; /* days (full names) */
extern const int day_tab[2][13];
int n);
extern void InstallTimeZoneAbbrevs(TimeZoneAbbrevTable *tbl);
-#endif /* DATETIME_H */
+#endif /* DATETIME_H */
int typLen, char **start_address);
extern Datum datumRestore(char **start_address, bool *isnull);
-#endif /* DATUM_H */
+#endif /* DATUM_H */
extern void dsa_trim(dsa_area *area);
extern void dsa_dump(dsa_area *area);
-#endif /* DSA_H */
+#endif /* DSA_H */
extern int my_log2(long num);
-#endif /* DYNAHASH_H */
+#endif /* DYNAHASH_H */
extern void pg_dlclose(void *handle);
extern char *pg_dlerror(void);
-#endif /* DYNAMIC_LOADER_H */
+#endif /* DYNAMIC_LOADER_H */
* server log by default. */
#define LOG_SERVER_ONLY 16 /* Same as LOG for server reporting, but never
* sent to client. */
-#define COMMERROR LOG_SERVER_ONLY /* Client communication problems; same
- * as LOG for server reporting, but
- * never sent to client. */
+#define COMMERROR LOG_SERVER_ONLY /* Client communication problems; same as
+ * LOG for server reporting, but never
+ * sent to client. */
#define INFO 17 /* Messages specifically requested by user (eg
* VACUUM VERBOSE output); always sent to
* client regardless of client_min_messages,
if (elevel_ >= ERROR) \
pg_unreachable(); \
} while(0)
-#endif /* HAVE__BUILTIN_CONSTANT_P */
+#endif /* HAVE__BUILTIN_CONSTANT_P */
#define ereport(elevel, rest) \
ereport_domain(elevel, TEXTDOMAIN, rest)
pg_unreachable(); \
} \
} while(0)
-#endif /* HAVE__BUILTIN_CONSTANT_P */
+#endif /* HAVE__BUILTIN_CONSTANT_P */
#else /* !HAVE__VA_ARGS */
#define elog \
elog_start(__FILE__, __LINE__, PG_FUNCNAME_MACRO), \
elog_finish
-#endif /* HAVE__VA_ARGS */
+#endif /* HAVE__VA_ARGS */
extern void elog_start(const char *filename, int lineno, const char *funcname);
extern void elog_finish(int elevel, const char *fmt,...) pg_attribute_printf(2, 3);
typedef struct ErrorData
{
int elevel; /* error level */
- bool output_to_server; /* will report to server log? */
- bool output_to_client; /* will report to client? */
+ bool output_to_server; /* will report to server log? */
+ bool output_to_client; /* will report to client? */
bool show_funcname; /* true to force funcname inclusion */
bool hide_stmt; /* true to prevent STATEMENT: inclusion */
bool hide_ctx; /* true to prevent CONTEXT: inclusion */
*/
extern void write_stderr(const char *fmt,...) pg_attribute_printf(1, 2);
-#endif /* ELOG_H */
+#endif /* ELOG_H */
extern List *EventCacheLookup(EventTriggerEvent event);
-#endif /* EVTCACHE_H */
+#endif /* EVTCACHE_H */
extern Datum TransferExpandedObject(Datum d, MemoryContext new_parent);
extern void DeleteExpandedObject(Datum d);
-#endif /* EXPANDEDDATUM_H */
+#endif /* EXPANDEDDATUM_H */
extern const int fmgr_nbuiltins; /* number of entries in table */
-#endif /* FMGRTAB_H */
+#endif /* FMGRTAB_H */
Size npages);
extern char *FreePageManagerDump(FreePageManager *fpm);
-#endif /* FREEPAGE_H */
+#endif /* FREEPAGE_H */
extern double point_sl(Point *pt1, Point *pt2);
extern double pg_hypot(double x, double y);
-#endif /* GEO_DECLS_H */
+#endif /* GEO_DECLS_H */
#define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */
#define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */
#define GUC_NOT_WHILE_SEC_REST 0x0400 /* can't set if security restricted */
-#define GUC_DISALLOW_IN_AUTO_FILE 0x0800 /* can't set in
- * PG_AUTOCONF_FILENAME */
+#define GUC_DISALLOW_IN_AUTO_FILE 0x0800 /* can't set in
+ * PG_AUTOCONF_FILENAME */
#define GUC_UNIT_KB 0x1000 /* value is in kilobytes */
#define GUC_UNIT_BLOCKS 0x2000 /* value is in blocks */
extern bool check_wal_buffers(int *newval, void **extra, GucSource source);
extern void assign_xlog_sync_method(int new_sync_method, void *extra);
-#endif /* GUC_H */
+#endif /* GUC_H */
};
/* bit values in status field */
-#define GUC_IS_IN_FILE 0x0001 /* found it in config file */
+#define GUC_IS_IN_FILE 0x0001 /* found it in config file */
/*
* Caution: the GUC_IS_IN_FILE bit is transient state for ProcessConfigFile.
* Do not assume that its value represents useful information elsewhere.
extern bool config_enum_lookup_by_name(struct config_enum *record,
const char *value, int *retval);
-#endif /* GUC_TABLES_H */
+#endif /* GUC_TABLES_H */
#define oid_hash uint32_hash /* Remove me eventually */
-#endif /* HSEARCH_H */
+#endif /* HSEARCH_H */
double *indexCorrelation,
double *indexPages);
-#endif /* INDEX_SELFUNCS_H */
+#endif /* INDEX_SELFUNCS_H */
extern int bitncmp(const unsigned char *l, const unsigned char *r, int n);
extern int bitncommon(const unsigned char *l, const unsigned char *r, int n);
-#endif /* INET_H */
+#endif /* INET_H */
extern bool scanint8(const char *str, bool errorOK, int64 *result);
-#endif /* INT8_H */
+#endif /* INT8_H */
extern void CallSyscacheCallbacks(int cacheid, uint32 hashvalue);
extern void InvalidateSystemCaches(void);
-#endif /* INVAL_H */
+#endif /* INVAL_H */
/* functions in json.c */
extern void escape_json(StringInfo buf, const char *str);
-#endif /* JSON_H */
+#endif /* JSON_H */
extern text *transform_json_string_values(text *json, void *action_state,
JsonTransformStringValuesAction transform_action);
-#endif /* JSONAPI_H */
+#endif /* JSONAPI_H */
#define JENTRY_ISBOOL_FALSE 0x20000000
#define JENTRY_ISBOOL_TRUE 0x30000000
#define JENTRY_ISNULL 0x40000000
-#define JENTRY_ISCONTAINER 0x50000000 /* array or object */
+#define JENTRY_ISCONTAINER 0x50000000 /* array or object */
/* Access macros. Note possible multiple evaluations */
#define JBE_OFFLENFLD(je_) ((je_) & JENTRY_OFFLENMASK)
} JsonbContainer;
/* flags for the header-field in JsonbContainer */
-#define JB_CMASK 0x0FFFFFFF /* mask for count field */
-#define JB_FSCALAR 0x10000000 /* flag bits */
+#define JB_CMASK 0x0FFFFFFF /* mask for count field */
+#define JB_FSCALAR 0x10000000 /* flag bits */
#define JB_FOBJECT 0x20000000
#define JB_FARRAY 0x40000000
{
int nElems;
JsonbValue *elems;
- bool rawScalar; /* Top-level "raw scalar" array? */
+ bool rawScalar; /* Top-level "raw scalar" array? */
} array; /* Array container type */
struct
int estimated_len);
-#endif /* __JSONB_H__ */
+#endif /* __JSONB_H__ */
long *blocknum, int *offset);
extern long LogicalTapeSetBlocks(LogicalTapeSet *lts);
-#endif /* LOGTAPE_H */
+#endif /* LOGTAPE_H */
#define TypeIsToastable(typid) (get_typstorage(typid) != 'p')
-#endif /* LSYSCACHE_H */
+#endif /* LSYSCACHE_H */
VALGRIND_MAKE_MEM_NOACCESS(ptr, size);
}
-#endif /* CLOBBER_FREED_MEMORY */
+#endif /* CLOBBER_FREED_MEMORY */
#ifdef MEMORY_CONTEXT_CHECKING
return ret;
}
-#endif /* MEMORY_CONTEXT_CHECKING */
+#endif /* MEMORY_CONTEXT_CHECKING */
#ifdef RANDOMIZE_ALLOCATED_MEMORY
void randomize_mem(char *ptr, size_t size);
-#endif /* RANDOMIZE_ALLOCATED_MEMORY */
+#endif /* RANDOMIZE_ALLOCATED_MEMORY */
-#endif /* MEMDEBUG_H */
+#endif /* MEMDEBUG_H */
* MemoryContextAllocHuge(). Both limits permit code to assume that it may
* compute twice an allocation's size without overflow.
*/
-#define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */
+#define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */
#define AllocSizeIsValid(size) ((Size) (size) <= MaxAllocSize)
#define SLAB_DEFAULT_BLOCK_SIZE (8 * 1024)
#define SLAB_LARGE_BLOCK_SIZE (8 * 1024 * 1024)
-#endif /* MEMUTILS_H */
+#endif /* MEMUTILS_H */
* These were chosen as special 32-bit bit patterns,
* so redefine them explicitly using these bit patterns. - tgl 97/02/24
*/
-#define INVALID_ABSTIME ((AbsoluteTime) 0x7FFFFFFE) /* 2147483647 (2^31 - 1) */
-#define NOEND_ABSTIME ((AbsoluteTime) 0x7FFFFFFC) /* 2147483645 (2^31 - 3) */
-#define NOSTART_ABSTIME ((AbsoluteTime) INT_MIN) /* -2147483648 */
+#define INVALID_ABSTIME ((AbsoluteTime) 0x7FFFFFFE) /* 2147483647 (2^31 - 1) */
+#define NOEND_ABSTIME ((AbsoluteTime) 0x7FFFFFFC) /* 2147483645 (2^31 - 3) */
+#define NOSTART_ABSTIME ((AbsoluteTime) INT_MIN) /* -2147483648 */
-#define INVALID_RELTIME ((RelativeTime) 0x7FFFFFFE) /* 2147483647 (2^31 - 1) */
+#define INVALID_RELTIME ((RelativeTime) 0x7FFFFFFE) /* 2147483647 (2^31 - 1) */
#define AbsoluteTimeIsValid(time) \
((bool) ((time) != INVALID_ABSTIME))
extern AbsoluteTime GetCurrentAbsoluteTime(void);
extern void abstime2tm(AbsoluteTime time, int *tzp, struct pg_tm *tm, char **tzn);
-#endif /* NABSTIME_H */
+#endif /* NABSTIME_H */
extern char *numeric_out_sci(Numeric num, int scale);
extern char *numeric_normalize(Numeric num);
-#endif /* _PG_NUMERIC_H_ */
+#endif /* _PG_NUMERIC_H_ */
CurrentMemoryContext = context;
return old;
}
-#endif /* FRONTEND */
+#endif /* FRONTEND */
/* Registration of memory context reset/delete callbacks */
extern void MemoryContextRegisterResetCallback(MemoryContext context,
extern char *psprintf(const char *fmt,...) pg_attribute_printf(1, 2);
extern size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3, 0);
-#endif /* PALLOC_H */
+#endif /* PALLOC_H */
*/
extern PGDLLIMPORT const uint32 pg_crc32_table[256];
-#endif /* PG_CRC_H */
+#endif /* PG_CRC_H */
const char *from, size_t fromlen, pg_locale_t locale);
#endif
-#endif /* _PG_LOCALE_ */
+#endif /* _PG_LOCALE_ */
#define PG_GETARG_LSN(n) DatumGetLSN(PG_GETARG_DATUM(n))
#define PG_RETURN_LSN(x) return LSNGetDatum(x)
-#endif /* PG_LSN_H */
+#endif /* PG_LSN_H */
extern void pg_rusage_init(PGRUsage *ru0);
extern const char *pg_rusage_show(const PGRUsage *ru0);
-#endif /* PG_RUSAGE_H */
+#endif /* PG_RUSAGE_H */
typedef struct CachedPlanSource
{
int magic; /* should equal CACHEDPLANSOURCE_MAGIC */
- struct RawStmt *raw_parse_tree; /* output of raw_parser(), or NULL */
+ struct RawStmt *raw_parse_tree; /* output of raw_parser(), or NULL */
const char *query_string; /* source text of query */
const char *commandTag; /* command tag (a constant!), or NULL */
Oid *param_types; /* array of parameter type OIDs, or NULL */
List *query_list; /* list of Query nodes, or NIL if not valid */
List *relationOids; /* OIDs of relations the queries depend on */
List *invalItems; /* other dependencies, as PlanInvalItems */
- struct OverrideSearchPath *search_path; /* search_path used for
- * parsing and planning */
+ struct OverrideSearchPath *search_path; /* search_path used for parsing
+ * and planning */
MemoryContext query_context; /* context holding the above, or NULL */
Oid rewriteRoleId; /* Role ID we did rewriting for */
- bool rewriteRowSecurity; /* row_security used during rewrite */
+ bool rewriteRowSecurity; /* row_security used during rewrite */
bool dependsOnRLS; /* is rewritten query specific to the above? */
/* If we have a generic plan, this is a reference-counted link to it: */
struct CachedPlan *gplan; /* generic plan, or NULL if not valid */
bool is_valid; /* is the query_list currently valid? */
int generation; /* increments each time we create a plan */
/* If CachedPlanSource has been saved, it is a member of a global list */
- struct CachedPlanSource *next_saved; /* list link, if so */
+ struct CachedPlanSource *next_saved; /* list link, if so */
/* State kept to help decide whether to use custom or generic plans: */
double generic_cost; /* cost of generic plan, or -1 if not known */
- double total_custom_cost; /* total cost of custom plans so far */
- int num_custom_plans; /* number of plans included in total */
+ double total_custom_cost; /* total cost of custom plans so far */
+ int num_custom_plans; /* number of plans included in total */
} CachedPlanSource;
/*
QueryEnvironment *queryEnv);
extern void ReleaseCachedPlan(CachedPlan *plan, bool useResOwner);
-#endif /* PLANCACHE_H */
+#endif /* PLANCACHE_H */
const char *prepStmtName; /* source prepared statement (NULL if none) */
MemoryContext heap; /* subsidiary memory for portal */
ResourceOwner resowner; /* resources owned by portal */
- void (*cleanup) (Portal portal); /* cleanup hook */
+ void (*cleanup) (Portal portal); /* cleanup hook */
/*
* State data for remembering which subtransaction(s) the portal was
* createSubid is the creating subxact and activeSubid is the last subxact
* in which we ran the portal.
*/
- SubTransactionId createSubid; /* the creating subxact */
- SubTransactionId activeSubid; /* the last subxact with activity */
+ SubTransactionId createSubid; /* the creating subxact */
+ SubTransactionId activeSubid; /* the last subxact with activity */
/* The query or queries the portal will execute */
const char *sourceText; /* text of query (as of 8.4, never NULL) */
extern void PortalHashTableDeleteAll(void);
extern bool ThereAreNoReadyPortals(void);
-#endif /* PORTAL_H */
+#endif /* PORTAL_H */
extern const char *get_ps_display(int *displen);
-#endif /* PS_STATUS_H */
+#endif /* PS_STATUS_H */
extern EphemeralNamedRelation get_ENR(QueryEnvironment *queryEnv, const char *name);
extern TupleDesc ENRMetadataGetTupDesc(EphemeralNamedRelationMetadata enrmd);
-#endif /* QUERYENVIRONMENT_H */
+#endif /* QUERYENVIRONMENT_H */
RangeBound bound2);
extern RangeType *make_empty_range(TypeCacheEntry *typcache);
-#endif /* RANGETYPES_H */
+#endif /* RANGETYPES_H */
bool rd_fkeyvalid; /* true if list has been computed */
MemoryContext rd_partkeycxt; /* private memory cxt for the below */
- struct PartitionKeyData *rd_partkey; /* partition key, or NULL */
+ struct PartitionKeyData *rd_partkey; /* partition key, or NULL */
MemoryContext rd_pdcxt; /* private context for partdesc */
- struct PartitionDescData *rd_partdesc; /* partitions, or NULL */
+ struct PartitionDescData *rd_partdesc; /* partitions, or NULL */
List *rd_partcheck; /* partition CHECK quals */
/* data managed by RelationGetIndexList: */
/* These are non-NULL only for an index relation: */
Form_pg_index rd_index; /* pg_index tuple describing this index */
/* use "struct" here to avoid needing to include htup.h: */
- struct HeapTupleData *rd_indextuple; /* all of pg_index tuple */
+ struct HeapTupleData *rd_indextuple; /* all of pg_index tuple */
/*
* index access support info (used only for an index relation)
Oid rd_amhandler; /* OID of index AM's handler function */
MemoryContext rd_indexcxt; /* private memory cxt for this stuff */
/* use "struct" here to avoid needing to include amapi.h: */
- struct IndexAmRoutine *rd_amroutine; /* index AM's API struct */
+ struct IndexAmRoutine *rd_amroutine; /* index AM's API struct */
Oid *rd_opfamily; /* OIDs of op families for each index col */
Oid *rd_opcintype; /* OIDs of opclass declared input data types */
RegProcedure *rd_support; /* OIDs of support procedures */
Oid rd_toastoid; /* Real TOAST table's OID, or InvalidOid */
/* use "struct" here to avoid needing to include pgstat.h: */
- struct PgStat_TableStatus *pgstat_info; /* statistics collection area */
+ struct PgStat_TableStatus *pgstat_info; /* statistics collection area */
} RelationData;
int nkeys; /* number of columns in the foreign key */
/* these arrays each have nkeys valid entries: */
AttrNumber conkey[INDEX_MAX_KEYS]; /* cols in referencing table */
- AttrNumber confkey[INDEX_MAX_KEYS]; /* cols in referenced table */
- Oid conpfeqop[INDEX_MAX_KEYS]; /* PK = FK operator OIDs */
+ AttrNumber confkey[INDEX_MAX_KEYS]; /* cols in referenced table */
+ Oid conpfeqop[INDEX_MAX_KEYS]; /* PK = FK operator OIDs */
} ForeignKeyCacheInfo;
int32 vl_len_; /* varlena header (do not touch directly!) */
int fillfactor; /* page fill factor in percent (0..100) */
AutoVacOpts autovacuum; /* autovacuum-related options */
- bool user_catalog_table; /* use as an additional catalog
- * relation */
- int parallel_workers; /* max number of parallel workers */
+ bool user_catalog_table; /* use as an additional catalog relation */
+ int parallel_workers; /* max number of parallel workers */
} StdRdOptions;
#define HEAP_MIN_FILLFACTOR 10
extern bool RelationHasUnloggedIndex(Relation rel);
extern List *RelationGetRepsetList(Relation rel);
-#endif /* REL_H */
+#endif /* REL_H */
/* should be used only by relcache.c and postinit.c */
extern bool criticalSharedRelcachesBuilt;
-#endif /* RELCACHE_H */
+#endif /* RELCACHE_H */
extern Oid RelidByRelfilenode(Oid reltablespace, Oid relfilenode);
-#endif /* RELFILENODEMAP_H */
+#endif /* RELFILENODEMAP_H */
extern void relmap_desc(StringInfo buf, XLogReaderState *record);
extern const char *relmap_identify(uint8 info);
-#endif /* RELMAPPER_H */
+#endif /* RELMAPPER_H */
#define relptr_copy(rp1, rp2) \
((rp1).relptr_off = (rp2).relptr_off)
-#endif /* RELPTR_H */
+#endif /* RELPTR_H */
bool trig_delete_old_table;
} TriggerDesc;
-#endif /* RELTRIGGER_H */
+#endif /* RELTRIGGER_H */
extern void UnregisterResourceReleaseCallback(ResourceReleaseCallback callback,
void *arg);
-#endif /* RESOWNER_H */
+#endif /* RESOWNER_H */
extern void ResourceOwnerForgetDSM(ResourceOwner owner,
dsm_segment *);
-#endif /* RESOWNER_PRIVATE_H */
+#endif /* RESOWNER_PRIVATE_H */
extern int check_enable_rls(Oid relid, Oid checkAsUser, bool noError);
-#endif /* RLS_H */
+#endif /* RLS_H */
Bitmapset *rels_used);
extern char *generate_collation_name(Oid collid);
-#endif /* RULEUTILS_H */
+#endif /* RULEUTILS_H */
int n; /* desired sample size */
BlockNumber t; /* current block number */
int m; /* blocks selected so far */
- SamplerRandomState randstate; /* random generator state */
+ SamplerRandomState randstate; /* random generator state */
} BlockSamplerData;
typedef BlockSamplerData *BlockSampler;
typedef struct
{
double W;
- SamplerRandomState randstate; /* random generator state */
+ SamplerRandomState randstate; /* random generator state */
} ReservoirStateData;
typedef ReservoirStateData *ReservoirState;
extern double anl_init_selection_state(int n);
extern double anl_get_next_S(double t, int n, double *stateptr);
-#endif /* SAMPLING_H */
+#endif /* SAMPLING_H */
typedef struct
{
/* These are the values the cost estimator must return to the planner */
- Cost indexStartupCost; /* index-related startup cost */
+ Cost indexStartupCost; /* index-related startup cost */
Cost indexTotalCost; /* total index-related scan cost */
- Selectivity indexSelectivity; /* selectivity of index */
- double indexCorrelation; /* order correlation of index */
+ Selectivity indexSelectivity; /* selectivity of index */
+ double indexCorrelation; /* order correlation of index */
/* Intermediate values we obtain along the way */
double numIndexPages; /* number of leaf pages visited */
Oid elemtype, bool isEquality, bool useOr,
int varRelid);
-#endif /* SELFUNCS_H */
+#endif /* SELFUNCS_H */
extern Snapshot RestoreSnapshot(char *start_address);
extern void RestoreTransactionSnapshot(Snapshot snapshot, void *master_pgproc);
-#endif /* SNAPMGR_H */
+#endif /* SNAPMGR_H */
HeapTupleWouldBlock /* can be returned by heap_tuple_lock */
} HTSU_Result;
-#endif /* SNAPSHOT_H */
+#endif /* SNAPSHOT_H */
* sort support functions.
*/
bool ssup_reverse; /* descending-order sort? */
- bool ssup_nulls_first; /* sort nulls first? */
+ bool ssup_nulls_first; /* sort nulls first? */
/*
* These fields are workspace for callers, and should not be touched by
extern void PrepareSortSupportFromIndexRel(Relation indexRel, int16 strategy,
SortSupport ssup);
-#endif /* SORTSUPPORT_H */
+#endif /* SORTSUPPORT_H */
float8 *spc_seq_page_cost);
int get_tablespace_io_concurrency(Oid spcid);
-#endif /* SPCCACHE_H */
+#endif /* SPCCACHE_H */
#define ReleaseSysCacheList(x) ReleaseCatCacheList(x)
-#endif /* SYSCACHE_H */
+#endif /* SYSCACHE_H */
extern TimestampTz get_timeout_start_time(TimeoutId id);
extern TimestampTz get_timeout_finish_time(TimeoutId id);
-#endif /* TIMEOUT_H */
+#endif /* TIMEOUT_H */
extern int date2isoyear(int year, int mon, int mday);
extern int date2isoyearday(int year, int mon, int mday);
-#endif /* TIMESTAMP_H */
+#endif /* TIMESTAMP_H */
HEAPTUPLE_DEAD, /* tuple is dead and deletable */
HEAPTUPLE_LIVE, /* tuple is live (committed, no deleter) */
HEAPTUPLE_RECENTLY_DEAD, /* tuple is dead, but not deletable yet */
- HEAPTUPLE_INSERT_IN_PROGRESS, /* inserting xact is still in progress */
+ HEAPTUPLE_INSERT_IN_PROGRESS, /* inserting xact is still in progress */
HEAPTUPLE_DELETE_IN_PROGRESS /* deleting xact is still in progress */
} HTSV_Result;
(snapshotdata).lsn = (l), \
(snapshotdata).whenTaken = (w))
-#endif /* TQUAL_H */
+#endif /* TQUAL_H */
extern void tuplesort_markpos(Tuplesortstate *state);
extern void tuplesort_restorepos(Tuplesortstate *state);
-#endif /* TUPLESORT_H */
+#endif /* TUPLESORT_H */
extern void tuplestore_end(Tuplestorestate *state);
-#endif /* TUPLESTORE_H */
+#endif /* TUPLESTORE_H */
*/
struct TypeCacheEntry *rngelemtype; /* range's element type */
Oid rng_collation; /* collation for comparisons, if any */
- FmgrInfo rng_cmp_proc_finfo; /* comparison function */
+ FmgrInfo rng_cmp_proc_finfo; /* comparison function */
FmgrInfo rng_canonical_finfo; /* canonicalization function, if any */
- FmgrInfo rng_subdiff_finfo; /* difference function, if any */
+ FmgrInfo rng_subdiff_finfo; /* difference function, if any */
/*
* Domain constraint data if it's a domain type. NULL if not domain, or
/* Management data --- treat these fields as private to typcache.c */
DomainConstraintCache *dcc; /* current constraints, or NULL if none */
- MemoryContextCallback callback; /* used to release refcount when done */
+ MemoryContextCallback callback; /* used to release refcount when done */
} DomainConstraintRef;
extern int compare_values_of_enum(TypeCacheEntry *tcache, Oid arg1, Oid arg2);
-#endif /* TYPCACHE_H */
+#endif /* TYPCACHE_H */
extern TimeZoneAbbrevTable *load_tzoffsets(const char *filename);
-#endif /* TZPARSER_H */
+#endif /* TZPARSER_H */
#define DatumGetUUIDP(X) ((pg_uuid_t *) DatumGetPointer(X))
#define PG_GETARG_UUID_P(X) DatumGetUUIDP(PG_GETARG_DATUM(X))
-#endif /* UUID_H */
+#endif /* UUID_H */
{
PG_XML_STRICTNESS_LEGACY, /* ignore errors unless function result
* indicates error condition */
- PG_XML_STRICTNESS_WELLFORMED, /* ignore non-parser messages */
+ PG_XML_STRICTNESS_WELLFORMED, /* ignore non-parser messages */
PG_XML_STRICTNESS_ALL /* report all notices/warnings/errors */
} PgXmlStrictness;
extern const TableFuncRoutine XmlTableRoutine;
-#endif /* XML_H */
+#endif /* XML_H */
extern Datum WinGetFuncArgCurrent(WindowObject winobj, int argno,
bool *isnull);
-#endif /* WINDOWAPI_H */
+#endif /* WINDOWAPI_H */
case ECPGt_unsigned_long_long:
*((long long int *) (ind + ind_offset * act_tuple)) = value_for_indicator;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
case ECPGt_NO_INDICATOR:
if (value_for_indicator == -1)
{
case ECPGt_unsigned_long_long:
*((long long int *) (ind + ind_offset * act_tuple)) = size;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
default:
break;
}
pval = scan_length;
break;
-#endif /* HAVE_STRTOLL */
+#endif /* HAVE_STRTOLL */
#ifdef HAVE_STRTOULL
case ECPGt_unsigned_long_long:
*((unsigned long long int *) (var + offset * act_tuple)) = strtoull(pval, &scan_length, 10);
pval = scan_length;
break;
-#endif /* HAVE_STRTOULL */
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_STRTOULL */
+#endif /* HAVE_LONG_LONG_INT */
case ECPGt_float:
case ECPGt_double:
case ECPGt_unsigned_long_long:
*((long long int *) (ind + ind_offset * act_tuple)) = size;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
default:
break;
}
case ECPGt_unsigned_long_long:
*((long long int *) (ind + ind_offset * act_tuple)) = variable->len;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
default:
break;
}
case ECPGt_unsigned_long_long:
*(unsigned long long int *) var = (unsigned long long int) value;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
case ECPGt_float:
*(float *) var = (float) value;
break;
case ECPGt_unsigned_long_long:
*target = *(const unsigned long long int *) var;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
case ECPGt_float:
*target = *(const float *) var;
break;
list = next;
}
}
-#endif /* ENABLE_THREAD_SAFETY */
+#endif /* ENABLE_THREAD_SAFETY */
bool
ECPGallocate_desc(int line, const char *name)
/* rest of variable parameters */
ptr = va_arg(args, void *);
- (void) va_arg(args, long); /* skip args */
+ (void) va_arg(args, long); /* skip args */
(void) va_arg(args, long);
(void) va_arg(args, long);
/* special mode for handling char**foo=0 */
for (act_tuple = 0; act_tuple < ntuples; act_tuple++)
len += strlen(PQgetvalue(results, act_tuple, act_field)) + 1;
- len *= var->offset; /* should be 1, but YMNK */
+ len *= var->offset; /* should be 1, but YMNK */
len += (ntuples + 1) * sizeof(char *);
}
else
if (*(long long int *) var->ind_value < (long long) 0)
*tobeinserted_p = NULL;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
case ECPGt_NO_INDICATOR:
if (force_indicator == false)
{
*tobeinserted_p = mallocedval;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
case ECPGt_float:
if (!(mallocedval = ecpg_alloc(asize * 25, lineno)))
return false;
if (stmt->command[position] == '?')
{
/* yes, replace with new style */
- int buffersize = sizeof(int) * CHAR_BIT * 10 / 3; /* a rough guess of the
- * size we need */
+ int buffersize = sizeof(int) * CHAR_BIT * 10 / 3; /* a rough guess of the
+ * size we need */
if (!(tobeinserted = (char *) ecpg_alloc(buffersize, stmt->lineno)))
{
#define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR "YE000"
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY "YE001"
-#endif /* _ECPG_LIB_EXTERN_H */
+#endif /* _ECPG_LIB_EXTERN_H */
#define LONG_LONG_MIN LLONG_MIN
#else
#define LONG_LONG_MIN LONGLONG_MIN
-#endif /* LLONG_MIN */
-#endif /* LONG_LONG_MIN */
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* LLONG_MIN */
+#endif /* LONG_LONG_MIN */
+#endif /* HAVE_LONG_LONG_INT */
bool ecpg_internal_regression_mode = false;
case ECPGt_unsigned_long_long:
*((long long *) ptr) = LONG_LONG_MIN;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
case ECPGt_float:
memset((char *) ptr, 0xff, sizeof(float));
break;
if (*((long long *) ptr) == LONG_LONG_MIN)
return true;
break;
-#endif /* HAVE_LONG_LONG_INT */
+#endif /* HAVE_LONG_LONG_INT */
case ECPGt_float:
return (_check(ptr, sizeof(float)));
break;
pthread_mutex_unlock(&win32_pthread_once_lock);
}
}
-#endif /* ENABLE_THREAD_SAFETY */
-#endif /* WIN32 */
+#endif /* ENABLE_THREAD_SAFETY */
+#endif /* WIN32 */
#ifdef ENABLE_NLS
return dgettext(PG_TEXTDOMAIN("ecpglib"), msgid);
}
-#endif /* ENABLE_NLS */
+#endif /* ENABLE_NLS */
struct var_list *ivlist = NULL;
#define JSONBOID 3802
#define INT4RANGEOID 3904
-#endif /* PG_TYPE_H */
+#endif /* PG_TYPE_H */
} stmtCacheEntry;
static int nextStmtID = 1;
-static const int stmtCacheNBuckets = 2039; /* # buckets - a prime # */
-static const int stmtCacheEntPerBucket = 8; /* # entries/bucket */
+static const int stmtCacheNBuckets = 2039; /* # buckets - a prime # */
+static const int stmtCacheEntPerBucket = 8; /* # entries/bucket */
static stmtCacheEntry stmtCacheEntries[16384] = {{0, {0}, 0, 0, 0}};
static bool deallocate_one(int lineno, enum COMPAT_MODE c, struct connection *con,
* OR negative error code
*/
static int
-ecpg_freeStmtCacheEntry(int lineno, int compat, int entNo) /* entry # to free */
+ecpg_freeStmtCacheEntry(int lineno, int compat, int entNo) /* entry # to free */
{
stmtCacheEntry *entry;
struct connection *con;
*/
static int
AddStmtToCache(int lineno, /* line # of statement */
- const char *stmtID, /* statement ID */
+ const char *stmtID, /* statement ID */
const char *connection, /* connection */
int compat, /* compatibility level */
const char *ecpgQuery) /* query */
case BOOLOID:
return SQL3_BOOLEAN; /* bool */
case INT2OID:
- return SQL3_SMALLINT; /* int2 */
+ return SQL3_SMALLINT; /* int2 */
case INT4OID:
return SQL3_INTEGER; /* int4 */
case TEXTOID:
- return SQL3_CHARACTER; /* text */
+ return SQL3_CHARACTER; /* text */
case FLOAT4OID:
return SQL3_REAL; /* float4 */
case FLOAT8OID:
- return SQL3_DOUBLE_PRECISION; /* float8 */
+ return SQL3_DOUBLE_PRECISION; /* float8 */
case BPCHAROID:
- return SQL3_CHARACTER; /* bpchar */
+ return SQL3_CHARACTER; /* bpchar */
case VARCHAROID:
- return SQL3_CHARACTER_VARYING; /* varchar */
+ return SQL3_CHARACTER_VARYING; /* varchar */
case DATEOID:
return SQL3_DATE_TIME_TIMESTAMP; /* date */
case TIMEOID:
#ifndef _ECPGLIB_H
typedef timestamp dtime_t;
typedef interval intrvl_t;
-#endif /* ndef _ECPGLIB_H */
+#endif /* ndef _ECPGLIB_H */
-#endif /* ndef _ECPG_DATETIME_H */
+#endif /* ndef _ECPG_DATETIME_H */
/* source created by ecpg which defines this */
#ifndef _ECPGLIB_H
typedef decimal dec_t;
-#endif /* ndef _ECPGLIB_H */
+#endif /* ndef _ECPGLIB_H */
-#endif /* ndef _ECPG_DECIMAL_H */
+#endif /* ndef _ECPG_DECIMAL_H */
if (!*(once)) \
win32_pthread_once((once), (fn)); \
} while(0)
-#endif /* WIN32 */
-#endif /* ENABLE_THREAD_SAFETY */
+#endif /* WIN32 */
+#endif /* ENABLE_THREAD_SAFETY */
-#endif /* _ECPG_PTHREAD_WIN32_H */
+#endif /* _ECPG_PTHREAD_WIN32_H */
}
#endif
-#endif /* ndef _ECPG_INFORMIX_H */
+#endif /* ndef _ECPG_INFORMIX_H */
/* WARNING: BlankPortalAssignName: portal * already exists */
#define ECPG_WARNING_PORTAL_EXISTS -605
-#endif /* !_ECPG_ERRNO_H */
+#endif /* !_ECPG_ERRNO_H */
#ifndef __cplusplus
#ifndef bool
#define bool char
-#endif /* ndef bool */
+#endif /* ndef bool */
#ifndef true
#define true ((bool) 1)
-#endif /* ndef true */
+#endif /* ndef true */
#ifndef false
#define false ((bool) 0)
-#endif /* ndef false */
-#endif /* not C++ */
+#endif /* ndef false */
+#endif /* not C++ */
#ifndef TRUE
#define TRUE 1
-#endif /* TRUE */
+#endif /* TRUE */
#ifndef FALSE
#define FALSE 0
-#endif /* FALSE */
+#endif /* FALSE */
#ifdef __cplusplus
extern "C"
}
#endif
-#endif /* _ECPGLIB_H */
+#endif /* _ECPGLIB_H */
}
#endif
-#endif /* _ECPGTYPE_H */
+#endif /* _ECPGTYPE_H */
}
#endif
-#endif /* PGTYPES_DATETIME */
+#endif /* PGTYPES_DATETIME */
#endif
#define HAVE_INT64_TIMESTAMP
-#endif /* C_H */
+#endif /* C_H */
typedef struct
{
}
#endif
-#endif /* PGTYPES_INTERVAL */
+#endif /* PGTYPES_INTERVAL */
int rscale; /* result scale */
int dscale; /* display scale */
int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- NumericDigit digits[DECSIZE]; /* decimal digits */
+ NumericDigit digits[DECSIZE]; /* decimal digits */
} decimal;
#ifdef __cplusplus
}
#endif
-#endif /* PGTYPES_NUMERIC */
+#endif /* PGTYPES_NUMERIC */
}
#endif
-#endif /* PGTYPES_TIMESTAMP */
+#endif /* PGTYPES_TIMESTAMP */
* standard) */
};
-#endif /* !_ECPG_SQL3TYPES_H */
+#endif /* !_ECPG_SQL3TYPES_H */
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
struct sqlvar_compat *sqlvar;
char desc_name[19]; /* descriptor name */
short desc_occ; /* size of sqlda structure */
- struct sqlda_compat *desc_next; /* pointer to next sqlda struct */
+ struct sqlda_compat *desc_next; /* pointer to next sqlda struct */
void *reserved; /* reserved for future use */
};
-#endif /* ECPG_SQLDA_COMPAT_H */
+#endif /* ECPG_SQLDA_COMPAT_H */
struct sqlvar_struct sqlvar[1];
};
-#endif /* ECPG_SQLDA_NATIVE_H */
+#endif /* ECPG_SQLDA_NATIVE_H */
#endif
-#endif /* ECPG_SQLDA_H */
+#endif /* ECPG_SQLDA_H */
#define SQLSERIAL8 ECPGt_long
#endif
-#endif /* ndef ECPG_SQLTYPES_H */
+#endif /* ndef ECPG_SQLTYPES_H */
return;
}
-#define PGTYPES_DATE_NUM_MAX_DIGITS 20 /* should suffice for most
- * years... */
+#define PGTYPES_DATE_NUM_MAX_DIGITS 20 /* should suffice for most
+ * years... */
#define PGTYPES_FMTDATE_DAY_DIGITS_LZ 1 /* LZ means "leading zeroes" */
#define PGTYPES_FMTDATE_DOW_LITERAL_SHORT 2
extern char *days[];
extern int day_tab[2][13];
-#endif /* DT_H */
+#endif /* DT_H */
{"ahst", TZ, -36000}, /* Alaska-Hawaii Std Time */
{"akdt", DTZ, -28800}, /* Alaska Daylight Time */
{"akst", DTZ, -32400}, /* Alaska Standard Time */
- {"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */
+ {"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */
{"almst", TZ, 25200}, /* Almaty Savings Time */
{"almt", TZ, 21600}, /* Almaty Time */
{"am", AMPM, AM},
idt /* Israeli, Iran, Indian Daylight Time */
#endif
{LATE, RESERV, DTK_LATE}, /* "infinity" reserved for "late time" */
- {INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */
+ {INVALID, RESERV, DTK_INVALID}, /* "invalid" reserved for bad time */
{"iot", TZ, 18000}, /* Indian Chagos Time */
{"irkst", DTZ, 32400}, /* Irkutsk Summer Time */
{"irkt", TZ, 28800}, /* Irkutsk Time */
{"irt", TZ, 12600}, /* Iran Time */
- {"isodow", UNITS, DTK_ISODOW}, /* ISO day of week, Sunday == 7 */
+ {"isodow", UNITS, DTK_ISODOW}, /* ISO day of week, Sunday == 7 */
#if 0
isst
#endif
{"@", IGNORE_DTF, 0}, /* postgres relative prefix */
{DAGO, AGO, 0}, /* "ago" indicates negative time offset */
{"c", UNITS, DTK_CENTURY}, /* "century" relative */
- {"cent", UNITS, DTK_CENTURY}, /* "century" relative */
+ {"cent", UNITS, DTK_CENTURY}, /* "century" relative */
{"centuries", UNITS, DTK_CENTURY}, /* "centuries" relative */
- {DCENTURY, UNITS, DTK_CENTURY}, /* "century" relative */
+ {DCENTURY, UNITS, DTK_CENTURY}, /* "century" relative */
{"d", UNITS, DTK_DAY}, /* "day" relative */
{DDAY, UNITS, DTK_DAY}, /* "day" relative */
{"days", UNITS, DTK_DAY}, /* "days" relative */
{"dec", UNITS, DTK_DECADE}, /* "decade" relative */
- {DDECADE, UNITS, DTK_DECADE}, /* "decade" relative */
- {"decades", UNITS, DTK_DECADE}, /* "decades" relative */
+ {DDECADE, UNITS, DTK_DECADE}, /* "decade" relative */
+ {"decades", UNITS, DTK_DECADE}, /* "decades" relative */
{"decs", UNITS, DTK_DECADE}, /* "decades" relative */
{"h", UNITS, DTK_HOUR}, /* "hour" relative */
{DHOUR, UNITS, DTK_HOUR}, /* "hour" relative */
{"hours", UNITS, DTK_HOUR}, /* "hours" relative */
{"hr", UNITS, DTK_HOUR}, /* "hour" relative */
{"hrs", UNITS, DTK_HOUR}, /* "hours" relative */
- {INVALID, RESERV, DTK_INVALID}, /* reserved for invalid time */
+ {INVALID, RESERV, DTK_INVALID}, /* reserved for invalid time */
{"m", UNITS, DTK_MINUTE}, /* "minute" relative */
- {"microsecon", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
- {"mil", UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
- {"millennia", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */
- {DMILLENNIUM, UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
- {"millisecon", UNITS, DTK_MILLISEC}, /* relative */
+ {"microsecon", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
+ {"mil", UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
+ {"millennia", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */
+ {DMILLENNIUM, UNITS, DTK_MILLENNIUM}, /* "millennium" relative */
+ {"millisecon", UNITS, DTK_MILLISEC}, /* relative */
{"mils", UNITS, DTK_MILLENNIUM}, /* "millennia" relative */
{"min", UNITS, DTK_MINUTE}, /* "minute" relative */
{"mins", UNITS, DTK_MINUTE}, /* "minutes" relative */
- {DMINUTE, UNITS, DTK_MINUTE}, /* "minute" relative */
- {"minutes", UNITS, DTK_MINUTE}, /* "minutes" relative */
+ {DMINUTE, UNITS, DTK_MINUTE}, /* "minute" relative */
+ {"minutes", UNITS, DTK_MINUTE}, /* "minutes" relative */
{"mon", UNITS, DTK_MONTH}, /* "months" relative */
{"mons", UNITS, DTK_MONTH}, /* "months" relative */
{DMONTH, UNITS, DTK_MONTH}, /* "month" relative */
{"mseconds", UNITS, DTK_MILLISEC},
{"msecs", UNITS, DTK_MILLISEC},
{"qtr", UNITS, DTK_QUARTER}, /* "quarter" relative */
- {DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */
+ {DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */
{"s", UNITS, DTK_SECOND},
{"sec", UNITS, DTK_SECOND},
{DSECOND, UNITS, DTK_SECOND},
{"secs", UNITS, DTK_SECOND},
{DTIMEZONE, UNITS, DTK_TZ}, /* "timezone" time offset */
{"timezone_h", UNITS, DTK_TZ_HOUR}, /* timezone hour units */
- {"timezone_m", UNITS, DTK_TZ_MINUTE}, /* timezone minutes units */
+ {"timezone_m", UNITS, DTK_TZ_MINUTE}, /* timezone minutes units */
{"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */
{"us", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
- {"usec", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
+ {"usec", UNITS, DTK_MICROSEC}, /* "microsecond" relative */
{DMICROSEC, UNITS, DTK_MICROSEC}, /* "microsecond" relative */
{"useconds", UNITS, DTK_MICROSEC}, /* "microseconds" relative */
- {"usecs", UNITS, DTK_MICROSEC}, /* "microseconds" relative */
+ {"usecs", UNITS, DTK_MICROSEC}, /* "microseconds" relative */
{"w", UNITS, DTK_WEEK}, /* "week" relative */
{DWEEK, UNITS, DTK_WEEK}, /* "week" relative */
{"weeks", UNITS, DTK_WEEK}, /* "weeks" relative */
#define PGTYPES_TYPE_STRING_MALLOCED 1
#define PGTYPES_TYPE_STRING_CONSTANT 2
#define PGTYPES_TYPE_CHAR 3
-#define PGTYPES_TYPE_DOUBLE_NF 4 /* no fractional part */
+#define PGTYPES_TYPE_DOUBLE_NF 4 /* no fractional part */
#define PGTYPES_TYPE_INT64 5
#define PGTYPES_TYPE_UINT 6
-#define PGTYPES_TYPE_UINT_2_LZ 7 /* 2 digits, pad with leading
- * zero */
-#define PGTYPES_TYPE_UINT_2_LS 8 /* 2 digits, pad with leading
- * space */
+#define PGTYPES_TYPE_UINT_2_LZ 7 /* 2 digits, pad with leading zero */
+#define PGTYPES_TYPE_UINT_2_LS 8 /* 2 digits, pad with leading
+ * space */
#define PGTYPES_TYPE_UINT_3_LZ 9
#define PGTYPES_TYPE_UINT_4_LZ 10
#define PGTYPES_TYPE_UINT_LONG 11
#ifndef bool
#define bool char
-#endif /* ndef bool */
+#endif /* ndef bool */
#ifndef FALSE
#define FALSE 0
-#endif /* FALSE */
+#endif /* FALSE */
#ifndef TRUE
#define TRUE 1
-#endif /* TRUE */
+#endif /* TRUE */
-#endif /* __PGTYPES_COMMON_H__ */
+#endif /* __PGTYPES_COMMON_H__ */
* * Assert wasn't available so removed it.
*/
int
-DecodeInterval(char **field, int *ftype, int nf, /* int range, */
+DecodeInterval(char **field, int *ftype, int nf, /* int range, */
int *dtype, struct /* pg_ */ tm *tm, fsec_t *fsec)
{
int IntervalStyle = INTSTYLE_POSTGRES_VERBOSE;
tm->tm_gmtoff = tx->tm_gmtoff;
tm->tm_zone = tx->tm_zone;
- *tzp = -tm->tm_gmtoff; /* tm_gmtoff is Sun/DEC-ism */
+ *tzp = -tm->tm_gmtoff; /* tm_gmtoff is Sun/DEC-ism */
if (tzn != NULL)
*tzn = tm->tm_zone;
#elif defined(HAVE_INT_TIMEZONE)
#define INFORMIX_MODE (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE)
-#endif /* _ECPG_PREPROC_EXTERN_H */
+#endif /* _ECPG_PREPROC_EXTERN_H */
j++;
} while (str[j] == ' ' || str[j] == '\t');
- if ((str[j] != '\n') && (str[j] != '\r' || str[j + 1] != '\n')) /* not followed by a
- * newline */
+ if ((str[j] != '\n') && (str[j] != '\r' || str[j + 1] != '\n')) /* not followed by a
+ * newline */
fputs("\\\\", base_yyout);
}
else if (str[i] == '\r' && str[i + 1] == '\n')
case ECPGt_NO_INDICATOR: /* no indicator */
return ("ECPGt_NO_INDICATOR");
break;
- case ECPGt_char_variable: /* string that should not be quoted */
+ case ECPGt_char_variable: /* string that should not be quoted */
return ("ECPGt_char_variable");
break;
case ECPGt_const: /* constant string quoted */
* string */
union
{
- struct ECPGtype *element; /* For an array this is the type of
- * the element */
- struct ECPGstruct_member *members; /* A pointer to a list of
- * members. */
+ struct ECPGtype *element; /* For an array this is the type of the
+ * element */
+ struct ECPGstruct_member *members; /* A pointer to a list of members. */
} u;
int counter;
};
char *name;
};
-#endif /* _ECPG_PREPROC_TYPE_H */
+#endif /* _ECPG_PREPROC_TYPE_H */
#endif
-#endif /* ECPG_SQLDA_H */
+#endif /* ECPG_SQLDA_H */
#line 5 "describe.pgc"
#endif
-#endif /* ECPG_SQLDA_H */
+#endif /* ECPG_SQLDA_H */
#line 7 "sqlda.pgc"
#define SQLSERIAL8 ECPGt_long
#endif
-#endif /* ndef ECPG_SQLTYPES_H */
+#endif /* ndef ECPG_SQLTYPES_H */
#line 8 "sqlda.pgc"
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
int rscale; /* result scale */
int dscale; /* display scale */
int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- NumericDigit digits[DECSIZE]; /* decimal digits */
+ NumericDigit digits[DECSIZE]; /* decimal digits */
} decimal;
#ifdef __cplusplus
}
#endif
-#endif /* PGTYPES_NUMERIC */
+#endif /* PGTYPES_NUMERIC */
#line 8 "outofscope.pgc"
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#endif
-#endif /* ECPG_SQLDA_H */
+#endif /* ECPG_SQLDA_H */
#line 5 "describe.pgc"
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
* standard) */
};
-#endif /* !_ECPG_SQL3TYPES_H */
+#endif /* !_ECPG_SQL3TYPES_H */
#line 7 "dyntest.pgc"
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#endif
-#endif /* ECPG_SQLDA_H */
+#endif /* ECPG_SQLDA_H */
#line 7 "sqlda.pgc"
int rscale; /* result scale */
int dscale; /* display scale */
int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- NumericDigit digits[DECSIZE]; /* decimal digits */
+ NumericDigit digits[DECSIZE]; /* decimal digits */
} decimal;
#ifdef __cplusplus
}
#endif
-#endif /* PGTYPES_NUMERIC */
+#endif /* PGTYPES_NUMERIC */
#line 8 "sqlda.pgc"
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
#define PGDLLIMPORT __declspec (dllimport)
#else
#define PGDLLIMPORT
-#endif /* __CYGWIN__ */
-#endif /* PGDLLIMPORT */
+#endif /* __CYGWIN__ */
+#endif /* PGDLLIMPORT */
#define SQLERRMC_LEN 150
return pg_GSS_continue(conn, payloadlen);
}
-#endif /* ENABLE_GSS */
+#endif /* ENABLE_GSS */
#ifdef ENABLE_SSPI
return pg_SSPI_continue(conn, payloadlen);
}
-#endif /* ENABLE_SSPI */
+#endif /* ENABLE_SSPI */
/*
* Initialize SASL authentication exchange.
printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("GSSAPI authentication not supported\n"));
return STATUS_ERROR;
-#endif /* defined(ENABLE_GSS) || defined(ENABLE_SSPI) */
+#endif /* defined(ENABLE_GSS) || defined(ENABLE_SSPI) */
#ifdef ENABLE_SSPI
case AUTH_REQ_SSPI:
printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("SSPI authentication not supported\n"));
return STATUS_ERROR;
-#endif /* !define(ENABLE_GSSAPI) */
-#endif /* ENABLE_SSPI */
+#endif /* !define(ENABLE_GSSAPI) */
+#endif /* ENABLE_SSPI */
case AUTH_REQ_CRYPT:
bool *done, bool *success, PQExpBuffer errorMessage);
extern char *pg_fe_scram_build_verifier(const char *password);
-#endif /* FE_AUTH_H */
+#endif /* FE_AUTH_H */
offsetof(struct pg_conn, pgpassfile)},
{"connect_timeout", "PGCONNECT_TIMEOUT", NULL, NULL,
- "Connect-timeout", "", 10, /* strlen(INT32_MAX) == 10 */
+ "Connect-timeout", "", 10, /* strlen(INT32_MAX) == 10 */
offsetof(struct pg_conn, connect_timeout)},
{"dbname", "PGDATABASE", NULL, NULL,
offsetof(struct pg_conn, keepalives_idle)},
{"keepalives_interval", NULL, NULL, NULL,
- "TCP-Keepalives-Interval", "", 10, /* strlen(INT32_MAX) == 10 */
+ "TCP-Keepalives-Interval", "", 10, /* strlen(INT32_MAX) == 10 */
offsetof(struct pg_conn, keepalives_interval)},
{"keepalives_count", NULL, NULL, NULL,
service);
}
else
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
{
char host_addr[NI_MAXHOST];
const char *displayed_host;
}
return 1;
}
-#endif /* SIO_KEEPALIVE_VALS */
-#endif /* WIN32 */
+#endif /* SIO_KEEPALIVE_VALS */
+#endif /* WIN32 */
/* ----------
* connectDBStart -
conn->addr_cur = addr_cur->ai_next;
continue;
}
-#endif /* F_SETFD */
+#endif /* F_SETFD */
if (!IS_AF_UNIX(addr_cur->ai_family))
{
#ifdef SIO_KEEPALIVE_VALS
else if (!setKeepalivesWin32(conn))
err = 1;
-#endif /* SIO_KEEPALIVE_VALS */
-#endif /* WIN32 */
+#endif /* SIO_KEEPALIVE_VALS */
+#endif /* WIN32 */
if (err)
{
conn->sigpipe_flag = true;
#else
conn->sigpipe_flag = false;
-#endif /* MSG_NOSIGNAL */
+#endif /* MSG_NOSIGNAL */
#ifdef SO_NOSIGPIPE
optval = 1;
conn->sigpipe_so = true;
conn->sigpipe_flag = false;
}
-#endif /* SO_NOSIGPIPE */
+#endif /* SO_NOSIGPIPE */
/*
* Start/make connection. This should not block, since we
goto error_return;
}
}
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
#ifdef USE_SSL
conn->status = CONNECTION_SSL_STARTUP;
return PGRES_POLLING_READING;
}
-#endif /* USE_SSL */
+#endif /* USE_SSL */
/*
* Build the startup packet.
#else /* !USE_SSL */
/* can't get here */
goto error_return;
-#endif /* USE_SSL */
+#endif /* USE_SSL */
}
/*
case PGRES_POLLING_OK: /* Success */
break;
- case PGRES_POLLING_READING: /* Still going */
+ case PGRES_POLLING_READING: /* Still going */
conn->status = CONNECTION_SETENV;
return PGRES_POLLING_READING;
- case PGRES_POLLING_WRITING: /* Still going */
+ case PGRES_POLLING_WRITING: /* Still going */
conn->status = CONNECTION_SETENV;
return PGRES_POLLING_WRITING;
* Close the connection, reset all transient state, flush I/O buffers.
*/
pqDropConnection(conn, true);
- conn->status = CONNECTION_BAD; /* Well, not really _bad_ - just
- * absent */
+ conn->status = CONNECTION_BAD; /* Well, not really _bad_ - just absent */
conn->asyncStatus = PGASYNC_IDLE;
pqClearAsyncResult(conn); /* deallocate result */
resetPQExpBuffer(&conn->errorMessage);
ldap_unbind(ld);
return 3;
}
-#endif /* WIN32 */
+#endif /* WIN32 */
/* search */
res = NULL;
return 0;
}
-#endif /* USE_LDAP */
+#endif /* USE_LDAP */
#define MAXBUFSIZE 256
if (prevchar == ':')
{
- const char *port = ++p; /* advance past host terminator */
+ const char *port = ++p; /* advance past host terminator */
while (*p && *p != '/' && *p != '?' && *p != ',')
++p;
if (prevchar && prevchar != '?')
{
- const char *dbname = ++p; /* advance past host terminator */
+ const char *dbname = ++p; /* advance past host terminator */
/* Look for query parameters */
while (*p && *p != '?')
*/
#define PGRESULT_DATA_BLOCKSIZE 2048
-#define PGRESULT_ALIGN_BOUNDARY MAXIMUM_ALIGNOF /* from configure */
+#define PGRESULT_ALIGN_BOUNDARY MAXIMUM_ALIGNOF /* from configure */
#define PGRESULT_BLOCK_OVERHEAD Max(sizeof(PGresult_data), PGRESULT_ALIGN_BOUNDARY)
#define PGRESULT_SEP_ALLOC_THRESHOLD (PGRESULT_DATA_BLOCKSIZE / 2)
while (*p && *p != ' ')
p++;
if (*p == 0)
- goto interpret_error; /* no space? */
+ goto interpret_error; /* no space? */
p++;
}
else if (strncmp(res->cmdStatus, "SELECT ", 7) == 0 ||
definitelyFailed:
/* Do *not* drop any already-read data; caller still wants it */
pqDropConnection(conn, false);
- conn->status = CONNECTION_BAD; /* No more connection to backend */
+ conn->status = CONNECTION_BAD; /* No more connection to backend */
return -1;
}
return select(sock + 1, &input_mask, &output_mask,
&except_mask, ptr_timeout);
-#endif /* HAVE_POLL */
+#endif /* HAVE_POLL */
}
return dngettext(PG_TEXTDOMAIN("libpq"), msgid, msgid_plural, n);
}
-#endif /* ENABLE_NLS */
+#endif /* ENABLE_NLS */
(1 + (po->standard != 0)) >= screen_size.ws_row -
(po->header != 0) *
(total_line_length / screen_size.ws_col + 1) * 2
- - (po->header != 0) * 2 /* row count and newline */
+ - (po->header != 0) * 2 /* row count and newline */
)))
{
fout = popen(pagerenv, "w");
sigpipe_masked = true;
#else
oldsigpipehandler = pqsignal(SIGPIPE, SIG_IGN);
-#endif /* ENABLE_THREAD_SAFETY */
-#endif /* WIN32 */
+#endif /* ENABLE_THREAD_SAFETY */
+#endif /* WIN32 */
}
else
fout = stdout;
pq_reset_sigpipe(&osigset, sigpipe_pending, true);
#else
pqsignal(SIGPIPE, oldsigpipehandler);
-#endif /* ENABLE_THREAD_SAFETY */
-#endif /* WIN32 */
+#endif /* ENABLE_THREAD_SAFETY */
+#endif /* WIN32 */
}
if (po->html3 && !po->expanded)
fputs("\n", fout);
* However, if we see one of these tags then we know for sure the server
* is in abort state ...
*/
- else if (strcmp(cmdTag, "*ABORT STATE*") == 0) /* pre-7.3 only */
+ else if (strcmp(cmdTag, "*ABORT STATE*") == 0) /* pre-7.3 only */
conn->xactStatus = PQTRANS_INERROR;
}
conn))
continue;
}
- if (pqGetc(&id, conn)) /* get the last '0' */
+ if (pqGetc(&id, conn)) /* get the last '0' */
continue;
}
if (id == '0')
conn->asyncStatus = PGASYNC_READY; /* drop out of GetResult wait loop */
/* flush input data since we're giving up on processing it */
pqDropConnection(conn, true);
- conn->status = CONNECTION_BAD; /* No more connection to backend */
+ conn->status = CONNECTION_BAD; /* No more connection to backend */
}
/*
return -2;
}
memcpy(*buffer, &conn->inBuffer[conn->inCursor], msgLength);
- (*buffer)[msgLength] = '\0'; /* Add terminating null */
+ (*buffer)[msgLength] = '\0'; /* Add terminating null */
/* Mark message consumed */
conn->inStart = conn->inCursor + msgLength;
if (pqPutMsgStart('F', false, conn) < 0 || /* function call msg */
pqPutInt(fnid, 4, conn) < 0 || /* function id */
- pqPutInt(1, 2, conn) < 0 || /* # of format codes */
- pqPutInt(1, 2, conn) < 0 || /* format code: BINARY */
+ pqPutInt(1, 2, conn) < 0 || /* # of format codes */
+ pqPutInt(1, 2, conn) < 0 || /* format code: BINARY */
pqPutInt(nargs, 2, conn) < 0) /* # of args */
{
pqHandleSendFailure(conn);
}
}
- if (pqPutInt(1, 2, conn) < 0) /* result format code: BINARY */
+ if (pqPutInt(1, 2, conn) < 0) /* result format code: BINARY */
{
pqHandleSendFailure(conn);
return NULL;
static pthread_mutex_t ssl_config_mutex = NULL;
static long win32_ssl_create_mutex = 0;
#endif
-#endif /* ENABLE_THREAD_SAFETY */
+#endif /* ENABLE_THREAD_SAFETY */
/* ------------------------------------------------------------ */
PGTHREAD_ERROR("failed to unlock mutex");
}
}
-#endif /* ENABLE_THREAD_SAFETY && HAVE_CRYPTO_LOCK */
+#endif /* ENABLE_THREAD_SAFETY && HAVE_CRYPTO_LOCK */
/*
* Initialize SSL library.
CRYPTO_set_locking_callback(pq_lockingcallback);
}
}
-#endif /* HAVE_CRYPTO_LOCK */
-#endif /* ENABLE_THREAD_SAFETY */
+#endif /* HAVE_CRYPTO_LOCK */
+#endif /* ENABLE_THREAD_SAFETY */
if (!ssl_lib_initialized)
{
/* cannot return NULL because we already checked before strdup */
engine_colon = strchr(engine_str, ':');
- *engine_colon = '\0'; /* engine_str now has engine name */
+ *engine_colon = '\0'; /* engine_str now has engine name */
engine_colon++; /* engine_colon now has key name */
conn->engine = ENGINE_by_id(engine_str);
* file */
}
else
-#endif /* USE_SSL_ENGINE */
+#endif /* USE_SSL_ENGINE */
{
/* PGSSLKEY is not an engine, treat it as a filename */
strlcpy(fnbuf, conn->sslkey, sizeof(fnbuf));
if (!SIGPIPE_MASKED(conn)) \
pqsignal(SIGPIPE, spinfo); \
} while (0)
-#endif /* ENABLE_THREAD_SAFETY */
+#endif /* ENABLE_THREAD_SAFETY */
#else /* WIN32 */
#define DECLARE_SIGPIPE_INFO(spinfo)
#define DISABLE_SIGPIPE(conn, spinfo, failaction)
#define REMEMBER_EPIPE(spinfo, cond)
#define RESTORE_SIGPIPE(conn, spinfo)
-#endif /* WIN32 */
+#endif /* WIN32 */
/* ------------------------------------------------------------ */
/* Procedures common to all secure sessions */
flags |= MSG_NOSIGNAL;
retry_masked:
-#endif /* MSG_NOSIGNAL */
+#endif /* MSG_NOSIGNAL */
DISABLE_SIGPIPE(conn, spinfo, return -1);
flags = 0;
goto retry_masked;
}
-#endif /* MSG_NOSIGNAL */
+#endif /* MSG_NOSIGNAL */
/* Set error message if appropriate */
switch (result_errno)
return result;
}
-#endif /* USE_SSL */
+#endif /* USE_SSL */
#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
SOCK_ERRNO_SET(save_errno);
}
-#endif /* ENABLE_THREAD_SAFETY && !WIN32 */
+#endif /* ENABLE_THREAD_SAFETY && !WIN32 */
}
#endif
-#endif /* LIBPQ_EVENTS_H */
+#endif /* LIBPQ_EVENTS_H */
*/
CONNECTION_STARTED, /* Waiting for connection to be made. */
CONNECTION_MADE, /* Connection OK; waiting to send. */
- CONNECTION_AWAITING_RESPONSE, /* Waiting for a response from the
- * postmaster. */
+ CONNECTION_AWAITING_RESPONSE, /* Waiting for a response from the
+ * postmaster. */
CONNECTION_AUTH_OK, /* Received authentication; waiting for
* backend startup. */
CONNECTION_SETENV, /* Negotiating environment. */
}
#endif
-#endif /* LIBPQ_FE_H */
+#endif /* LIBPQ_FE_H */
int length;
} gss_buffer_desc;
#endif
-#endif /* ENABLE_SSPI */
+#endif /* ENABLE_SSPI */
#ifdef USE_OPENSSL
#include
#ifndef OPENSSL_NO_ENGINE
#define USE_SSL_ENGINE
#endif
-#endif /* USE_OPENSSL */
+#endif /* USE_OPENSSL */
/*
* POSTGRES backend dependent Constants.
{
struct pgMessageField *next; /* list link */
char code; /* field code */
- char contents[FLEXIBLE_ARRAY_MEMBER]; /* value, nul-terminated */
+ char contents[FLEXIBLE_ARRAY_MEMBER]; /* value, nul-terminated */
} PGMessageField;
/* Fields needed for notice handling */
{
PQnoticeReceiver noticeRec; /* notice message receiver */
void *noticeRecArg;
- PQnoticeProcessor noticeProc; /* notice message processor */
+ PQnoticeProcessor noticeProc; /* notice message processor */
void *noticeProcArg;
} PGNoticeHooks;
char *name; /* used only for error messages */
void *passThrough; /* pointer supplied at registration time */
void *data; /* optional state (instance) data */
- bool resultInitialized; /* T if RESULTCREATE/COPY succeeded */
+ bool resultInitialized; /* T if RESULTCREATE/COPY succeeded */
} PGEvent;
struct pg_result
int numParameters;
PGresParamDesc *paramDescs;
ExecStatusType resultStatus;
- char cmdStatus[CMDSTATUS_LEN]; /* cmd status from the query */
+ char cmdStatus[CMDSTATUS_LEN]; /* cmd status from the query */
int binary; /* binary tuple values if binary == 1,
* otherwise text */
/* Typedef for parameter-status list entries */
typedef struct pgParameterStatus
{
- struct pgParameterStatus *next; /* list link */
+ struct pgParameterStatus *next; /* list link */
char *name; /* parameter name */
char *value; /* parameter value */
/* Note: name and value are stored in same malloc block as struct is */
Oid fn_lo_tell; /* OID of backend function lo_tell */
Oid fn_lo_tell64; /* OID of backend function lo_tell64 */
Oid fn_lo_truncate; /* OID of backend function lo_truncate */
- Oid fn_lo_truncate64; /* OID of function lo_truncate64 */
+ Oid fn_lo_truncate64; /* OID of function lo_truncate64 */
Oid fn_lo_read; /* OID of backend function LOread */
Oid fn_lo_write; /* OID of backend function LOwrite */
} PGlobjfuncs;
char *pgtty; /* tty on which the backend messages is
* displayed (OBSOLETE, NOT USED) */
char *connect_timeout; /* connection timeout (numeric string) */
- char *client_encoding_initial; /* encoding to use */
+ char *client_encoding_initial; /* encoding to use */
char *pgoptions; /* options to start the backend with */
char *appname; /* application name */
char *fbappname; /* fallback application name */
char *keepalives_idle; /* time between TCP keepalives */
char *keepalives_interval; /* time between TCP keepalive
* retransmits */
- char *keepalives_count; /* maximum number of TCP keepalive
- * retransmits */
+ char *keepalives_count; /* maximum number of TCP keepalive
+ * retransmits */
char *sslmode; /* SSL mode (require,prefer,allow,disable) */
char *sslcompression; /* SSL compression (0 or 1) */
char *sslkey; /* client key filename */
PGTransactionStatusType xactStatus; /* never changes to ACTIVE */
PGQueryClass queryclass;
char *last_query; /* last SQL command, or NULL if unknown */
- char last_sqlstate[6]; /* last reported SQLSTATE */
+ char last_sqlstate[6]; /* last reported SQLSTATE */
bool options_valid; /* true if OK to attempt connection */
bool nonblocking; /* whether this connection is using nonblock
* sending semantics */
bool singleRowMode; /* return current query result row-by-row? */
char copy_is_binary; /* 1 = copy binary, 0 = copy text */
- int copy_already_done; /* # bytes already returned in COPY
- * OUT */
+ int copy_already_done; /* # bytes already returned in COPY OUT */
PGnotify *notifyHead; /* oldest unreported Notify msg */
PGnotify *notifyTail; /* newest unreported Notify msg */
SockAddr raddr; /* Remote address */
ProtocolVersion pversion; /* FE/BE protocol version in use */
int sversion; /* server version, e.g. 70401 for 7.4.1 */
- bool auth_req_received; /* true if any type of auth req
- * received */
+ bool auth_req_received; /* true if any type of auth req received */
bool password_needed; /* true if server demanded a password */
bool pgpassfile_used; /* true if password is from pgpassfile */
bool sigpipe_so; /* have we masked SIGPIPE via SO_NOSIGPIPE? */
void *engine; /* dummy field to keep struct the same if
* OpenSSL version changes */
#endif
-#endif /* USE_OPENSSL */
-#endif /* USE_SSL */
+#endif /* USE_OPENSSL */
+#endif /* USE_SSL */
#ifdef ENABLE_GSS
gss_ctx_id_t gctx; /* GSS context */
#endif
/* Buffer for current error message */
- PQExpBufferData errorMessage; /* expansible string */
+ PQExpBufferData errorMessage; /* expansible string */
/* Buffer for receiving various parts of messages */
PQExpBufferData workBuffer; /* expansible string */
#define ROOT_CRL_FILE "root.crl"
#endif
-#endif /* USE_SSL */
+#endif /* USE_SSL */
/* ----------------
* Internal functions of libpq
#define SOCK_ERRNO_SET(e) (errno = (e))
#endif
-#endif /* LIBPQ_INT_H */
+#endif /* LIBPQ_INT_H */
str->data = (char *) malloc(INITIAL_EXPBUFFER_SIZE);
if (str->data == NULL)
{
- str->data = (char *) oom_buffer; /* see comment above */
+ str->data = (char *) oom_buffer; /* see comment above */
str->maxlen = 0;
str->len = 0;
}
extern void appendBinaryPQExpBuffer(PQExpBuffer str,
const char *data, size_t datalen);
-#endif /* PQEXPBUFFER_H */
+#endif /* PQEXPBUFFER_H */
STMT_START { \
if (saved != NULL) { setlocale_perl(name, saved); pfree(saved); } \
} STMT_END
-#endif /* WIN32 */
+#endif /* WIN32 */
if (plperl_on_init && *plperl_on_init)
{
check_stack_depth();
hv = newHV();
- hv_ksplit(hv, tupdesc->natts); /* pre-grow the hash */
+ hv_ksplit(hv, tupdesc->natts); /* pre-grow the hash */
for (i = 0; i < tupdesc->natts; i++)
{
newctype = RETVAL;
new_ctype(newctype);
}
-#endif /* USE_LOCALE_CTYPE */
+#endif /* USE_LOCALE_CTYPE */
#ifdef USE_LOCALE_COLLATE
if (category == LC_COLLATE
#ifdef LC_ALL
newcoll = RETVAL;
new_collate(newcoll);
}
-#endif /* USE_LOCALE_COLLATE */
+#endif /* USE_LOCALE_COLLATE */
#ifdef USE_LOCALE_NUMERIC
if (category == LC_NUMERIC
newnum = RETVAL;
new_numeric(newnum);
}
-#endif /* USE_LOCALE_NUMERIC */
+#endif /* USE_LOCALE_NUMERIC */
}
return RETVAL;
#else
#define vsnprintf pg_vsnprintf
#define snprintf pg_snprintf
-#endif /* __GNUC__ */
-#endif /* USE_REPL_SNPRINTF */
+#endif /* __GNUC__ */
+#endif /* USE_REPL_SNPRINTF */
/* perl version and platform portability */
#define NEED_eval_pv
void plperl_spi_cursor_close(char *);
char *plperl_sv_to_literal(SV *, char *);
-#endif /* PL_PERL_H */
+#endif /* PL_PERL_H */
sv_setsv(errsv, ssv);
croak(NULL);
-#endif /* croak_sv */
+#endif /* croak_sv */
}
-#endif /* PL_PERL_HELPERS_H */
+#endif /* PL_PERL_HELPERS_H */
function->fn_tid = procTup->t_self;
function->fn_input_collation = fcinfo->fncollation;
function->fn_cxt = func_cxt;
- function->out_param_varno = -1; /* set up for no OUT param */
+ function->out_param_varno = -1; /* set up for no OUT param */
function->resolve_option = plpgsql_variable_conflict;
function->print_strict_params = plpgsql_print_strict_params;
/* only promote extra warnings and errors at CREATE FUNCTION time */
function->fn_is_trigger = PLPGSQL_NOT_TRIGGER;
function->fn_input_collation = InvalidOid;
function->fn_cxt = func_cxt;
- function->out_param_varno = -1; /* set up for no OUT param */
+ function->out_param_varno = -1; /* set up for no OUT param */
function->resolve_option = plpgsql_variable_conflict;
function->print_strict_params = plpgsql_print_strict_params;
/* Block-qualified reference to scalar variable. */
wdatum->datum = plpgsql_Datums[ns->itemno];
wdatum->ident = NULL;
- wdatum->quoted = false; /* not used */
+ wdatum->quoted = false; /* not used */
wdatum->idents = idents;
return true;
wdatum->datum = plpgsql_Datums[ns->itemno];
}
wdatum->ident = NULL;
- wdatum->quoted = false; /* not used */
+ wdatum->quoted = false; /* not used */
wdatum->idents = idents;
return true;
typedef struct SimpleEcontextStackEntry
{
ExprContext *stack_econtext; /* a stacked econtext */
- SubTransactionId xact_subxid; /* ID for current subxact */
- struct SimpleEcontextStackEntry *next; /* next stack entry up */
+ SubTransactionId xact_subxid; /* ID for current subxact */
+ struct SimpleEcontextStackEntry *next; /* next stack entry up */
} SimpleEcontextStackEntry;
static EState *shared_simple_eval_estate = NULL;
* the generated result type, instead.
*/
tupdesc = estate.rettupdesc;
- if (tupdesc == NULL) /* shouldn't happen */
+ if (tupdesc == NULL) /* shouldn't happen */
elog(ERROR, "return type must be a row type");
break;
default:
if (!row->rowtupdesc) /* should not happen */
elog(ERROR, "row variable has no tupdesc");
tup = make_tuple_from_row(estate, row, row->rowtupdesc);
- if (tup == NULL) /* should not happen */
+ if (tup == NULL) /* should not happen */
elog(ERROR, "row not compatible with its own tupdesc");
estate->retval = PointerGetDatum(tup);
estate->rettupdesc = row->rowtupdesc;
estate->paramLI->paramFetch = plpgsql_param_fetch;
estate->paramLI->paramFetchArg = (void *) estate;
estate->paramLI->parserSetup = (ParserSetupHook) plpgsql_parser_setup;
- estate->paramLI->parserSetupArg = NULL; /* filled during use */
+ estate->paramLI->parserSetupArg = NULL; /* filled during use */
estate->paramLI->numParams = estate->ndatums;
estate->paramLI->paramMask = NULL;
estate->params_dirty = false;
ctl.entrysize = sizeof(plpgsql_CastHashEntry);
ctl.hcxt = CurrentMemoryContext;
estate->cast_hash = hash_create("PLpgSQL private cast cache",
- 16, /* start small and extend */
+ 16, /* start small and extend */
&ctl,
HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
estate->cast_hash_context = CurrentMemoryContext;
* array, either, so that's a no-op too. This is all ugly but
* corresponds to the current behavior of execExpr*.c.
*/
- if (arrayelem->arraytyplen > 0 && /* fixed-length array? */
+ if (arrayelem->arraytyplen > 0 && /* fixed-length array? */
(oldarrayisnull || isNull))
return;
default:
elog(ERROR, "unrecognized dtype: %d", datum->dtype);
- *typeid = InvalidOid; /* keep compiler quiet */
+ *typeid = InvalidOid; /* keep compiler quiet */
*typmod = -1;
*collation = InvalidOid;
break;
struct PLpgSQL_nsitem *ns;
/* fields for "simple expression" fast-path execution: */
- Expr *expr_simple_expr; /* NULL means not a simple expr */
+ Expr *expr_simple_expr; /* NULL means not a simple expr */
int expr_simple_generation; /* plancache generation we checked */
- Oid expr_simple_type; /* result type Oid, if simple */
- int32 expr_simple_typmod; /* result typmod, if simple */
+ Oid expr_simple_type; /* result type Oid, if simple */
+ int32 expr_simple_typmod; /* result typmod, if simple */
/*
* if expr is simple AND prepared in current transaction,
* seeing if expr_simple_lxid matches current LXID. (If not,
* expr_simple_state probably points at garbage!)
*/
- ExprState *expr_simple_state; /* eval tree for expr_simple_expr */
- bool expr_simple_in_use; /* true if eval tree is active */
+ ExprState *expr_simple_state; /* eval tree for expr_simple_expr */
+ bool expr_simple_in_use; /* true if eval tree is active */
LocalTransactionId expr_simple_lxid;
} PLpgSQL_expr;
/* the datums representing the function's local variables */
int ndatums;
PLpgSQL_datum **datums;
- Bitmapset *resettable_datums; /* dnos of non-simple vars */
+ Bitmapset *resettable_datums; /* dnos of non-simple vars */
/* function body parsetree */
PLpgSQL_stmt_block *action;
* CONTINUE stmt, if any */
ErrorData *cur_error; /* current exception handler's error */
- Tuplestorestate *tuple_store; /* SRFs accumulate results here */
+ Tuplestorestate *tuple_store; /* SRFs accumulate results here */
MemoryContext tuple_store_cxt;
ResourceOwner tuple_store_owner;
ReturnSetInfo *rsi;
*/
extern int plpgsql_yyparse(void);
-#endif /* PLPGSQL_H */
+#endif /* PLPGSQL_H */
extern PyObject *PLy_cursor(PyObject *self, PyObject *args);
extern PyObject *PLy_cursor_plan(PyObject *ob, PyObject *args);
-#endif /* PLPY_CURSOROBJECT_H */
+#endif /* PLPY_CURSOROBJECT_H */
extern void PLy_exception_set_with_details(PyObject *excclass, ErrorData *edata);
-#endif /* PLPY_ELOG_H */
+#endif /* PLPY_ELOG_H */
{
PyObject *iter; /* Python iterator producing results */
PLySavedArgs *savedargs; /* function argument values */
- MemoryContextCallback callback; /* for releasing refcounts when done */
+ MemoryContextCallback callback; /* for releasing refcounts when done */
} PLySRFState;
static PyObject *PLy_function_build_args(FunctionCallInfo fcinfo, PLyProcedure *proc);
extern Datum PLy_exec_function(FunctionCallInfo fcinfo, PLyProcedure *proc);
extern HeapTuple PLy_exec_trigger(FunctionCallInfo fcinfo, PLyProcedure *proc);
-#endif /* PLPY_EXEC_H */
+#endif /* PLPY_EXEC_H */
/* call plpython validator with our fcinfo so it gets our oid */
return plpython_validator(fcinfo);
}
-#endif /* PY_MAJOR_VERSION < 3 */
+#endif /* PY_MAJOR_VERSION < 3 */
Datum
plpython_call_handler(PG_FUNCTION_ARGS)
{
return plpython_call_handler(fcinfo);
}
-#endif /* PY_MAJOR_VERSION < 3 */
+#endif /* PY_MAJOR_VERSION < 3 */
Datum
plpython_inline_handler(PG_FUNCTION_ARGS)
{
return plpython_inline_handler(fcinfo);
}
-#endif /* PY_MAJOR_VERSION < 3 */
+#endif /* PY_MAJOR_VERSION < 3 */
static bool
PLy_procedure_is_trigger(Form_pg_proc procStruct)
/* Get the scratch memory context for specified execution context */
extern MemoryContext PLy_get_scratch_context(PLyExecutionContext *context);
-#endif /* PLPY_MAIN_H */
+#endif /* PLPY_MAIN_H */
extern PyObject *PLy_plan_new(void);
extern bool is_PLyPlanObject(PyObject *ob);
-#endif /* PLPY_PLANOBJECT_H */
+#endif /* PLPY_PLANOBJECT_H */
return m;
}
-#endif /* PY_MAJOR_VERSION >= 3 */
+#endif /* PY_MAJOR_VERSION >= 3 */
void
PLy_init_plpy(void)
#endif
extern void PLy_init_plpy(void);
-#endif /* PLPY_PLPYMODULE_H */
+#endif /* PLPY_PLPYMODULE_H */
struct PLySavedArgs *next; /* linked-list pointer */
PyObject *args; /* "args" element of globals dict */
int nargs; /* length of namedargs array */
- PyObject *namedargs[FLEXIBLE_ARRAY_MEMBER]; /* named args */
+ PyObject *namedargs[FLEXIBLE_ARRAY_MEMBER]; /* named args */
} PLySavedArgs;
/* cached procedure data */
extern void PLy_procedure_compile(PLyProcedure *proc, const char *src);
extern void PLy_procedure_delete(PLyProcedure *proc);
-#endif /* PLPY_PROCEDURE_H */
+#endif /* PLPY_PROCEDURE_H */
extern void PLy_result_init_type(void);
extern PyObject *PLy_result_new(void);
-#endif /* PLPY_RESULTOBJECT_H */
+#endif /* PLPY_RESULTOBJECT_H */
extern void PLy_spi_subtransaction_commit(MemoryContext oldcontext, ResourceOwner oldowner);
extern void PLy_spi_subtransaction_abort(MemoryContext oldcontext, ResourceOwner oldowner);
-#endif /* PLPY_SPI_H */
+#endif /* PLPY_SPI_H */
extern void PLy_subtransaction_init_type(void);
extern PyObject *PLy_subtransaction_new(PyObject *self, PyObject *unused);
-#endif /* PLPY_SUBXACTOBJECT */
+#endif /* PLPY_SUBXACTOBJECT */
/* conversion from Python objects to C strings */
extern char *PLyObject_AsString(PyObject *plrv);
-#endif /* PLPY_TYPEIO_H */
+#endif /* PLPY_TYPEIO_H */
return PLyUnicode_FromStringAndSize(s, strlen(s));
}
-#endif /* PY_MAJOR_VERSION >= 3 */
+#endif /* PY_MAJOR_VERSION >= 3 */
extern PyObject *PLyUnicode_FromStringAndSize(const char *s, Py_ssize_t size);
#endif
-#endif /* PLPY_UTIL_H */
+#endif /* PLPY_UTIL_H */
#else
#define vsnprintf pg_vsnprintf
#define snprintf pg_snprintf
-#endif /* __GNUC__ */
-#endif /* USE_REPL_SNPRINTF */
+#endif /* __GNUC__ */
+#endif /* USE_REPL_SNPRINTF */
/*
* Used throughout, and also by the Python 2/3 porting layer, so it's easier to
*/
#include "plpy_util.h"
-#endif /* PLPYTHON_H */
+#endif /* PLPYTHON_H */
typedef struct pltcl_proc_desc
{
char *user_proname; /* user's name (from pg_proc.proname) */
- char *internal_proname; /* Tcl name (based on function OID) */
+ char *internal_proname; /* Tcl name (based on function OID) */
MemoryContext fn_cxt; /* memory context for this procedure */
unsigned long fn_refcount; /* number of active references */
TransactionId fn_xmin; /* xmin of pg_proc row */
ItemPointerData fn_tid; /* TID of pg_proc row */
bool fn_readonly; /* is function readonly? */
bool lanpltrusted; /* is it pltcl (vs. pltclu)? */
- pltcl_interp_desc *interp_desc; /* interpreter to use */
+ pltcl_interp_desc *interp_desc; /* interpreter to use */
FmgrInfo result_in_func; /* input function for fn's result type */
- Oid result_typioparam; /* param to pass to same */
+ Oid result_typioparam; /* param to pass to same */
bool fn_retisset; /* true if function returns a set */
bool fn_retistuple; /* true if function returns composite */
int nargs; /* number of arguments */
AttInMetadata *attinmeta; /* metadata for building tuples of that type */
ReturnSetInfo *rsi; /* passed-in ReturnSetInfo, if any */
- Tuplestorestate *tuple_store; /* SRFs accumulate result here */
- MemoryContext tuple_store_cxt; /* context and resowner for tuplestore */
+ Tuplestorestate *tuple_store; /* SRFs accumulate result here */
+ MemoryContext tuple_store_cxt; /* context and resowner for tuplestore */
ResourceOwner tuple_store_owner;
} pltcl_call_state;
/* Find or compile the function */
prodesc = compile_pltcl_function(fcinfo->flinfo->fn_oid,
RelationGetRelid(trigdata->tg_relation),
- false, /* not an event trigger */
+ false, /* not an event trigger */
pltrusted);
call_state->prodesc = prodesc;
return -1;
}
#endif
-#endif /* WIN32 */
+#endif /* WIN32 */
#if (defined(HAVE_LANGINFO_H) && defined(CODESET)) || defined(WIN32)
return PG_SQL_ASCII;
}
-#endif /* (HAVE_LANGINFO_H && CODESET) || WIN32 */
+#endif /* (HAVE_LANGINFO_H && CODESET) || WIN32 */
#else
__RCSID("$NetBSD: crypt.c,v 1.18 2001/03/01 14:37:35 wiz Exp $");
#endif
-#endif /* not lint */
+#endif /* not lint */
#include "c.h"
{ C_block tblk; permute(cpp,&tblk,p,8); LOAD (d,d0,d1,tblk); }
#define PERM3264(d,d0,d1,cpp,p) \
{ C_block tblk; permute(cpp,&tblk,p,4); LOAD (d,d0,d1,tblk); }
-#endif /* LARGEDATA */
+#endif /* LARGEDATA */
STATIC init_des(void);
STATIC init_perm(C_block[64 / CHUNKBITS][1 << CHUNKBITS], unsigned char[64], int, int);
} while (--chars_in > 0);
STORE(D, D0, D1, *out);
}
-#endif /* LARGEDATA */
+#endif /* LARGEDATA */
/* ===== (mostly) Standard DES Tables ==================== */
-static const unsigned char IP[] = { /* initial permutation */
+static const unsigned char IP[] = { /* initial permutation */
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6,
/* The final permutation is the inverse of IP - no table is necessary */
-static const unsigned char ExpandTr[] = { /* expansion operation */
+static const unsigned char ExpandTr[] = { /* expansion operation */
32, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13,
21, 13, 5, 28, 20, 12, 4,
};
-static const unsigned char Rotates[] = { /* PC1 rotation schedule */
+static const unsigned char Rotates[] = { /* PC1 rotation schedule */
1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1,
};
/* ===== Tables that are initialized at run time ==================== */
-static unsigned char a64toi[128]; /* ascii-64 => 0..63 */
+static unsigned char a64toi[128]; /* ascii-64 => 0..63 */
/* Initial key schedule permutation */
static C_block PC1ROT[64 / CHUNKBITS][1 << CHUNKBITS];
static char cryptresult[1 + 4 + 4 + 11 + 1]; /* encrypted result */
extern char *__md5crypt(const char *, const char *); /* XXX */
-extern char *__bcrypt(const char *, const char *); /* XXX */
+extern char *__bcrypt(const char *, const char *); /* XXX */
/*
key++;
keyblock.b[i] = t;
}
- if (des_setkey((char *) keyblock.b)) /* also initializes "a64toi" */
+ if (des_setkey((char *) keyblock.b)) /* also initializes "a64toi" */
return (NULL);
encp = &cryptresult[0];
R1 = (R1 >> 1) & 0x55555555L;
L1 = R0 | R1; /* L1 is the odd-numbered input bits */
STORE(L, L0, L1, B);
- PERM3264(L, L0, L1, B.b, (C_block *) IE3264); /* even bits */
+ PERM3264(L, L0, L1, B.b, (C_block *) IE3264); /* even bits */
PERM3264(R, R0, R1, B.b + 4, (C_block *) IE3264); /* odd bits */
if (num_iter >= 0)
strcpy(d->dirname, dirname);
if (d->dirname[strlen(d->dirname) - 1] != '/' &&
d->dirname[strlen(d->dirname) - 1] != '\\')
- strcat(d->dirname, "\\"); /* Append backslash if not already
- * there */
+ strcat(d->dirname, "\\"); /* Append backslash if not already there */
strcat(d->dirname, "*"); /* Search for entries named anything */
d->handle = INVALID_HANDLE_VALUE;
d->ret.d_ino = 0; /* no inodes on win32 */
return NULL;
}
}
- strcpy(d->ret.d_name, fd.cFileName); /* Both strings are MAX_PATH
- * long */
+ strcpy(d->ret.d_name, fd.cFileName); /* Both strings are MAX_PATH long */
d->ret.d_namlen = strlen(d->ret.d_name);
return &d->ret;
/* We undefined these above; now redefine for possible use below */
#define rename(from, to) pgrename(from, to)
#define unlink(path) pgunlink(path)
-#endif /* defined(WIN32) || defined(__CYGWIN__) */
+#endif /* defined(WIN32) || defined(__CYGWIN__) */
-#if defined(WIN32) && !defined(__CYGWIN__) /* Cygwin has its own symlinks */
+#if defined(WIN32) && !defined(__CYGWIN__) /* Cygwin has its own symlinks */
/*
* pgsymlink support:
}
return ((attr & FILE_ATTRIBUTE_REPARSE_POINT) == FILE_ATTRIBUTE_REPARSE_POINT);
}
-#endif /* defined(WIN32) && !defined(__CYGWIN__) */
+#endif /* defined(WIN32) && !defined(__CYGWIN__) */
#if defined(WIN32) && !defined(__CYGWIN__)
case EAI_MEMORY:
return "Not enough memory";
#endif
-#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME /* MSVC/WIN64 duplicate */
+#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME /* MSVC/WIN64 duplicate */
case EAI_NODATA:
return "No host data of that type was found";
#endif
default:
return "Unknown server error";
}
-#endif /* HAVE_HSTRERROR */
+#endif /* HAVE_HSTRERROR */
}
/*
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
-#endif /* LIBC_SCCS and not lint */
+#endif /* LIBC_SCCS and not lint */
/*
rusage->ru_utime.tv_usec = TICK_TO_USEC(u, tick_rate);
rusage->ru_stime.tv_sec = TICK_TO_SEC(s, tick_rate);
rusage->ru_stime.tv_usec = TICK_TO_USEC(u, tick_rate);
-#endif /* WIN32 */
+#endif /* WIN32 */
return 0;
}
#else
__RCSID("$NetBSD: gettemp.c,v 1.17 2014/01/21 19:09:48 seanb Exp $");
#endif
-#endif /* LIBC_SCCS and not lint */
+#endif /* LIBC_SCCS and not lint */
#endif
#include
/* NOTREACHED */
}
-#endif /* !HAVE_NBTOOL_CONFIG_H || !HAVE_MKSTEMP ||
+#endif /* !HAVE_NBTOOL_CONFIG_H || !HAVE_MKSTEMP ||
* !HAVE_MKDTEMP */
#else
__RCSID("$NetBSD: mkdtemp.c,v 1.11 2012/03/15 18:22:30 christos Exp $");
#endif
-#endif /* LIBC_SCCS and not lint */
+#endif /* LIBC_SCCS and not lint */
#if HAVE_NBTOOL_CONFIG_H
#define GETTEMP __nbcompat_gettemp
return GETTEMP(path, NULL, 1) ? path : NULL;
}
-#endif /* !HAVE_NBTOOL_CONFIG_H || !HAVE_MKDTEMP */
+#endif /* !HAVE_NBTOOL_CONFIG_H || !HAVE_MKDTEMP */
0xA1354CE5, 0x864870AC, 0xEFCF3477, 0xC8B2083E,
0xCCB751C4, 0xEBCA6D8D, 0x824D2956, 0xA530151F
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
};
crc = _mm_crc32_u32(crc, *((const unsigned int *) p));
p += 4;
}
-#endif /* __x86_64__ */
+#endif /* __x86_64__ */
/* Process any remaining bytes one at a time. */
while (p < pend)
}
}
-#endif /* defined(FRONTEND) || !defined(WIN32) */
+#endif /* defined(FRONTEND) || !defined(WIN32) */
return oact.sa_handler;
}
-#endif /* !WIN32 */
+#endif /* !WIN32 */
-#endif /* !defined(WIN32) || defined(FRONTEND) */
+#endif /* !defined(WIN32) || defined(FRONTEND) */
goto nextch1;
case '*':
if (afterstar)
- have_non_dollar = true; /* multiple stars */
+ have_non_dollar = true; /* multiple stars */
afterstar = true;
accum = 0;
goto nextch1;
extern int spec_yylex(void);
extern void spec_yyerror(const char *str);
-#endif /* ISOLATIONTESTER_H */
+#endif /* ISOLATIONTESTER_H */
return temp_sockdir;
}
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
/*
* Check whether string matches pattern
p = active_pids[r - WAIT_OBJECT_0];
/* compact the active_pids array */
active_pids[r - WAIT_OBJECT_0] = active_pids[tests_left - 1];
-#endif /* WIN32 */
+#endif /* WIN32 */
for (i = 0; i < num_tests; i++)
{
bool newdiff;
if (tl)
- tl = tl->next; /* tl has the same length as rl and el
- * if it exists */
+ tl = tl->next; /* tl has the same length as rl and el if
+ * it exists */
newdiff = results_differ(tests[i], rl->str, el->str);
if (newdiff && tl)
return PointerGetDatum(NULL);
}
}
- else if (oldoff != TTDUMMY_INFINITY) /* DELETE */
+ else if (oldoff != TTDUMMY_INFINITY) /* DELETE */
{
pfree(relname);
return PointerGetDatum(NULL);
{
cvals[attnum[0] - 1] = newoff; /* start_date eq current date */
cnulls[attnum[0] - 1] = ' ';
- cvals[attnum[1] - 1] = TTDUMMY_INFINITY; /* stop_date eq INFINITY */
+ cvals[attnum[1] - 1] = TTDUMMY_INFINITY; /* stop_date eq INFINITY */
cnulls[attnum[1] - 1] = ' ';
}
else
int44out(PG_FUNCTION_ARGS)
{
int32 *an_array = (int32 *) PG_GETARG_POINTER(0);
- char *result = (char *) palloc(16 * 4); /* Allow 14 digits +
- * sign */
+ char *result = (char *) palloc(16 * 4); /* Allow 14 digits + sign */
int i;
char *walk;
pg_atomic_clear_flag(&flag);
}
-#endif /* PG_HAVE_ATOMIC_FLAG_SIMULATION */
+#endif /* PG_HAVE_ATOMIC_FLAG_SIMULATION */
static void
test_atomic_uint32(void)
pthread_mutex_unlock(&init_mutex);
}
-#endif /* !ENABLE_THREAD_SAFETY && !IN_CONFIGURE */
+#endif /* !ENABLE_THREAD_SAFETY && !IN_CONFIGURE */
* that tzname[0] has the "normal" length of three characters).
*/
#define WILDABBR " "
-#endif /* !defined WILDABBR */
+#endif /* !defined WILDABBR */
static const char wildabbr[] = WILDABBR;
return EINVAL;
if (nread
< (tzheadsize /* struct tzhead */
- + timecnt * stored /* ats */
+ + timecnt * stored /* ats */
+ timecnt /* types */
+ typecnt * 6 /* ttinfos */
+ charcnt /* chars */
strp = getoffset(strp, &rulep->r_time);
}
else
- rulep->r_time = 2 * SECSPERHOUR; /* default = 2:00:00 */
+ rulep->r_time = 2 * SECSPERHOUR; /* default = 2:00:00 */
return strp;
}
stdlen = (sizeof sp->chars) - 1;
charcnt = stdlen + 1;
stdoffset = 0;
- sp->goback = sp->goahead = false; /* simulate failed tzload() */
+ sp->goback = sp->goahead = false; /* simulate failed tzload() */
load_ok = false;
}
else
bool doextend);
extern bool tzparse(const char *name, struct state *sp, bool lastditch);
-#endif /* _PGTZ_H */
+#endif /* _PGTZ_H */
#ifndef WIFEXITED
#define WIFEXITED(status) (((status) & 0xff) == 0)
-#endif /* !defined WIFEXITED */
+#endif /* !defined WIFEXITED */
#ifndef WEXITSTATUS
#define WEXITSTATUS(status) (((status) >> 8) & 0xff)
-#endif /* !defined WEXITSTATUS */
+#endif /* !defined WEXITSTATUS */
/* Unlike 's isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
extern int unlink(const char *filename);
#define remove unlink
-#endif /* !defined remove */
+#endif /* !defined remove */
/*
((int64) YEARSPERREPEAT * (int64) AVGSECSPERYEAR)
#define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */
-#endif /* !defined PRIVATE_H */
+#endif /* !defined PRIVATE_H */
*/
pt = _add("kitchen sink", pt, ptlim);
continue;
-#endif /* defined KITCHEN_SINK */
+#endif /* defined KITCHEN_SINK */
case 'l':
/*
{
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
- char tzh_reserved[15]; /* reserved; must be zero */
- char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
- char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
+ char tzh_reserved[15]; /* reserved; must be zero */
+ char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
+ char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
-#endif /* !defined TZFILE_H */
+#endif /* !defined TZFILE_H */
#ifndef ZIC_MAX_ABBR_LEN_WO_WARN
#define ZIC_MAX_ABBR_LEN_WO_WARN 6
-#endif /* !defined ZIC_MAX_ABBR_LEN_WO_WARN */
+#endif /* !defined ZIC_MAX_ABBR_LEN_WO_WARN */
#ifndef WIN32
#ifdef S_IRUSR
* r_dycode r_dayofmonth r_wday
*/
-#define DC_DOM 0 /* 1..31 */ /* unused */
-#define DC_DOWGEQ 1 /* 1..31 */ /* 0..6 (Sun..Sat) */
-#define DC_DOWLEQ 2 /* 1..31 */ /* 0..6 (Sun..Sat) */
+#define DC_DOM 0 /* 1..31 */ /* unused */
+#define DC_DOWGEQ 1 /* 1..31 */ /* 0..6 (Sun..Sat) */
+#define DC_DOWLEQ 2 /* 1..31 */ /* 0..6 (Sun..Sat) */
struct zone
{
#ifndef WIN32
umask(umask(S_IWGRP | S_IWOTH) | (S_IWGRP | S_IWOTH));
-#endif /* !WIN32 */
+#endif /* !WIN32 */
progname = argv[0];
if (TYPE_BIT(zic_t) <64)
{
}
return result;
}
-#endif /* HAVE_SYMLINK */
+#endif /* HAVE_SYMLINK */
/* Hard link FROM to TO, following any symbolic links.
Return 0 if successful, an error number otherwise. */
strerror(link_errno));
}
else
-#endif /* HAVE_SYMLINK */
+#endif /* HAVE_SYMLINK */
{
FILE *fp,
*tp;
writetype[type] = true;
}
}
-#endif /* !defined
+#endif /* !defined
* LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH */
thistypecnt = 0;
for (i = 0; i < typecnt; ++i)
# Fix run-together comments to have a tab between them
$source =~ s!\*/(/\*.*\*/)$!*/\t$1!gm;
- # cpp conditionals
-
- # Reduce whitespace between #endif and comments to one tab
- $source =~ s!^\#endif[ \t]+/\*!#endif /*!gm;
-
## Functions
# Use a single space before '*' in function return types
Point *makepoint(Point *pointx, Point *pointy);
text *copytext(text *t);
text *concat_text(text *arg1, text *arg2);
-bool c_overpaid(HeapTupleHeader t, /* the current instance of EMP */
+bool c_overpaid(HeapTupleHeader t, /* the current instance of EMP */
int32 limit);
/*
* VARDATA is a pointer to the data region of the struct.
*/
- memcpy((void *) VARDATA(new_t), /* destination */
+ memcpy((void *) VARDATA(new_t), /* destination */
(void *) VARDATA(t), /* source */
- VARSIZE(t) - VARHDRSZ); /* how many bytes */
+ VARSIZE(t) - VARHDRSZ); /* how many bytes */
return new_t;
}
* VARDATA is a pointer to the data region of the new struct. The source
* could be a short datum, so retrieve its data through VARDATA_ANY.
*/
- memcpy((void *) VARDATA(new_t), /* destination */
- (void *) VARDATA_ANY(t), /* source */
- VARSIZE_ANY_EXHDR(t)); /* how many bytes */
+ memcpy((void *) VARDATA(new_t), /* destination */
+ (void *) VARDATA_ANY(t), /* source */
+ VARSIZE_ANY_EXHDR(t)); /* how many bytes */
PG_RETURN_TEXT_P(new_t);
}