{
gbt_t_bit,
0,
- TRUE,
+ true,
gbt_bitgt,
gbt_bitge,
gbt_biteq,
if (GIST_LEAF(entry))
retval = gbt_var_consistent(&r, query, strategy, PG_GET_COLLATION(),
- TRUE, &tinfo, fcinfo->flinfo);
+ true, &tinfo, fcinfo->flinfo);
else
{
bytea *q = gbt_bit_xfrm((bytea *) query);
retval = gbt_var_consistent(&r, q, strategy, PG_GET_COLLATION(),
- FALSE, &tinfo, fcinfo->flinfo);
+ false, &tinfo, fcinfo->flinfo);
}
PG_RETURN_BOOL(retval);
}
{
gbt_t_bytea,
0,
- TRUE,
+ true,
gbt_byteagt,
gbt_byteage,
gbt_byteaeq,
r->upper = r->lower;
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else
retval = entry;
}
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
PG_RETURN_POINTER(retval);
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
PG_RETURN_POINTER(retval);
}
{
gbt_t_numeric,
0,
- FALSE,
+ false,
gbt_numeric_gt,
gbt_numeric_ge,
gbt_numeric_eq,
{
gbt_t_text,
0,
- FALSE,
+ false,
gbt_textgt,
gbt_textge,
gbt_texteq,
gistentryinit(trim, d,
entry->rel, entry->page,
- entry->offset, TRUE);
+ entry->offset, true);
retval = gbt_var_compress(&trim, &tinfo);
}
else
r->lower = r->upper = tmp;
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else
retval = entry;
r->lower = r->upper = gmt;
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else
retval = entry;
memcpy((void *) &r[tinfo->size], leaf, tinfo->size);
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else
retval = entry;
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, datum, entry->rel, entry->page, entry->offset,
- FALSE);
+ false);
return retval;
}
gistentryinit(*retval, PointerGetDatum(key),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
PG_RETURN_POINTER(retval);
}
static bool
gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo *tinfo)
{
- bool out = FALSE;
+ bool out = false;
int32 qlen = VARSIZE(query) - VARHDRSZ;
int32 nlen = VARSIZE(pf) - VARHDRSZ;
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, TRUE);
+ entry->offset, true);
}
else
retval = entry;
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(r.lower),
entry->rel, entry->page,
- entry->offset, TRUE);
+ entry->offset, true);
PG_RETURN_POINTER(retval);
}
const gbtree_vinfo *tinfo,
FmgrInfo *flinfo)
{
- bool retval = FALSE;
+ bool retval = false;
switch (strategy)
{
tinfo->f_eq(query, key->upper, collation, flinfo));
break;
default:
- retval = FALSE;
+ retval = false;
}
return retval;
memcpy((void *) (r + UUID_LEN), (void *) key, UUID_LEN);
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else
retval = entry;
/*
** The GiST Consistent method for boxes
** Should return false if for all data items x below entry,
-** the predicate x op query == FALSE, where op is the oper
+** the predicate x op query == false, where op is the oper
** corresponding to strategy in the pg_amop table.
*/
Datum
gistentryinit(*retval, PointerGetDatum(key),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
PG_RETURN_POINTER(retval);
}
PG_RETURN_POINTER(entry);
bool *result = (bool *) PG_GETARG_POINTER(2);
if (cube_cmp_v0(b1, b2) == 0)
- *result = TRUE;
+ *result = true;
else
- *result = FALSE;
+ *result = false;
PG_RETURN_NDBOX_P(result);
}
retval = cube_contains_v0(query, key);
break;
default:
- retval = FALSE;
+ retval = false;
}
return retval;
}
retval = (bool) cube_overlap_v0(key, query);
break;
default:
- retval = FALSE;
+ retval = false;
}
return retval;
}
int i;
if ((a == NULL) || (b == NULL))
- return FALSE;
+ return false;
if (DIM(a) < DIM(b))
{
for (i = DIM(a); i < DIM(b); i++)
{
if (LL_COORD(b, i) != 0)
- return FALSE;
+ return false;
if (UR_COORD(b, i) != 0)
- return FALSE;
+ return false;
}
}
{
if (Min(LL_COORD(a, i), UR_COORD(a, i)) >
Min(LL_COORD(b, i), UR_COORD(b, i)))
- return FALSE;
+ return false;
if (Max(LL_COORD(a, i), UR_COORD(a, i)) <
Max(LL_COORD(b, i), UR_COORD(b, i)))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
Datum
int i;
if ((a == NULL) || (b == NULL))
- return FALSE;
+ return false;
/* swap the box pointers if needed */
if (DIM(a) < DIM(b))
for (i = 0; i < DIM(b); i++)
{
if (Min(LL_COORD(a, i), UR_COORD(a, i)) > Max(LL_COORD(b, i), UR_COORD(b, i)))
- return FALSE;
+ return false;
if (Max(LL_COORD(a, i), UR_COORD(a, i)) < Min(LL_COORD(b, i), UR_COORD(b, i)))
- return FALSE;
+ return false;
}
/* compare to zero those dimensions in (a) absent in (b) */
for (i = DIM(b); i < DIM(a); i++)
{
if (Min(LL_COORD(a, i), UR_COORD(a, i)) > 0)
- return FALSE;
+ return false;
if (Max(LL_COORD(a, i), UR_COORD(a, i)) < 0)
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
pconn = (remoteConn *) MemoryContextAlloc(TopMemoryContext, sizeof(remoteConn));
pconn->conn = NULL;
pconn->openCursorCount = 0;
- pconn->newXactForCursor = FALSE;
+ pconn->newXactForCursor = false;
}
}
if (PQresultStatus(res) != PGRES_COMMAND_OK)
dblink_res_internalerror(conn, res, "begin error");
PQclear(res);
- rconn->newXactForCursor = TRUE;
+ rconn->newXactForCursor = true;
/*
* Since transaction state was IDLE, we force cursor count to
/* if count is zero, commit the transaction */
if (rconn->openCursorCount == 0)
{
- rconn->newXactForCursor = FALSE;
+ rconn->newXactForCursor = false;
res = PQexec(conn, "COMMIT");
if (PQresultStatus(res) != PGRES_COMMAND_OK)
*
* Check to see if it's useful to convert only a subset of the file's columns
* to binary. If so, construct a list of the column names to be converted,
- * return that at *columns, and return TRUE. (Note that it's possible to
+ * return that at *columns, and return true. (Note that it's possible to
* determine that no columns need be converted, for instance with a COUNT(*)
* query. So we can't use returning a NIL list to indicate failure.)
*/
phoned_word -- The final phonized word. (We'll allocate the
memory.)
Output
- error -- A simple error flag, returns TRUE or FALSE
+ error -- A simple error flag, returns true or false
NOTES: ALL non-alpha characters are ignored, this includes whitespace,
although non-alpha characters will break up phonemes.
gistentryinit(*retval, PointerGetDatum(res),
entry->rel, entry->page,
entry->offset,
- FALSE);
+ false);
}
else if (!ISALLTRUE(DatumGetPointer(entry->key)))
{
gistentryinit(*retval, PointerGetDatum(res),
entry->rel, entry->page,
entry->offset,
- FALSE);
+ false);
}
PG_RETURN_POINTER(retval);
continue;
crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ);
if (!(GETBIT(sign, HASHVAL(crc))))
- res = FALSE;
+ res = false;
}
}
else if (strategy == HStoreExistsAnyStrategyNumber)
TEXTOID, -1, false, 'i',
&key_datums, &key_nulls, &key_count);
- res = FALSE;
+ res = false;
for (i = 0; !res && i < key_count; ++i)
{
continue;
crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ);
if (GETBIT(sign, HASHVAL(crc)))
- res = TRUE;
+ res = true;
}
}
else
j = 0;
if (query->size <= 0)
- return FALSE;
+ return false;
/*
* Set up data for checkcondition_gin. This must agree with the query
/* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
bool *recheck = (bool *) PG_GETARG_POINTER(5);
- bool res = FALSE;
+ bool res = false;
int32 i;
switch (strategy)
/* result is not lossy */
*recheck = false;
/* at least one element in check[] is true, so result = true */
- res = TRUE;
+ res = true;
break;
case RTContainedByStrategyNumber:
case RTOldContainedByStrategyNumber:
/* we will need recheck */
*recheck = true;
/* at least one element in check[] is true, so result = true */
- res = TRUE;
+ res = true;
break;
case RTSameStrategyNumber:
/* we will need recheck */
*recheck = true;
/* Must have all elements in check[] true */
- res = TRUE;
+ res = true;
for (i = 0; i < nkeys; i++)
{
if (!check[i])
{
- res = FALSE;
+ res = false;
break;
}
}
/* result is not lossy */
*recheck = false;
/* Must have all elements in check[] true */
- res = TRUE;
+ res = true;
for (i = 0; i < nkeys; i++)
{
if (!check[i])
{
- res = FALSE;
+ res = false;
break;
}
}
/*
** The GiST Consistent method for _intments
** Should return false if for all data items x below entry,
-** the predicate x op query == FALSE, where op is the oper
+** the predicate x op query == false, where op is the oper
** corresponding to strategy in the pg_amop table.
*/
Datum
query);
break;
default:
- retval = FALSE;
+ retval = false;
}
pfree(query);
PG_RETURN_BOOL(retval);
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(r),
- entry->rel, entry->page, entry->offset, FALSE);
+ entry->rel, entry->page, entry->offset, false);
PG_RETURN_POINTER(retval);
}
r = resize_intArrayType(r, len);
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(r),
- entry->rel, entry->page, entry->offset, FALSE);
+ entry->rel, entry->page, entry->offset, false);
PG_RETURN_POINTER(retval);
}
else
{
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(in),
- entry->rel, entry->page, entry->offset, FALSE);
+ entry->rel, entry->page, entry->offset, false);
PG_RETURN_POINTER(retval);
}
{
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(in),
- entry->rel, entry->page, entry->offset, FALSE);
+ entry->rel, entry->page, entry->offset, false);
PG_RETURN_POINTER(retval);
}
pfree(in);
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(r),
- entry->rel, entry->page, entry->offset, FALSE);
+ entry->rel, entry->page, entry->offset, false);
PG_RETURN_POINTER(retval);
}
*result = false;
PG_RETURN_POINTER(result);
}
- *result = TRUE;
+ *result = true;
da = ARRPTR(a);
db = ARRPTR(b);
while (n--)
{
if (*da++ != *db++)
{
- *result = FALSE;
+ *result = false;
break;
}
}
da = ARRPTR(a);
db = ARRPTR(b);
- result = FALSE;
+ result = false;
if (na == nb)
{
SORT(a);
SORT(b);
- result = TRUE;
+ result = true;
for (n = 0; n < na; n++)
{
if (da[n] != db[n])
{
- result = FALSE;
+ result = false;
break;
}
}
CHECKARRVALID(a);
CHECKARRVALID(b);
if (ARRISEMPTY(a) || ARRISEMPTY(b))
- return FALSE;
+ return false;
SORT(a);
SORT(b);
break; /* db[j] is not in da */
}
- return (n == nb) ? TRUE : FALSE;
+ return (n == nb) ? true : false;
}
/* arguments are assumed sorted */
if (da[i] < db[j])
i++;
else if (da[i] == db[j])
- return TRUE;
+ return true;
else
j++;
}
- return FALSE;
+ return false;
}
ArrayType *
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(res),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
if (in != DatumGetArrayTypeP(entry->key))
pfree(in);
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(res),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
PG_RETURN_POINTER(retval);
}
retval = _intbig_overlap((GISTTYPE *) DatumGetPointer(entry->key), query);
break;
default:
- retval = FALSE;
+ retval = false;
}
PG_FREE_IF_COPY(query, 1);
PG_RETURN_BOOL(retval);
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(key),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else if (!LTG_ISALLTRUE(entry->key))
{
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(key),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
PG_RETURN_POINTER(retval);
}
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(key),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
PG_RETURN_POINTER(retval);
}
gistentryinit(*retval, PointerGetDatum(key),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
PG_RETURN_POINTER(retval);
}
PG_RETURN_POINTER(entry);
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(res),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else if (ISSIGNKEY(DatumGetPointer(entry->key)) &&
!ISALLTRUE(DatumGetPointer(entry->key)))
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(res),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
PG_RETURN_POINTER(retval);
}
* Main entry point for evaluating a graph during index scanning.
*
* The check[] array is indexed by trigram number (in the array of simple
- * trigrams returned by createTrgmNFA), and holds TRUE for those trigrams
+ * trigrams returned by createTrgmNFA), and holds true for those trigrams
* that are present in the index entry being checked.
*/
bool
* Get vector of all color trigrams in graph and select which of them
* to expand into simple trigrams.
*
- * Returns TRUE if OK, FALSE if exhausted resource limits.
+ * Returns true if OK, false if exhausted resource limits.
*/
static bool
selectColorTrigrams(TrgmNFA *trgmNFA)
/*
** The GiST Consistent method for segments
** Should return false if for all data items x below entry,
-** the predicate x op query == FALSE, where op is the oper
+** the predicate x op query == false, where op is the oper
** corresponding to strategy in the pg_amop table.
*/
Datum
bool *result = (bool *) PG_GETARG_POINTER(2);
if (DirectFunctionCall2(seg_same, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1)))
- *result = TRUE;
+ *result = true;
else
- *result = FALSE;
+ *result = false;
#ifdef GIST_DEBUG
fprintf(stderr, "same: %s\n", (*result ? "TRUE" : "FALSE"));
retval = DirectFunctionCall2(seg_contained, key, query);
break;
default:
- retval = FALSE;
+ retval = false;
}
PG_RETURN_DATUM(retval);
DatumGetBool(DirectFunctionCall2(seg_overlap, key, query));
break;
default:
- retval = FALSE;
+ retval = false;
}
PG_RETURN_BOOL(retval);
<para>
<literal>pmatch</literal> is an output argument for use when partial match
is supported. To use it, <function>extractQuery</function> must allocate
- an array of <literal>*nkeys</literal> booleans and store its address at
- <literal>*pmatch</literal>. Each element of the array should be set to TRUE
- if the corresponding key requires partial match, FALSE if not.
+ an array of <literal>*nkeys</literal> bools and store its address at
+ <literal>*pmatch</literal>. Each element of the array should be set to true
+ if the corresponding key requires partial match, false if not.
If <literal>*pmatch</literal> is set to <symbol>NULL</symbol> then GIN assumes partial match
is not required. The variable is initialized to <symbol>NULL</symbol> before call,
so this argument can simply be ignored by operator classes that do
Datum queryKeys[], bool nullFlags[])</function></term>
<listitem>
<para>
- Returns TRUE if an indexed item satisfies the query operator with
+ Returns true if an indexed item satisfies the query operator with
strategy number <literal>n</literal> (or might satisfy it, if the recheck
indication is returned). This function does not have direct access
to the indexed item's value, since <acronym>GIN</acronym> does not
<literal>nkeys</literal>, which is the same as the number of keys previously
returned by <function>extractQuery</function> for this <literal>query</literal> datum.
Each element of the
- <literal>check</literal> array is TRUE if the indexed item contains the
- corresponding query key, i.e., if (check[i] == TRUE) the i-th key of the
+ <literal>check</literal> array is true if the indexed item contains the
+ corresponding query key, i.e., if (check[i] == true) the i-th key of the
<function>extractQuery</function> result array is present in the indexed item.
The original <literal>query</literal> datum is
passed in case the <function>consistent</function> method needs to consult it,
<para>
When <function>extractQuery</function> returns a null key in
<literal>queryKeys[]</literal>, the corresponding <literal>check[]</literal> element
- is TRUE if the indexed item contains a null key; that is, the
+ is true if the indexed item contains a null key; that is, the
semantics of <literal>check[]</literal> are like <literal>IS NOT DISTINCT
FROM</literal>. The <function>consistent</function> function can examine the
corresponding <literal>nullFlags[]</literal> element if it needs to tell
</para>
<para>
- On success, <literal>*recheck</literal> should be set to TRUE if the heap
- tuple needs to be rechecked against the query operator, or FALSE if
- the index test is exact. That is, a FALSE return value guarantees
- that the heap tuple does not match the query; a TRUE return value with
- <literal>*recheck</literal> set to FALSE guarantees that the heap tuple does
- match the query; and a TRUE return value with
- <literal>*recheck</literal> set to TRUE means that the heap tuple might match
+ On success, <literal>*recheck</literal> should be set to true if the heap
+ tuple needs to be rechecked against the query operator, or false if
+ the index test is exact. That is, a false return value guarantees
+ that the heap tuple does not match the query; a true return value with
+ <literal>*recheck</literal> set to false guarantees that the heap tuple does
+ match the query; and a true return value with
+ <literal>*recheck</literal> set to true means that the heap tuple might match
the query, so it needs to be fetched and rechecked by evaluating the
query operator directly against the originally indexed item.
</para>
<para>
The function's Boolean result value is significant only when
<literal>checkUnique</literal> is <literal>UNIQUE_CHECK_PARTIAL</literal>.
- In this case a TRUE result means the new entry is known unique, whereas
- FALSE means it might be non-unique (and a deferred uniqueness check must
- be scheduled). For other cases a constant FALSE result is recommended.
+ In this case a true result means the new entry is known unique, whereas
+ false means it might be non-unique (and a deferred uniqueness check must
+ be scheduled). For other cases a constant false result is recommended.
</para>
<para>
linkend="indexes-index-only-scans"><firstterm>index-only scans</firstterm></link> on
the given column, by returning the indexed column values for an index entry
in the form of an <structname>IndexTuple</structname>. The attribute number
- is 1-based, i.e. the first column's attno is 1. Returns TRUE if supported,
- else FALSE. If the access method does not support index-only scans at all,
+ is 1-based, i.e. the first column's attno is 1. Returns true if supported,
+ else false. If the access method does not support index-only scans at all,
the <structfield>amcanreturn</structfield> field in its <structname>IndexAmRoutine</structname>
struct can be set to NULL.
</para>
ScanDirection direction);
</programlisting>
Fetch the next tuple in the given scan, moving in the given
- direction (forward or backward in the index). Returns TRUE if a tuple was
- obtained, FALSE if no matching tuples remain. In the TRUE case the tuple
+ direction (forward or backward in the index). Returns true if a tuple was
+ obtained, false if no matching tuples remain. In the true case the tuple
TID is stored into the <literal>scan</literal> structure. Note that
<quote>success</quote> means only that the index contains an entry that matches
the scan keys, not that the tuple necessarily still exists in the heap or
will pass the caller's snapshot test. On success, <function>amgettuple</function>
- must also set <literal>scan->xs_recheck</literal> to TRUE or FALSE.
- FALSE means it is certain that the index entry matches the scan keys.
- TRUE means this is not certain, and the conditions represented by the
+ must also set <literal>scan->xs_recheck</literal> to true or false.
+ False means it is certain that the index entry matches the scan keys.
+ true means this is not certain, and the conditions represented by the
scan keys must be rechecked against the heap tuple after fetching it.
This provision supports <quote>lossy</quote> index operators.
Note that rechecking will extend only to the scan conditions; a partial
<para>
If the index supports <link linkend="indexes-index-only-scans">index-only
- scans</link> (i.e., <function>amcanreturn</function> returns TRUE for it),
+ scans</link> (i.e., <function>amcanreturn</function> returns true for it),
then on success the AM must also check <literal>scan->xs_want_itup</literal>,
and if that is true it must return the originally indexed data for the
index entry. The data can be returned in the form of an
constraint is deferrable. <productname>PostgreSQL</productname>
will use this mode to insert each row's index entry. The access
method must allow duplicate entries into the index, and report any
- potential duplicates by returning FALSE from <function>aminsert</function>.
- For each row for which FALSE is returned, a deferred recheck will
+ potential duplicates by returning false from <function>aminsert</function>.
+ For each row for which false is returned, a deferred recheck will
be scheduled.
</para>
break;
}
- /* unknown event ID, just return TRUE. */
+ /* unknown event ID, just return true. */
default:
break;
}
- return TRUE; /* event processing succeeded */
+ return true; /* event processing succeeded */
}
]]>
</programlisting>
trees, in which each level of the tree includes a prefix that is short
enough to fit on a page, and the final leaf level includes a suffix also
short enough to fit on a page. The operator class should set
- <structfield>longValuesOK</structfield> to TRUE only if it is prepared to arrange for
+ <structfield>longValuesOK</structfield> to true only if it is prepared to arrange for
this to happen. Otherwise, the <acronym>SP-GiST</acronym> core will
reject any request to index a value that is too large to fit
on an index page.
</term>
<listitem>
<para>
- Returns TRUE if current connection to server uses SSL, and FALSE
+ Returns true if current connection to server uses SSL, and false
otherwise.
</para>
</listitem>
</term>
<listitem>
<para>
- Returns TRUE if current client has presented a valid SSL client
- certificate to the server, and FALSE otherwise. (The server
+ Returns true if current client has presented a valid SSL client
+ certificate to the server, and false otherwise. (The server
might or might not be configured to require a client certificate.)
</para>
</listitem>
*
* Index must be locked in ShareUpdateExclusiveLock mode.
*
- * Return FALSE if caller should retry.
+ * Return false if caller should retry.
*/
bool
brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
*/
/* ----------------
- * heap_attisnull - returns TRUE iff tuple attribute is not present
+ * heap_attisnull - returns true iff tuple attribute is not present
* ----------------
*/
bool
page = BufferGetPage(buffer);
if (GinPageIsLeaf(page))
{
- if (searchMode == FALSE)
+ if (searchMode == false)
{
/* we should relock our page */
LockBuffer(buffer, GIN_UNLOCK);
* ok, page is correctly locked, we should check to move right ..,
* root never has a right link, so small optimization
*/
- while (btree->fullScan == FALSE && stack->blkno != btree->rootBlkno &&
+ while (btree->fullScan == false && stack->blkno != btree->rootBlkno &&
btree->isMoveRight(btree, page))
{
BlockNumber rightlink = GinPageGetOpaque(page)->rightlink;
}
/* If item pointers are not ordered, they will need to be sorted later */
- if (eo->shouldSort == FALSE)
+ if (eo->shouldSort == false)
{
int res;
Assert(res != 0);
if (res > 0)
- eo->shouldSort = TRUE;
+ eo->shouldSort = true;
}
eo->list[eo->count] = en->list[0];
ea->key = getDatumCopy(accum, attnum, key);
ea->maxcount = DEF_NPTR;
ea->count = 1;
- ea->shouldSort = FALSE;
+ ea->shouldSort = false;
ea->list =
(ItemPointerData *) palloc(sizeof(ItemPointerData) * DEF_NPTR);
ea->list[0] = *heapptr;
ItemPointer iptr = GinDataPageGetRightBound(page);
if (GinPageRightMost(page))
- return FALSE;
+ return false;
- return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? TRUE : FALSE;
+ return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? true : false;
}
/*
btree->fillRoot = ginDataFillRoot;
btree->prepareDownlink = dataPrepareDownlink;
- btree->isData = TRUE;
- btree->fullScan = FALSE;
- btree->isBuild = FALSE;
+ btree->isData = true;
+ btree->fullScan = false;
+ btree->isBuild = false;
}
/*
ginPrepareDataScan(btree, index, rootBlkno);
- btree->fullScan = TRUE;
+ btree->fullScan = true;
- stack = ginFindLeafPage(btree, TRUE, snapshot);
+ stack = ginFindLeafPage(btree, true, snapshot);
return stack;
}
* Form a tuple for entry tree.
*
* If the tuple would be too big to be stored, function throws a suitable
- * error if errorTooBig is TRUE, or returns NULL if errorTooBig is FALSE.
+ * error if errorTooBig is true, or returns NULL if errorTooBig is false.
*
* See src/backend/access/gin/README for a description of the index tuple
* format that is being built here. We build on the assumption that we
GinNullCategory category;
if (GinPageRightMost(page))
- return FALSE;
+ return false;
itup = getRightMostTuple(page);
attnum = gintuple_get_attrnum(btree->ginstate, itup);
if (ginCompareAttEntries(btree->ginstate,
btree->entryAttnum, btree->entryKey, btree->entryCategory,
attnum, key, category) > 0)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
/*
if (btree->fullScan)
{
stack->off = FirstOffsetNumber;
- return TRUE;
+ return true;
}
low = FirstOffsetNumber;
btree->fillRoot = ginEntryFillRoot;
btree->prepareDownlink = entryPrepareDownlink;
- btree->isData = FALSE;
- btree->fullScan = FALSE;
- btree->isBuild = FALSE;
+ btree->isData = false;
+ btree->fullScan = false;
+ btree->isBuild = false;
btree->entryAttnum = attnum;
btree->entryKey = key;
entry->nlist = 0;
entry->matchBitmap = NULL;
entry->matchResult = NULL;
- entry->reduceResult = FALSE;
+ entry->reduceResult = false;
entry->predictNumberResult = 0;
/*
stackEntry = ginFindLeafPage(&btreeEntry, true, snapshot);
page = BufferGetPage(stackEntry->buffer);
/* ginFindLeafPage() will have already checked snapshot age. */
- needUnlock = TRUE;
+ needUnlock = true;
- entry->isFinished = TRUE;
+ entry->isFinished = true;
if (entry->isPartialMatch ||
entry->queryCategory == GIN_CAT_EMPTY_QUERY)
if (entry->matchBitmap && !tbm_is_empty(entry->matchBitmap))
{
entry->matchIterator = tbm_begin_iterate(entry->matchBitmap);
- entry->isFinished = FALSE;
+ entry->isFinished = false;
}
}
else if (btreeEntry.findItem(&btreeEntry, stackEntry))
* root of posting tree.
*/
LockBuffer(stackEntry->buffer, GIN_UNLOCK);
- needUnlock = FALSE;
+ needUnlock = false;
stack = ginScanBeginPostingTree(&entry->btree, ginstate->index,
rootPostingTree, snapshot);
LockBuffer(entry->buffer, GIN_UNLOCK);
freeGinBtreeStack(stack);
- entry->isFinished = FALSE;
+ entry->isFinished = false;
}
else if (GinGetNPosting(itup) > 0)
{
&entry->nlist);
entry->predictNumberResult = entry->nlist;
- entry->isFinished = FALSE;
+ entry->isFinished = false;
}
}
for (i = 0; i < so->totalentries; i++)
{
so->entries[i]->predictNumberResult /= so->totalentries;
- so->entries[i]->reduceResult = TRUE;
+ so->entries[i]->reduceResult = true;
}
}
}
{
UnlockReleaseBuffer(entry->buffer);
entry->buffer = InvalidBuffer;
- entry->isFinished = TRUE;
+ entry->isFinished = true;
return;
}
/*
* Sets entry->curItem to next heap item pointer > advancePast, for one entry
- * of one scan key, or sets entry->isFinished to TRUE if there are no more.
+ * of one scan key, or sets entry->isFinished to true if there are no more.
*
* Item pointers are returned in ascending order.
*
ItemPointerSetInvalid(&entry->curItem);
tbm_end_iterate(entry->matchIterator);
entry->matchIterator = NULL;
- entry->isFinished = TRUE;
+ entry->isFinished = true;
break;
}
entry->matchResult->offsets[entry->offset]);
entry->offset++;
gotitem = true;
- } while (!gotitem || (entry->reduceResult == TRUE && dropItem(entry)));
+ } while (!gotitem || (entry->reduceResult == true && dropItem(entry)));
}
else if (!BufferIsValid(entry->buffer))
{
if (entry->offset >= entry->nlist)
{
ItemPointerSetInvalid(&entry->curItem);
- entry->isFinished = TRUE;
+ entry->isFinished = true;
break;
}
entry->curItem = entry->list[entry->offset++];
} while (ginCompareItemPointers(&entry->curItem, &advancePast) <= 0 ||
- (entry->reduceResult == TRUE && dropItem(entry)));
+ (entry->reduceResult == true && dropItem(entry)));
}
}
* iff recheck is needed for this item pointer (including the case where the
* item pointer is a lossy page pointer).
*
- * If all entry streams are exhausted, sets key->isFinished to TRUE.
+ * If all entry streams are exhausted, sets key->isFinished to true.
*
* Item pointers must be returned in ascending order.
*
if (allFinished)
{
/* all entries are finished */
- key->isFinished = TRUE;
+ key->isFinished = true;
return;
}
* them. We could pass them as MAYBE as well, but if we're using the
* "shim" implementation of a tri-state consistent function (see
* ginlogic.c), it's better to pass as few MAYBEs as possible. So pass
- * them as TRUE.
+ * them as true.
*
* Note that only lossy-page entries pointing to the current item's page
* should trigger this processing; we might have future lossy pages in the
for (i = 0; i < key->nentries; i++)
{
entry = key->scanEntry[i];
- if (entry->isFinished == FALSE &&
+ if (entry->isFinished == false &&
ginCompareItemPointers(&entry->curItem, &curPageLossy) == 0)
{
if (i < key->nuserentries)
}
}
- return TRUE;
+ return true;
}
memset(key->entryRes, GIN_FALSE, key->nentries);
}
- memset(pos->hasMatchKey, FALSE, so->nkeys);
+ memset(pos->hasMatchKey, false, so->nkeys);
/*
* Outer loop iterates over multiple pending-list pages when a single heap
IndexTuple itup;
Page page;
- insertdata.isDelete = FALSE;
+ insertdata.isDelete = false;
/* During index build, count the to-be-inserted entry */
if (buildStats)
itup = addItemPointersToLeafTuple(ginstate, itup,
items, nitem, buildStats);
- insertdata.isDelete = TRUE;
+ insertdata.isDelete = true;
}
else
{
DataPageDeleteStack *me;
Buffer buffer;
Page page;
- bool meDelete = FALSE;
+ bool meDelete = false;
bool isempty;
if (isRoot)
{
PostingItem *pitem = GinDataPageGetPostingItem(page, i);
- if (ginScanToDelete(gvs, PostingItemGetBlockNumber(pitem), FALSE, me, i))
+ if (ginScanToDelete(gvs, PostingItemGetBlockNumber(pitem), false, me, i))
i--;
}
}
{
Assert(!isRoot);
ginDeletePage(gvs, blkno, me->leftBlkno, me->parent->blkno, myoff, me->parent->isRoot);
- meDelete = TRUE;
+ meDelete = true;
}
}
{
Buffer buffer;
Page page;
- bool hasVoidPage = FALSE;
+ bool hasVoidPage = false;
MemoryContext oldCxt;
buffer = ReadBufferExtended(gvs->index, MAIN_FORKNUM, blkno,
/* if root is a leaf page, we don't desire further processing */
if (GinDataLeafPageIsEmpty(page))
- hasVoidPage = TRUE;
+ hasVoidPage = true;
UnlockReleaseBuffer(buffer);
else
{
OffsetNumber i;
- bool hasEmptyChild = FALSE;
- bool hasNonEmptyChild = FALSE;
+ bool hasEmptyChild = false;
+ bool hasNonEmptyChild = false;
OffsetNumber maxoff = GinPageGetOpaque(page)->maxoff;
BlockNumber *children = palloc(sizeof(BlockNumber) * (maxoff + 1));
for (i = FirstOffsetNumber; i <= maxoff; i++)
{
- if (ginVacuumPostingTreeLeaves(gvs, children[i], FALSE))
- hasEmptyChild = TRUE;
+ if (ginVacuumPostingTreeLeaves(gvs, children[i], false))
+ hasEmptyChild = true;
else
- hasNonEmptyChild = TRUE;
+ hasNonEmptyChild = true;
}
pfree(children);
vacuum_delay_point();
/*
- * All subtree is empty - just return TRUE to indicate that parent
+ * All subtree is empty - just return true to indicate that parent
* must do a cleanup. Unless we are ROOT an there is way to go upper.
*/
if (hasEmptyChild && !hasNonEmptyChild && !isRoot)
- return TRUE;
+ return true;
if (hasEmptyChild)
{
memset(&root, 0, sizeof(DataPageDeleteStack));
root.leftBlkno = InvalidBlockNumber;
- root.isRoot = TRUE;
+ root.isRoot = true;
- ginScanToDelete(gvs, blkno, TRUE, &root, InvalidOffsetNumber);
+ ginScanToDelete(gvs, blkno, true, &root, InvalidOffsetNumber);
ptr = root.child;
}
/* Here we have deleted all empty subtrees */
- return FALSE;
+ return false;
}
}
static void
ginVacuumPostingTree(GinVacuumState *gvs, BlockNumber rootBlkno)
{
- ginVacuumPostingTreeLeaves(gvs, rootBlkno, TRUE);
+ ginVacuumPostingTreeLeaves(gvs, rootBlkno, true);
}
/*
IndexTupleSize(itup[0]), GiSTPageSize,
RelationGetRelationName(r))));
- memset(v.spl_lisnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
- memset(v.spl_risnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);
+ memset(v.spl_lisnull, true, sizeof(bool) * giststate->tupdesc->natts);
+ memset(v.spl_risnull, true, sizeof(bool) * giststate->tupdesc->natts);
gistSplitByKey(r, page, itup, len, giststate, &v, 0);
/* form left and right vector */
gistdentryinit(giststate, key->sk_attno - 1, &de,
datum, r, page, offset,
- FALSE, isNull);
+ false, isNull);
/*
* Call the Consistent function to evaluate the test. The
gistdentryinit(giststate, key->sk_attno - 1, &de,
datum, r, page, offset,
- FALSE, isNull);
+ false, isNull);
/*
* Call the Distance function to evaluate the distance. The
* The GiST Consistent method for boxes
*
* Should return false if for all data items x below entry,
- * the predicate x op query must be FALSE, where op is the oper
+ * the predicate x op query must be false, where op is the oper
* corresponding to strategy in the pg_amop table.
*/
Datum
*recheck = false;
if (DatumGetBoxP(entry->key) == NULL || query == NULL)
- PG_RETURN_BOOL(FALSE);
+ PG_RETURN_BOOL(false);
/*
* if entry is not leaf, use rtree_internal_consistent, else use
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else
retval = entry;
*recheck = true;
if (DatumGetBoxP(entry->key) == NULL || query == NULL)
- PG_RETURN_BOOL(FALSE);
+ PG_RETURN_BOOL(false);
/*
* Since the operators require recheck anyway, we can just use
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else
retval = entry;
*recheck = true;
if (DatumGetBoxP(entry->key) == NULL || query == NULL)
- PG_RETURN_BOOL(FALSE);
+ PG_RETURN_BOOL(false);
/*
* Since the operators require recheck anyway, we can just use
box->high = box->low = *point;
gistentryinit(*retval, BoxPGetDatum(box),
- entry->rel, entry->page, entry->offset, FALSE);
+ entry->rel, entry->page, entry->offset, false);
PG_RETURN_POINTER(retval);
}
r->y = in->high.y;
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
PG_RETURN_POINTER(retval);
}
* check for nulls
*/
gistentryinit(entry, spl->splitVector.spl_rdatum, r, NULL,
- (OffsetNumber) 0, FALSE);
+ (OffsetNumber) 0, false);
for (i = 0; i < spl->splitVector.spl_nleft; i++)
{
int j = spl->splitVector.spl_left[i];
/* And conversely for the right-side tuples */
gistentryinit(entry, spl->splitVector.spl_ldatum, r, NULL,
- (OffsetNumber) 0, FALSE);
+ (OffsetNumber) 0, false);
for (i = 0; i < spl->splitVector.spl_nright; i++)
{
int j = spl->splitVector.spl_right[i];
{
OffsetNumber ai = a[i];
- if (dontcare[ai] == FALSE)
+ if (dontcare[ai] == false)
{
/* re-emit item into a[] */
*curwpos = ai;
rpenalty;
GISTENTRY entry;
- gistentryinit(entry, v->spl_lattr[attno], r, NULL, 0, FALSE);
+ gistentryinit(entry, v->spl_lattr[attno], r, NULL, 0, false);
lpenalty = gistpenalty(giststate, attno, &entry, v->spl_lisnull[attno],
identry + attno, isnull[attno]);
- gistentryinit(entry, v->spl_rattr[attno], r, NULL, 0, FALSE);
+ gistentryinit(entry, v->spl_rattr[attno], r, NULL, 0, false);
rpenalty = gistpenalty(giststate, attno, &entry, v->spl_risnull[attno],
identry + attno, isnull[attno]);
entrySL,
entrySR;
- gistentryinit(entryL, oldL, r, NULL, 0, FALSE);
- gistentryinit(entryR, oldR, r, NULL, 0, FALSE);
- gistentryinit(entrySL, sv->spl_ldatum, r, NULL, 0, FALSE);
- gistentryinit(entrySR, sv->spl_rdatum, r, NULL, 0, FALSE);
+ gistentryinit(entryL, oldL, r, NULL, 0, false);
+ gistentryinit(entryR, oldR, r, NULL, 0, false);
+ gistentryinit(entrySL, sv->spl_ldatum, r, NULL, 0, false);
+ gistentryinit(entrySR, sv->spl_rdatum, r, NULL, 0, false);
if (sv->spl_ldatum_exists && sv->spl_rdatum_exists)
{
SWAPVAR(sv->spl_left, sv->spl_right, off);
SWAPVAR(sv->spl_nleft, sv->spl_nright, noff);
SWAPVAR(sv->spl_ldatum, sv->spl_rdatum, datum);
- gistentryinit(entrySL, sv->spl_ldatum, r, NULL, 0, FALSE);
- gistentryinit(entrySR, sv->spl_rdatum, r, NULL, 0, FALSE);
+ gistentryinit(entrySL, sv->spl_ldatum, r, NULL, 0, false);
+ gistentryinit(entrySR, sv->spl_rdatum, r, NULL, 0, false);
}
if (sv->spl_ldatum_exists)
* Calls user picksplit method for attno column to split tuples into
* two vectors.
*
- * Returns FALSE if split is complete (there are no more index columns, or
+ * Returns false if split is complete (there are no more index columns, or
* there is no need to consider them because split is optimal already).
*
- * Returns TRUE and v->spl_dontcare = NULL if the picksplit result is
+ * Returns true and v->spl_dontcare = NULL if the picksplit result is
* degenerate (all tuples seem to be don't-cares), so we should just
* disregard this column and split on the next column(s) instead.
*
- * Returns TRUE and v->spl_dontcare != NULL if there are don't-care tuples
+ * Returns true and v->spl_dontcare != NULL if there are don't-care tuples
* that could be relocated based on the next column(s). The don't-care
* tuples have been removed from the split and must be reinserted by caller.
* There is at least one non-don't-care tuple on each side of the split,
* and union keys for all columns are updated to include just those tuples.
*
- * A TRUE result implies there is at least one more index column.
+ * A true result implies there is at least one more index column.
*/
static bool
gistUserPicksplit(Relation r, GistEntryVector *entryvec, int attno, GistSplitVector *v,
* attno: column we are working on (zero-based index)
*
* Outside caller must initialize v->spl_lisnull and v->spl_risnull arrays
- * to all-TRUE. On return, spl_left/spl_nleft contain indexes of tuples
+ * to all-true. On return, spl_left/spl_nleft contain indexes of tuples
* to go left, spl_right/spl_nright contain indexes of tuples to go right,
* spl_lattr/spl_lisnull contain left-side union key values, and
* spl_rattr/spl_risnull contain right-side union key values. Other fields
&IsNull);
gistdentryinit(giststate, attno, &(entryvec->vector[i]),
datum, r, page, i,
- FALSE, IsNull);
+ false, IsNull);
if (IsNull)
offNullTuples[nOffNullTuples++] = i;
}
* our attention to the next column. If there's no next column, just
* split page in half.
*/
- v->spl_risnull[attno] = v->spl_lisnull[attno] = TRUE;
+ v->spl_risnull[attno] = v->spl_lisnull[attno] = true;
if (attno + 1 < giststate->tupdesc->natts)
gistSplitByKey(r, page, itup, len, giststate, v, attno + 1);
*/
v->splitVector.spl_right = offNullTuples;
v->splitVector.spl_nright = nOffNullTuples;
- v->spl_risnull[attno] = TRUE;
+ v->spl_risnull[attno] = true;
v->splitVector.spl_left = (OffsetNumber *) palloc(len * sizeof(OffsetNumber));
v->splitVector.spl_nleft = 0;
evec->vector + evec->n,
datum,
NULL, NULL, (OffsetNumber) 0,
- FALSE, IsNull);
+ false, IsNull);
evec->n++;
}
if (evec->n == 0)
{
attr[i] = (Datum) 0;
- isnull[i] = TRUE;
+ isnull[i] = true;
}
else
{
PointerGetDatum(evec),
PointerGetDatum(&attrsize));
- isnull[i] = FALSE;
+ isnull[i] = false;
}
}
}
if (isnull1 && isnull2)
{
- *dstisnull = TRUE;
+ *dstisnull = true;
*dst = (Datum) 0;
}
else
{
- if (isnull1 == FALSE && isnull2 == FALSE)
+ if (isnull1 == false && isnull2 == false)
{
evec->vector[0] = *entry1;
evec->vector[1] = *entry2;
}
- else if (isnull1 == FALSE)
+ else if (isnull1 == false)
{
evec->vector[0] = *entry1;
evec->vector[1] = *entry1;
evec->vector[1] = *entry2;
}
- *dstisnull = FALSE;
+ *dstisnull = false;
*dst = FunctionCall2Coll(&giststate->unionFn[attno],
giststate->supportCollation[attno],
PointerGetDatum(evec),
datum = index_getattr(tuple, i + 1, giststate->tupdesc, &isnull[i]);
gistdentryinit(giststate, i, &attdata[i],
datum, r, p, o,
- FALSE, isnull[i]);
+ false, isnull[i]);
}
}
IndexTuple
gistgetadjusted(Relation r, IndexTuple oldtup, IndexTuple addtup, GISTSTATE *giststate)
{
- bool neednew = FALSE;
+ bool neednew = false;
GISTENTRY oldentries[INDEX_MAX_KEYS],
addentries[INDEX_MAX_KEYS];
bool oldisnull[INDEX_MAX_KEYS],
/* Compute penalty for this column. */
datum = index_getattr(itup, j + 1, giststate->tupdesc, &IsNull);
gistdentryinit(giststate, j, &entry, datum, r, p, i,
- FALSE, IsNull);
+ false, IsNull);
usize = gistpenalty(giststate, j, &entry, IsNull,
&identry[j], isnull[j]);
if (usize > 0)
{
float penalty = 0.0;
- if (giststate->penaltyFn[attno].fn_strict == FALSE ||
- (isNullOrig == FALSE && isNullAdd == FALSE))
+ if (giststate->penaltyFn[attno].fn_strict == false ||
+ (isNullOrig == false && isNullAdd == false))
{
FunctionCall3Coll(&giststate->penaltyFn[attno],
giststate->supportCollation[attno],
* for the purpose. OTOH, adding a splitpoint is a very infrequent operation,
* so it may not be worth worrying about.
*
- * Returns TRUE if successful, or FALSE if allocation failed due to
+ * Returns true if successful, or false if allocation failed due to
* BlockNumber overflow.
*/
static bool
* On successful exit, scan->xs_ctup.t_self is set to the TID
* of the next heap tuple. so->currPos is updated as needed.
*
- * On failure exit (no more tuples), we return FALSE with pin
+ * On failure exit (no more tuples), we return false with pin
* held on bucket page but no pins or locks held on overflow
* page.
*/
* tuple(s) on the page has been loaded into so->currPos,
* scan->xs_ctup.t_self is set to the heap TID of the current tuple.
*
- * On failure exit (no more tuples), we return FALSE, with pin held on
+ * On failure exit (no more tuples), we return false, with pin held on
* bucket page but no pins or locks held on overflow page.
*/
bool
{
/*
* Remember next and previous block numbers for scrollable
- * cursors to know the start position and return FALSE
+ * cursors to know the start position and return false
* indicating that no more matching tuples were found. Also,
* don't reset currPage or lsn, because we expect
* _hash_kill_items to be called for the old page after this
{
/*
* Remember next and previous block numbers for scrollable
- * cursors to know the start position and return FALSE
+ * cursors to know the start position and return false
* indicating that no more matching tuples were found. Also,
* don't reset currPage or lsn, because we expect
* _hash_kill_items to be called for the old page after this
* heap_beginscan_strat offers an extended API that lets the caller control
* whether a nondefault buffer access strategy can be used, and whether
* syncscan can be chosen (possibly resulting in the scan not starting from
- * block zero). Both of these default to TRUE with plain heap_beginscan.
+ * block zero). Both of these default to true with plain heap_beginscan.
*
* heap_beginscan_bm is an alternative entry point for setting up a
* HeapScanDesc for a bitmap heap scan. Although that scan technology is
* against the specified snapshot.
*
* If successful (tuple found and passes snapshot time qual), then *userbuf
- * is set to the buffer holding the tuple and TRUE is returned. The caller
+ * is set to the buffer holding the tuple and true is returned. The caller
* must unpin the buffer when done with the tuple.
*
* If the tuple is not found (ie, item number references a deleted slot),
- * then tuple->t_data is set to NULL and FALSE is returned.
+ * then tuple->t_data is set to NULL and false is returned.
*
- * If the tuple is found but fails the time qual check, then FALSE is returned
+ * If the tuple is found but fails the time qual check, then false is returned
* but tuple->t_data is left pointing to the tuple.
*
- * keep_buf determines what is done with the buffer in the FALSE-result cases.
+ * keep_buf determines what is done with the buffer in the false-result cases.
* When the caller specifies keep_buf = true, we retain the pin on the buffer
* and return it in *userbuf (so the caller must eventually unpin it); when
* keep_buf = false, the pin is released and *userbuf is set to InvalidBuffer.
* of a HOT chain), and buffer is the buffer holding this tuple. We search
* for the first chain member satisfying the given snapshot. If one is
* found, we update *tid to reference that tuple's offset number, and
- * return TRUE. If no match, return FALSE without modifying *tid.
+ * return true. If no match, return false without modifying *tid.
*
* heapTuple is a caller-supplied buffer. When a match is found, we return
* the tuple here, in addition to updating *tid. If no match is found, the
* contents of this buffer on return are undefined.
*
* If all_dead is not NULL, we check non-visible tuples to see if they are
- * globally dead; *all_dead is set TRUE if all members of the HOT chain
- * are vacuumable, FALSE if not.
+ * globally dead; *all_dead is set true if all members of the HOT chain
+ * are vacuumable, false if not.
*
* Unlike heap_fetch, the caller must already have pin and (at least) share
* lock on the buffer; it is still pinned/locked at exit. Also unlike
* Check to see whether any of the XID fields of a tuple (xmin, xmax, xvac)
* are older than the specified cutoff XID and cutoff MultiXactId. If so,
* setup enough state (in the *frz output argument) to later execute and
- * WAL-log what we would need to do, and return TRUE. Return FALSE if nothing
+ * WAL-log what we would need to do, and return true. Return false if nothing
* is to be changed. In addition, set *totally_frozen_p to true if the tuple
* will be totally frozen after these operations are performed and false if
* more freezing will eventually be required.
* heap_tuple_needs_freeze
*
* Check to see whether any of the XID fields of a tuple (xmin, xmax, xvac)
- * are older than the specified cutoff XID or MultiXactId. If so, return TRUE.
+ * are older than the specified cutoff XID or MultiXactId. If so, return true.
*
* It doesn't matter whether the tuple is alive or dead, we are checking
* to see if a tuple needs to be removed or frozen to avoid wraparound.
OffsetNumber redirected[MaxHeapTuplesPerPage * 2];
OffsetNumber nowdead[MaxHeapTuplesPerPage];
OffsetNumber nowunused[MaxHeapTuplesPerPage];
- /* marked[i] is TRUE if item i is entered in one of the above arrays */
+ /* marked[i] is true if item i is entered in one of the above arrays */
bool marked[MaxHeapTuplesPerPage + 1];
} PruneState;
* or RECENTLY_DEAD (see HeapTupleSatisfiesVacuum).
*
* If report_stats is true then we send the number of reclaimed heap-only
- * tuples to pgstats. (This must be FALSE during vacuum, since vacuum will
+ * tuples to pgstats. (This must be false during vacuum, since vacuum will
* send its own new total to pgstats, and we don't want this delta applied
* on top of that.)
*
/*
* Validate the signature (argument and result types) of an opclass support
- * function. Return TRUE if OK, FALSE if not.
+ * function. Return true if OK, false if not.
*
- * The "..." represents maxargs argument-type OIDs. If "exact" is TRUE, they
+ * The "..." represents maxargs argument-type OIDs. If "exact" is true, they
* must match the function arg types exactly, else only binary-coercibly.
* In any case the function result type must match restype exactly.
*/
/*
* Validate the signature (argument and result types) of an opclass operator.
- * Return TRUE if OK, FALSE if not.
+ * Return true if OK, false if not.
*
* Currently, we can hard-wire this as accepting only binary operators. Also,
* we can insist on exact type matches, since the given lefttype/righttype
{
RELATION_CHECKS;
- /* amcanreturn is optional; assume FALSE if not provided by AM */
+ /* amcanreturn is optional; assume false if not provided by AM */
if (indexRelation->rd_amroutine->amcanreturn == NULL)
return false;
* don't actually insert.
*
* The result value is only significant for UNIQUE_CHECK_PARTIAL:
- * it must be TRUE if the entry is known unique, else FALSE.
- * (In the current implementation we'll also return TRUE after a
+ * it must be true if the entry is known unique, else false.
+ * (In the current implementation we'll also return true after a
* successful UNIQUE_CHECK_YES or UNIQUE_CHECK_EXISTING call, but
* that's just a coding artifact.)
*/
* scan->xs_ctup.t_self is set to the heap TID of the current tuple,
* and if requested, scan->xs_itup points to a copy of the index tuple.
*
- * If there are no matching items in the index, we return FALSE, with no
+ * If there are no matching items in the index, we return false, with no
* pins or locks held.
*
* Note that scan->keyData[], and the so->keyData[] scankey built from it,
*
* For success on a scan using a non-MVCC snapshot we hold a pin, but not a
* read lock, on that page. If we do not hold the pin, we set so->currPos.buf
- * to InvalidBuffer. We return TRUE to indicate success.
+ * to InvalidBuffer. We return true to indicate success.
*/
static bool
_bt_steppage(IndexScanDesc scan, ScanDirection dir)
*
* On success exit, so->currPos is updated to contain data from the next
* interesting page. Caller is responsible to release lock and pin on
- * buffer on success. We return TRUE to indicate success.
+ * buffer on success. We return true to indicate success.
*
* If there are no more matching records in the given direction, we drop all
- * locks and pins, set so->currPos.buf to InvalidBuffer, and return FALSE.
+ * locks and pins, set so->currPos.buf to InvalidBuffer, and return false.
*/
static bool
_bt_readnextpage(IndexScanDesc scan, BlockNumber blkno, ScanDirection dir)
/*
* _bt_parallel_readpage() -- Read current page containing valid data for scan
*
- * On success, release lock and maybe pin on buffer. We return TRUE to
+ * On success, release lock and maybe pin on buffer. We return true to
* indicate success.
*/
static bool
/*
* _bt_advance_array_keys() -- Advance to next set of array elements
*
- * Returns TRUE if there is another set of values to consider, FALSE if not.
- * On TRUE result, the scankeys are initialized with the next set of values.
+ * Returns true if there is another set of values to consider, false if not.
+ * On true result, the scankeys are initialized with the next set of values.
*/
bool
_bt_advance_array_keys(IndexScanDesc scan, ScanDirection dir)
* for a forward scan; or after the last match for a backward scan.)
*
* As a byproduct of this work, we can detect contradictory quals such
- * as "x = 1 AND x > 2". If we see that, we return so->qual_ok = FALSE,
+ * as "x = 1 AND x > 2". If we see that, we return so->qual_ok = false,
* indicating the scan need not be run at all since no tuples can match.
* (In this case we do not bother completing the output key array!)
* Again, missing cross-type operators might cause us to fail to prove the
*
* If the opfamily doesn't supply a complete set of cross-type operators we
* may not be able to make the comparison. If we can make the comparison
- * we store the operator result in *result and return TRUE. We return FALSE
+ * we store the operator result in *result and return true. We return false
* if the comparison could not be made.
*
* Note: op always points at the same ScanKey as either leftarg or rightarg.
*
* Lastly, for ordinary scankeys (not IS NULL/NOT NULL), we check for a
* NULL comparison value. Since all btree operators are assumed strict,
- * a NULL means that the qual cannot be satisfied. We return TRUE if the
- * comparison value isn't NULL, or FALSE if the scan should be abandoned.
+ * a NULL means that the qual cannot be satisfied. We return true if the
+ * comparison value isn't NULL, or false if the scan should be abandoned.
*
* This function is applied to the *input* scankey structure; therefore
* on a rescan we will be looking at already-processed scankeys. Hence
* Test to see if the user-defined picksplit function failed to do its job,
* ie, it put all the leaf tuples into the same node.
* If so, randomly divide the tuples into several nodes (all with the same
- * label) and return TRUE to select allTheSame mode for this inner tuple.
+ * label) and return true to select allTheSame mode for this inner tuple.
*
* (This code is also used to forcibly select allTheSame mode for nulls.)
*
/*
* Initialize (or reinitialize) a page of CLOG to zeroes.
- * If writeXlog is TRUE, also emit an XLOG record saying we did this.
+ * If writeXlog is true, also emit an XLOG record saying we did this.
*
* The page is not actually written, just set up in shared memory.
* The slot number of the new page is returned.
/*
* Initialize (or reinitialize) a page of CommitTs to zeroes.
- * If writeXlog is TRUE, also emit an XLOG record saying we did this.
+ * If writeXlog is true, also emit an XLOG record saying we did this.
*
* The page is not actually written, just set up in shared memory.
* The slot number of the new page is returned.
/*
* Initialize (or reinitialize) a page of MultiXactOffset to zeroes.
- * If writeXlog is TRUE, also emit an XLOG record saying we did this.
+ * If writeXlog is true, also emit an XLOG record saying we did this.
*
* The page is not actually written, just set up in shared memory.
* The slot number of the new page is returned.
* Physical read of a (previously existing) page into a buffer slot
*
* On failure, we cannot just ereport(ERROR) since caller has put state in
- * shared memory that must be undone. So, we return FALSE and save enough
+ * shared memory that must be undone. So, we return false and save enough
* info in static variables to let SlruReportIOError make the report.
*
* For now, assume it's not worth keeping a file pointer open across
* Physical write of a page from a buffer slot
*
* On failure, we cannot just ereport(ERROR) since caller has put state in
- * shared memory that must be undone. So, we return FALSE and save enough
+ * shared memory that must be undone. So, we return false and save enough
* info in static variables to let SlruReportIOError make the report.
*
* For now, assume it's not worth keeping a file pointer open across
Oid owner; /* ID of user that executed the xact */
BackendId locking_backend; /* backend currently working on the xact */
- bool valid; /* TRUE if PGPROC entry is in proc array */
- bool ondisk; /* TRUE if prepare state file is on disk */
- bool inredo; /* TRUE if entry was added via xlog_redo */
+ bool valid; /* true if PGPROC entry is in proc array */
+ bool ondisk; /* true if prepare state file is on disk */
+ bool inredo; /* true if entry was added via xlog_redo */
char gid[GIDSIZE]; /* The GID assigned to the prepared xact */
} GlobalTransactionData;
/*
* GetCurrentCommandId
*
- * "used" must be TRUE if the caller intends to use the command ID to mark
- * inserted/updated/deleted tuples. FALSE means the ID is being fetched
+ * "used" must be true if the caller intends to use the command ID to mark
+ * inserted/updated/deleted tuples. false means the ID is being fetched
* for read-only purposes (ie, as a snapshot validity cutoff). See
* CommandCounterIncrement() for discussion.
*/
* This executes a PREPARE command.
*
* Since PREPARE may actually do a ROLLBACK, the result indicates what
- * happened: TRUE for PREPARE, FALSE for ROLLBACK.
+ * happened: true for PREPARE, false for ROLLBACK.
*
* Note that we don't actually do anything here except change blockState.
* The real work will be done in the upcoming PrepareTransaction().
* This executes a COMMIT command.
*
* Since COMMIT may actually do a ROLLBACK, the result indicates what
- * happened: TRUE for COMMIT, FALSE for ROLLBACK.
+ * happened: true for COMMIT, false for ROLLBACK.
*
* Note that we don't actually do anything here except change blockState.
* The real work will be done in the upcoming CommitTransactionCommand().
/*
* Write and/or fsync the log at least as far as WriteRqst indicates.
*
- * If flexible == TRUE, we don't have to write as far as WriteRqst, but
+ * If flexible == true, we don't have to write as far as WriteRqst, but
* may stop at any convenient boundary (such as a cache or logfile boundary).
* This option allows us to avoid uselessly issuing multiple writes when a
* single one would do.
*
* This routine is invoked periodically by the background walwriter process.
*
- * Returns TRUE if there was any work to do, even if we skipped flushing due
+ * Returns true if there was any work to do, even if we skipped flushing due
* to wal_writer_delay/wal_writer_flush_after.
*/
bool
*
* log, seg: identify segment to be created/opened.
*
- * *use_existent: if TRUE, OK to use a pre-existing file (else, any
- * pre-existing file will be deleted). On return, TRUE if a pre-existing
+ * *use_existent: if true, OK to use a pre-existing file (else, any
+ * pre-existing file will be deleted). On return, true if a pre-existing
* file was used.
*
- * use_lock: if TRUE, acquire ControlFileLock while moving file into
- * place. This should be TRUE except during bootstrap log creation. The
+ * use_lock: if true, acquire ControlFileLock while moving file into
+ * place. This should be true except during bootstrap log creation. The
* caller must *not* hold the lock at call.
*
* Returns FD of opened file.
* filename while it's being created) and to recycle an old segment.
*
* *segno: identify segment to install as (or first possible target).
- * When find_free is TRUE, this is modified on return to indicate the
+ * When find_free is true, this is modified on return to indicate the
* actual installation location or last segment searched.
*
* tmppath: initial name of file to install. It will be renamed into place.
*
- * find_free: if TRUE, install the new segment at the first empty segno
- * number at or after the passed numbers. If FALSE, install the new segment
+ * find_free: if true, install the new segment at the first empty segno
+ * number at or after the passed numbers. If false, install the new segment
* exactly where specified, deleting any existing segment file there.
*
* max_segno: maximum segment number to install the new file as. Fail if no
* free slot is found between *segno and max_segno. (Ignored when find_free
- * is FALSE.)
+ * is false.)
*
- * use_lock: if TRUE, acquire ControlFileLock while moving file into
- * place. This should be TRUE except during bootstrap log creation. The
+ * use_lock: if true, acquire ControlFileLock while moving file into
+ * place. This should be true except during bootstrap log creation. The
* caller must *not* hold the lock at call.
*
- * Returns TRUE if the file was installed successfully. FALSE indicates that
+ * Returns true if the file was installed successfully. false indicates that
* max_segno limit was exceeded, or an error occurred while renaming the
* file into place.
*/
* For point-in-time recovery, this function decides whether we want to
* stop applying the XLOG before the current record.
*
- * Returns TRUE if we are stopping, FALSE otherwise. If stopping, some
+ * Returns true if we are stopping, false otherwise. If stopping, some
* information is saved in recoveryStopXid et al for use in annotating the
* new timeline's history file.
*/
ereport(DEBUG1,
(errmsg_internal("redo record is at %X/%X; shutdown %s",
(uint32) (checkPoint.redo >> 32), (uint32) checkPoint.redo,
- wasShutdown ? "TRUE" : "FALSE")));
+ wasShutdown ? "true" : "false")));
ereport(DEBUG1,
(errmsg_internal("next transaction ID: %u:%u; next OID: %u",
checkPoint.nextXidEpoch, checkPoint.nextXid,
* later than the start of the dump, and so if we rely on it as the start
* point, we will fail to restore a consistent database state.
*
- * Returns TRUE if a backup_label was found (and fills the checkpoint
+ * Returns true if a backup_label was found (and fills the checkpoint
* location and its REDO location into *checkPointLoc and RedoStartLSN,
- * respectively); returns FALSE if not. If this backup_label came from a
- * streamed backup, *backupEndRequired is set to TRUE. If this backup_label
- * was created during recovery, *backupFromStandby is set to TRUE.
+ * respectively); returns false if not. If this backup_label came from a
+ * streamed backup, *backupEndRequired is set to true. If this backup_label
+ * was created during recovery, *backupFromStandby is set to true.
*/
static bool
read_backup_label(XLogRecPtr *checkPointLoc, bool *backupEndRequired,
* recovering from a backup dump file, and we therefore need to create symlinks
* as per the information present in tablespace_map file.
*
- * Returns TRUE if a tablespace_map file was found (and fills the link
- * information for all the tablespace links present in file); returns FALSE
+ * Returns true if a tablespace_map file was found (and fills the link
+ * information for all the tablespace links present in file); returns false
* if not.
*/
static bool
* If primary_conninfo is set, launch walreceiver to try
* to stream the missing WAL.
*
- * If fetching_ckpt is TRUE, RecPtr points to the initial
+ * If fetching_ckpt is true, RecPtr points to the initial
* checkpoint location. In that case, we use RedoStartLSN
* as the streaming start position instead of RecPtr, so
* that when we later jump backwards to start redo at
* Attempt to retrieve the specified file from off-line archival storage.
* If successful, fill "path" with its complete path (note that this will be
* a temp file name that doesn't follow the normal naming convention), and
- * return TRUE.
+ * return true.
*
* If not successful, fill "path" with the name of the normal on-line file
* (which may or may not actually exist, but we'll try to use it), and return
- * FALSE.
+ * false.
*
* For fixed-size files, the caller may pass the expected size as an
* additional crosscheck on successful recovery. If the file size is not
/*
* Create a compressed version of a backup block image.
*
- * Returns FALSE if compression fails (i.e., compressed result is actually
- * bigger than original). Otherwise, returns TRUE and sets 'dlen' to
+ * Returns false if compression fails (i.e., compressed result is actually
+ * bigger than original). Otherwise, returns true and sets 'dlen' to
* the length of compressed block image.
*/
static bool
* log_newpage_buffer instead.
*
* If the page follows the standard page layout, with a PageHeader and unused
- * space between pd_lower and pd_upper, set 'page_std' to TRUE. That allows
+ * space between pd_lower and pd_upper, set 'page_std' to true. That allows
* the unused space to be left out from the WAL record, making it smaller.
*/
XLogRecPtr
* function. This function will set the page LSN.
*
* If the page follows the standard page layout, with a PageHeader and unused
- * space between pd_lower and pd_upper, set 'page_std' to TRUE. That allows
+ * space between pd_lower and pd_upper, set 'page_std' to true. That allows
* the unused space to be left out from the WAL record, making it smaller.
*/
XLogRecPtr
* Returns information about the block that a block reference refers to.
*
* If the WAL record contains a block reference with the given ID, *rnode,
- * *forknum, and *blknum are filled in (if not NULL), and returns TRUE.
- * Otherwise returns FALSE.
+ * *forknum, and *blknum are filled in (if not NULL), and returns true.
+ * Otherwise returns false.
*/
bool
XLogRecGetBlockTag(XLogReaderState *record, uint8 block_id,
* cooked_constraints: list of precooked check constraints and defaults
* relkind: relkind for new rel
* relpersistence: rel's persistence status (permanent, temp, or unlogged)
- * shared_relation: TRUE if it's to be a shared relation
- * mapped_relation: TRUE if the relation will use the relfilenode map
- * oidislocal: TRUE if oid column (if any) should be marked attislocal
+ * shared_relation: true if it's to be a shared relation
+ * mapped_relation: true if the relation will use the relfilenode map
+ * oidislocal: true if oid column (if any) should be marked attislocal
* oidinhcount: attinhcount to assign to oid column (if any)
* oncommit: ON COMMIT marking (only relevant if it's a temp table)
* reloptions: reloptions in Datum form, or (Datum) 0 if none
- * use_user_acl: TRUE if should look for user-defined default permissions;
- * if FALSE, relacl is always set NULL
- * allow_system_table_mods: TRUE to allow creation in system namespaces
+ * use_user_acl: true if should look for user-defined default permissions;
+ * if false, relacl is always set NULL
+ * allow_system_table_mods: true to allow creation in system namespaces
* is_internal: is this a system-generated catalog?
*
* Output parameters:
* rel: relation to be modified
* newColDefaults: list of RawColumnDefault structures
* newConstraints: list of Constraint nodes
- * allow_merge: TRUE if check constraints may be merged with existing ones
- * is_local: TRUE if definition is local, FALSE if it's inherited
- * is_internal: TRUE if result of some internal process, not a user request
+ * allow_merge: true if check constraints may be merged with existing ones
+ * is_local: true if definition is local, false if it's inherited
+ * is_internal: true if result of some internal process, not a user request
*
* All entries in newColDefaults will be processed. Entries in newConstraints
* will be processed only if they are CONSTR_CHECK type.
* new one, and either adjust its conislocal/coninhcount settings or throw
* error as needed.
*
- * Returns TRUE if merged (constraint is a duplicate), or FALSE if it's
+ * Returns true if merged (constraint is a duplicate), or false if it's
* got a so-far-unique name, or throws error if conflict.
*
* XXX See MergeConstraintsIntoExisting too if you change this code.
* set up until the first attempt to create something in it. (The reason for
* klugery is that we can't create the temp namespace outside a transaction,
* but initial GUC processing of search_path happens outside a transaction.)
- * activeTempCreationPending is TRUE if "pg_temp" appears first in the string
+ * activeTempCreationPending is true if "pg_temp" appears first in the string
* but is not reflected in activeCreationNamespace because the namespace isn't
* set up yet.
*
/* default place to create stuff; if InvalidOid, no default */
static Oid activeCreationNamespace = InvalidOid;
-/* if TRUE, activeCreationNamespace is wrong, it should be temp namespace */
+/* if true, activeCreationNamespace is wrong, it should be temp namespace */
static bool activeTempCreationPending = false;
/* These variables are the values last derived from namespace_search_path: */
/*
* Determine whether a relation can be proven functionally dependent on
- * a set of grouping columns. If so, return TRUE and add the pg_constraint
+ * a set of grouping columns. If so, return true and add the pg_constraint
* OIDs of the constraints needed for the proof to the *constraintDeps list.
*
* grouping_columns is a list of grouping expressions, in which columns of
*
* An ownership marker is an AUTO or INTERNAL dependency from the sequence to the
* column. If we find one, store the identity of the owning column
- * into *tableId and *colId and return TRUE; else return FALSE.
+ * into *tableId and *colId and return true; else return false.
*
* Note: if there's more than one such pg_depend entry then you get
* a random one of them returned into the out parameters. This should
* finds an operator given an exact specification (name, namespace,
* left and right type IDs).
*
- * *defined is set TRUE if defined (not a shell)
+ * *defined is set true if defined (not a shell)
*/
static Oid
OperatorGet(const char *operatorName,
* looks up an operator given a possibly-qualified name and
* left and right type IDs.
*
- * *defined is set TRUE if defined (not a shell)
+ * *defined is set true if defined (not a shell)
*/
static Oid
OperatorLookup(List *operatorName,
* determine the new type's own array type name; else the latter will
* certainly pick the same name.
*
- * Returns TRUE if successfully moved the type, FALSE if not.
+ * Returns true if successfully moved the type, false if not.
*
- * We also return TRUE if the given type is a shell type. In this case
+ * We also return true if the given type is a shell type. In this case
* the type has not been renamed out of the way, but nonetheless it can
* be expected that TypeCreate will succeed. This behavior is convenient
* for most callers --- those that need to distinguish the shell-type case
* characters, else we might find a false match to a trailing byte. In
* supported server encodings, there is no possibility of a false match, and
* it's faster to make useless comparisons to trailing bytes than it is to
- * invoke pg_encoding_mblen() to skip over them. encoding_embeds_ascii is TRUE
+ * invoke pg_encoding_mblen() to skip over them. encoding_embeds_ascii is true
* when we have to do it the hard way.
*/
typedef struct CopyStateData
/*
* CopyLoadRawBuf loads some more data into raw_buf
*
- * Returns TRUE if able to obtain at least one more byte, else FALSE.
+ * Returns true if able to obtain at least one more byte, else false.
*
* If raw_buf_index < raw_buf_len, the unprocessed bytes are transferred
* down to the start of the buffer and then we load more data after that.
* DoCopy executes the SQL COPY statement
*
* Either unload or reload contents of table <relation>, depending on <from>.
- * (<from> = TRUE means we are inserting into the table.) In the "TO" case
+ * (<from> = true means we are inserting into the table.) In the "TO" case
* we also support copying the output of an arbitrary SELECT, INSERT, UPDATE
* or DELETE query.
*
/*
* Look up info about the database named "name". If the database exists,
* obtain the specified lock type on it, fill in any of the remaining
- * parameters that aren't NULL, and return TRUE. If no such database,
- * return FALSE.
+ * parameters that aren't NULL, and return true. If no such database,
+ * return false.
*/
static bool
get_db_info(const char *name, LOCKMODE lockmode,
/*
* Check for existing files that conflict with a proposed new DB OID;
- * return TRUE if there are any
+ * return true if there are any
*
* If there were a subdirectory in any tablespace matching the proposed new
* OID, we'd get a create failure due to the duplicate name ... and then we'd
/*
- * This just returns TRUE if we have a valid template for a given language
+ * This just returns true if we have a valid template for a given language
*/
bool
PLTemplateExists(const char *languageName)
*
* constraints is a list of CookedConstraint structs for previous constraints.
*
- * Returns TRUE if merged (constraint is a duplicate), or FALSE if it's
+ * Returns true if merged (constraint is a duplicate), or false if it's
* got a so-far-unique name, or throws error if conflict.
*/
static bool
*/
if (((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull)
{
- ((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull = FALSE;
+ ((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull = false;
CatalogTupleUpdate(attr_rel, &tuple->t_self, tuple);
*/
if (!((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull)
{
- ((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull = TRUE;
+ ((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull = true;
CatalogTupleUpdate(attr_rel, &tuple->t_self, tuple);
trig.tgoid = InvalidOid;
trig.tgname = conname;
trig.tgenabled = TRIGGER_FIRES_ON_ORIGIN;
- trig.tgisinternal = TRUE;
+ trig.tgisinternal = true;
trig.tgconstrrelid = RelationGetRelid(pkrel);
trig.tgconstrindid = pkindOid;
trig.tgconstraint = constraintOid;
- trig.tgdeferrable = FALSE;
- trig.tginitdeferred = FALSE;
+ trig.tgdeferrable = false;
+ trig.tginitdeferred = false;
/* we needn't fill in remaining fields */
/*
- * See if we can do it with a single LEFT JOIN query. A FALSE result
+ * See if we can do it with a single LEFT JOIN query. A false result
* indicates we must proceed with the fire-the-trigger method.
*/
if (RI_Initial_Check(&trig, rel, pkrel))
* does not justify throwing an error that would require manual intervention
* to get the database running again.
*
- * Returns TRUE if successful, FALSE if some subdirectory is not empty
+ * Returns true if successful, false if some subdirectory is not empty
*/
static bool
destroy_tablespace_directories(Oid tablespaceoid, bool redo)
*
* If isInternal is true then this is an internally-generated trigger.
* This argument sets the tgisinternal field of the pg_trigger entry, and
- * if TRUE causes us to modify the given trigger name to ensure uniqueness.
+ * if true causes us to modify the given trigger name to ensure uniqueness.
*
* When isInternal is not true we require ACL_TRIGGER permissions on the
* relation, as well as ACL_EXECUTE on the trigger function. For internal
* If move_list isn't NULL, events that are not to be invoked now are
* transferred to move_list.
*
- * When immediate_only is TRUE, do not invoke currently-deferred triggers.
- * (This will be FALSE only at main transaction exit.)
+ * When immediate_only is true, do not invoke currently-deferred triggers.
+ * (This will be false only at main transaction exit.)
*
- * Returns TRUE if any invokable events were found.
+ * Returns true if any invokable events were found.
*/
static bool
afterTriggerMarkEvents(AfterTriggerEventList *events,
* make one locally to cache the info in case there are multiple trigger
* events per rel.
*
- * When delete_ok is TRUE, it's safe to delete fully-processed events.
+ * When delete_ok is true, it's safe to delete fully-processed events.
* (We are not very tense about that: we simply reset a chunk to be empty
* if all its events got fired. The objective here is just to avoid useless
* rescanning of events when a trigger queues new events during transaction
* end, so it's not necessary to worry much about the case where only
* some events are fired.)
*
- * Returns TRUE if no unfired events remain in the list (this allows us
+ * Returns true if no unfired events remain in the list (this allows us
* to avoid repeating afterTriggerMarkEvents).
*/
static bool
* AlterTypeOwner_oid - change type owner unconditionally
*
* This function recurses to handle a pg_class entry, if necessary. It
- * invokes any necessary access object hooks. If hasDependEntry is TRUE, this
+ * invokes any necessary access object hooks. If hasDependEntry is true, this
* function modifies the pg_shdepend entry appropriately (this should be
- * passed as FALSE only for table rowtypes and array types).
+ * passed as false only for table rowtypes and array types).
*
* This is used by ALTER TABLE/TYPE OWNER commands, as well as by REASSIGN
* OWNED BY. It assumes the caller has done all needed check.
* Caller must have already checked privileges.
*
* The function automatically recurses to process the type's array type,
- * if any. isImplicitArray should be TRUE only when doing this internal
+ * if any. isImplicitArray should be true only when doing this internal
* recursion (outside callers must never try to move an array type directly).
*
- * If errorOnTableType is TRUE, the function errors out if the type is
+ * If errorOnTableType is true, the function errors out if the type is
* a table type. ALTER TABLE has to be used to move a table to a new
* namespace.
*
* of the table is currently being scanned by the cursor named by CURRENT OF,
* and return the row's TID into *current_tid.
*
- * Returns TRUE if a row was identified. Returns FALSE if the cursor is valid
+ * Returns true if a row was identified. Returns false if the cursor is valid
* for the table but is not currently scanning a row of the table (this is a
* legal situation in inheritance cases). Raises error if cursor is not a
* valid updatable scan of the specified table.
* going to be stored into a relation that has OIDs. In other contexts
* we are free to choose whether to leave space for OIDs in result tuples
* (we generally don't want to, but we do if a physical-tlist optimization
- * is possible). This routine checks the plan context and returns TRUE if the
- * choice is forced, FALSE if the choice is not forced. In the TRUE case,
+ * is possible). This routine checks the plan context and returns true if the
+ * choice is forced, false if the choice is not forced. In the true case,
* *hasoids is set to the required value.
*
* One reason this is ugly is that all plan nodes in the plan tree will emit
else
{
/* No more hashtables, so done */
- aggstate->agg_done = TRUE;
+ aggstate->agg_done = true;
return NULL;
}
}
* AggStateIsShared - find out whether transition state is shared
*
* If the function is being called as an aggregate support function,
- * return TRUE if the aggregate's transition state is shared across
- * multiple aggregates, FALSE if it is not.
+ * return true if the aggregate's transition state is shared across
+ * multiple aggregates, false if it is not.
*
- * Returns TRUE if not called as an aggregate support function.
+ * Returns true if not called as an aggregate support function.
* This is intended as a conservative answer, ie "no you'd better not
- * scribble on your input". In particular, will return TRUE if the
+ * scribble on your input". In particular, will return true if the
* aggregate is being used as a window function, which is a scenario
* in which changing the transition state is a bad idea. We might
* want to refine the behavior for the window case in future.
/*
* if scanning in reverse, we start at the last scan in the list and
* then proceed back to the first.. in any case we inform ExecAppend
- * that we are at the end of the line by returning FALSE
+ * that we are at the end of the line by returning false
*/
appendstate->as_whichplan = 0;
- return FALSE;
+ return false;
}
else if (whichplan >= appendstate->as_nplans)
{
* as above, end the scan if we go beyond the last scan in our list..
*/
appendstate->as_whichplan = appendstate->as_nplans - 1;
- return FALSE;
+ return false;
}
else
{
- return TRUE;
+ return true;
}
}
if (TupIsNull(outerslot))
{
/* empty input, so return nothing */
- node->grp_done = TRUE;
+ node->grp_done = true;
return NULL;
}
/* Copy tuple into firsttupleslot */
if (TupIsNull(outerslot))
{
/* no more groups, so we're done */
- node->grp_done = TRUE;
+ node->grp_done = true;
return NULL;
}
grpstate->ss.ps.plan = (Plan *) node;
grpstate->ss.ps.state = estate;
grpstate->ss.ps.ExecProcNode = ExecGroup;
- grpstate->grp_done = FALSE;
+ grpstate->grp_done = false;
/*
* create expression context
{
PlanState *outerPlan = outerPlanState(node);
- node->grp_done = FALSE;
+ node->grp_done = false;
/* must clear first tuple */
ExecClearTuple(node->ss.ss_ScanTupleSlot);
* econtext->ecxt_innertuple. Vars in the hashkeys expressions should have
* varno either OUTER_VAR or INNER_VAR.
*
- * A TRUE result means the tuple's hash value has been successfully computed
- * and stored at *hashvalue. A FALSE result means the tuple cannot match
+ * A true result means the tuple's hash value has been successfully computed
+ * and stored at *hashvalue. A false result means the tuple cannot match
* because it contains a null attribute, and hence it should be discarded
- * immediately. (If keep_nulls is true then FALSE is never returned.)
+ * immediately. (If keep_nulls is true then false is never returned.)
*/
bool
ExecHashGetHashValue(HashJoinTable hashtable,
* ExecIndexEvalArrayKeys
* Evaluate any array key values, and set up to iterate through arrays.
*
- * Returns TRUE if there are array elements to consider; FALSE means there
- * is at least one null or empty array, so no match is possible. On TRUE
+ * Returns true if there are array elements to consider; false means there
+ * is at least one null or empty array, so no match is possible. On true
* result, the scankeys are initialized with the first elements of the arrays.
*/
bool
* ExecIndexAdvanceArrayKeys
* Advance to the next set of array key values, if any.
*
- * Returns TRUE if there is another set of values to consider, FALSE if not.
- * On TRUE result, the scankeys are initialized with the next set of values.
+ * Returns true if there is another set of values to consider, false if not.
+ * On true result, the scankeys are initialized with the next set of values.
*/
bool
ExecIndexAdvanceArrayKeys(IndexArrayKeyInfo *arrayKeys, int numArrayKeys)
/*
* Check that a qual condition is constant true or constant false.
- * If it is constant false (or null), set *is_const_false to TRUE.
+ * If it is constant false (or null), set *is_const_false to true.
*
* Constant true would normally be represented by a NIL list, but we allow an
* actual bool Const as well. We do expect that the planner will have thrown
MemoryContext oldcontext;
TupleTableSlot *slot;
Datum result;
- bool found = false; /* TRUE if got at least one subplan tuple */
+ bool found = false; /* true if got at least one subplan tuple */
ListCell *pvar;
ListCell *l;
ArrayBuildStateAny *astate = NULL;
* snapshot: query snapshot to use, or InvalidSnapshot for the normal
* behavior of taking a new snapshot for each query.
* crosscheck_snapshot: for RI use, all others pass InvalidSnapshot
- * read_only: TRUE for read-only execution (no CommandCounterIncrement)
- * fire_triggers: TRUE to fire AFTER triggers at end of query (normal case);
- * FALSE means any AFTER triggers are postponed to end of outer query
+ * read_only: true for read-only execution (no CommandCounterIncrement)
+ * fire_triggers: true to fire AFTER triggers at end of query (normal case);
+ * false means any AFTER triggers are postponed to end of outer query
* tcount: execution tuple-count limit, or 0 for none
*/
static int
/*
* Receive a tuple from a query, and send it to the designated shm_mq.
*
- * Returns TRUE if successful, FALSE if shm_mq has been detached.
+ * Returns true if successful, false if shm_mq has been detached.
*/
static bool
tqueueReceiveSlot(TupleTableSlot *slot, DestReceiver *self)
/*
* IsImportableForeignTable - filter table names for IMPORT FOREIGN SCHEMA
*
- * Returns TRUE if given table name should be imported according to the
+ * Returns true if given table name should be imported according to the
* statement's import filter options.
*/
bool
* set *err_msg to a string describing the error. Currently the only
* possible error is token too long for buf.
*
- * If successful: store null-terminated token at *buf and return TRUE.
- * If no more tokens on line: set *buf = '\0' and return FALSE.
- * If error: fill buf with truncated or misformatted token and return FALSE.
+ * If successful: store null-terminated token at *buf and return true.
+ * If no more tokens on line: set *buf = '\0' and return false.
+ * If error: fill buf with truncated or misformatted token and return false.
*/
static bool
next_token(char **lineptr, char *buf, int bufsz,
/* --------------------------------
* socket_set_nonblocking - set socket blocking/non-blocking
*
- * Sets the socket non-blocking if nonblocking is TRUE, or sets it
+ * Sets the socket non-blocking if nonblocking is true, or sets it
* blocking otherwise.
* --------------------------------
*/
* bms_get_singleton_member
*
* Test whether the given set is a singleton.
- * If so, set *member to the value of its sole member, and return TRUE.
- * If not, return FALSE, without changing *member.
+ * If so, set *member to the value of its sole member, and return true.
+ * If not, return false, without changing *member.
*
* This is more convenient and faster than calling bms_membership() and then
* bms_singleton_member(), if we don't care about distinguishing empty sets
* Test whether an expression returns a set result.
*
* Because we use expression_tree_walker(), this can also be applied to
- * whole targetlists; it'll produce TRUE if any one of the tlist items
+ * whole targetlists; it'll produce true if any one of the tlist items
* returns a set.
*/
bool
* check_functions_in_node -
* apply checker() to each function OID contained in given expression node
*
- * Returns TRUE if the checker() function does; for nodes representing more
- * than one function call, returns TRUE if the checker() function does so
- * for any of those functions. Returns FALSE if node does not invoke any
+ * Returns true if the checker() function does; for nodes representing more
+ * than one function call, returns true if the checker() function does so
+ * for any of those functions. Returns false if node does not invoke any
* SQL-visible function. Caller must not pass node == NULL.
*
* This function examines only the given node; it does not recurse into any
/*
* Process one page of a during an intersection op
*
- * Returns TRUE if apage is now empty and should be deleted from a
+ * Returns true if apage is now empty and should be deleted from a
*/
static bool
tbm_intersect_page(TIDBitmap *a, PagetableEntry *apage, const TIDBitmap *b)
* Zero out result area for subquery_is_pushdown_safe, so that it can set
* flags as needed while recursing. In particular, we need a workspace
* for keeping track of unsafe-to-reference columns. unsafeColumns[i]
- * will be set TRUE if we find that output column i of the subquery is
+ * will be set true if we find that output column i of the subquery is
* unsafe to use in a pushed-down qual.
*/
memset(&safetyInfo, 0, sizeof(safetyInfo));
* In addition, we make several checks on the subquery's output columns to see
* if it is safe to reference them in pushed-down quals. If output column k
* is found to be unsafe to reference, we set safetyInfo->unsafeColumns[k]
- * to TRUE, but we don't reject the subquery overall since column k might not
+ * to true, but we don't reject the subquery overall since column k might not
* be referenced by some/all quals. The unsafeColumns[] array will be
* consulted later by qual_is_pushdown_safe(). It's better to do it this way
* than to make the checks directly in qual_is_pushdown_safe(), because when
*
* There are several cases in which it's unsafe to push down an upper-level
* qual if it references a particular output column of a subquery. We check
- * each output column of the subquery and set unsafeColumns[k] to TRUE if
+ * each output column of the subquery and set unsafeColumns[k] to true if
* that column is unsafe for a pushed-down qual to reference. The conditions
* checked here are:
*
* any delay by an outer join, so its two sides can be considered equal
* anywhere they are both computable; moreover that equality can be
* extended transitively. Record this knowledge in the EquivalenceClass
- * data structure, if applicable. Returns TRUE if successful, FALSE if not
+ * data structure, if applicable. Returns true if successful, false if not
* (in which case caller should treat the clause as ordinary, not an
* equivalence).
*
* so for now we live with just reporting the first match. See also
* generate_implied_equalities_for_column and match_pathkeys_to_index.)
*
- * If create_it is TRUE, we'll build a new EquivalenceClass when there is no
- * match. If create_it is FALSE, we just return NULL when no match.
+ * If create_it is true, we'll build a new EquivalenceClass when there is no
+ * match. If create_it is false, we just return NULL when no match.
*
* This can be used safely both before and after EquivalenceClass merging;
* since it never causes merging it does not invalidate any existing ECs
/*
* reconsider_outer_join_clauses for a single LEFT/RIGHT JOIN clause
*
- * Returns TRUE if we were able to propagate a constant through the clause.
+ * Returns true if we were able to propagate a constant through the clause.
*/
static bool
reconsider_outer_join_clause(PlannerInfo *root, RestrictInfo *rinfo,
/*
* reconsider_outer_join_clauses for a single FULL JOIN clause
*
- * Returns TRUE if we were able to propagate a constant through the clause.
+ * Returns true if we were able to propagate a constant through the clause.
*/
static bool
reconsider_full_join_clause(PlannerInfo *root, RestrictInfo *rinfo)
*
* If skip_nonnative_saop is non-NULL, we ignore ScalarArrayOpExpr clauses
* unless the index AM supports them directly, and we set *skip_nonnative_saop
- * to TRUE if we found any such clauses (caller must initialize the variable
- * to FALSE). If it's NULL, we do not ignore ScalarArrayOpExpr clauses.
+ * to true if we found any such clauses (caller must initialize the variable
+ * to false). If it's NULL, we do not ignore ScalarArrayOpExpr clauses.
*
* If skip_lower_saop is non-NULL, we ignore ScalarArrayOpExpr clauses for
- * non-first index columns, and we set *skip_lower_saop to TRUE if we found
- * any such clauses (caller must initialize the variable to FALSE). If it's
+ * non-first index columns, and we set *skip_lower_saop to true if we found
+ * any such clauses (caller must initialize the variable to false). If it's
* NULL, we do not ignore non-first ScalarArrayOpExpr clauses, but they will
* result in considering the scan's output to be unordered.
*
* across joins unless there's a join-order-constraint-based reason to do so.
* So we ignore the param_source_rels restriction when this case applies.
*
- * allow_star_schema_join() returns TRUE if the param_source_rels restriction
+ * allow_star_schema_join() returns true if the param_source_rels restriction
* should be overridden, ie, it's okay to perform this join.
*/
static inline bool
* Select mergejoin clauses that are usable for a particular join.
* Returns a list of RestrictInfo nodes for those clauses.
*
- * *mergejoin_allowed is normally set to TRUE, but it is set to FALSE if
+ * *mergejoin_allowed is normally set to true, but it is set to false if
* this is a right/full join and there are nonmergejoinable join clauses.
* The executor's mergejoin machinery cannot handle such cases, so we have
* to avoid generating a mergejoin plan. (Note that this flag does NOT
*
* On success, *sjinfo_p is set to NULL if this is to be a plain inner join,
* else it's set to point to the associated SpecialJoinInfo node. Also,
- * *reversed_p is set TRUE if the given relations need to be swapped to
+ * *reversed_p is set true if the given relations need to be swapped to
* match the SpecialJoinInfo node.
*/
static bool
* decide there's no match for an outer row, which is pretty stupid. So,
* we need to detect the case.
*
- * If only_pushed_down is TRUE, then consider only pushed-down quals.
+ * If only_pushed_down is true, then consider only pushed-down quals.
*/
static bool
restriction_is_constant_false(List *restrictlist, bool only_pushed_down)
* considered. Otherwise child members are ignored. (See the comments for
* get_eclass_for_sort_expr.)
*
- * create_it is TRUE if we should create any missing EquivalenceClass
- * needed to represent the sort key. If it's FALSE, we return NULL if the
+ * create_it is true if we should create any missing EquivalenceClass
+ * needed to represent the sort key. If it's false, we return NULL if the
* sort key isn't already present in any EquivalenceClass.
*/
static PathKey *
* If successful, it returns a list of mergeclauses.
*
* 'pathkeys' is a pathkeys list showing the ordering of an input path.
- * 'outer_keys' is TRUE if these keys are for the outer input path,
- * FALSE if for inner.
+ * 'outer_keys' is true if these keys are for the outer input path,
+ * false if for inner.
* 'restrictinfos' is a list of mergejoinable restriction clauses for the
* join relation being formed.
*
* Could the relation possibly be proven distinct on some set of columns?
*
* This is effectively a pre-checking function for rel_is_distinct_for().
- * It must return TRUE if rel_is_distinct_for() could possibly return TRUE
+ * It must return true if rel_is_distinct_for() could possibly return true
* with this rel, but it should not expend a lot of cycles. The idea is
* that callers can avoid doing possibly-expensive processing to compute
* rel_is_distinct_for()'s argument lists if the call could not possibly
* on some set of output columns?
*
* This is effectively a pre-checking function for query_is_distinct_for().
- * It must return TRUE if query_is_distinct_for() could possibly return TRUE
+ * It must return true if query_is_distinct_for() could possibly return true
* with this query, but it should not expend a lot of cycles. The idea is
* that callers can avoid doing possibly-expensive processing to compute
* query_is_distinct_for()'s argument lists if the call could not possibly
* 'pathkeys' is the list of pathkeys by which the result is to be sorted
* 'relids' identifies the child relation being sorted, if any
* 'reqColIdx' is NULL or an array of required sort key column numbers
- * 'adjust_tlist_in_place' is TRUE if lefttree must be modified in-place
+ * 'adjust_tlist_in_place' is true if lefttree must be modified in-place
*
* We must convert the pathkey information into arrays of sort key column
* numbers, sort operator OIDs, collation OIDs, and nulls-first flags,
* compute these expressions, since a Sort or MergeAppend node itself won't
* do any such calculations. If the input plan type isn't one that can do
* projections, this means adding a Result node just to do the projection.
- * However, the caller can pass adjust_tlist_in_place = TRUE to force the
+ * However, the caller can pass adjust_tlist_in_place = true to force the
* lefttree tlist to be modified in-place regardless of whether the node type
* can project --- we use this for fixing the tlist of MergeAppend itself.
*
*
* Inputs:
* jtnode is the jointree node to examine
- * below_outer_join is TRUE if this node is within the nullable side of a
+ * below_outer_join is true if this node is within the nullable side of a
* higher-level outer join
* Outputs:
* *qualscope gets the set of base Relids syntactically included in this
* as belonging to a higher join level, just add it to postponed_qual_list.
*
* 'clause': the qual clause to be distributed
- * 'is_deduced': TRUE if the qual came from implied-equality deduction
- * 'below_outer_join': TRUE if the qual is from a JOIN/ON that is below the
+ * 'is_deduced': true if the qual came from implied-equality deduction
+ * 'below_outer_join': true if the qual is from a JOIN/ON that is below the
* nullable side of a higher-level outer join
* 'jointype': type of join the qual is from (JOIN_INNER for a WHERE clause)
* 'security_level': security_level to assign to the qual
* baserels appearing on the outer (nonnullable) side of the join
* (for FULL JOIN this includes both sides of the join, and must in fact
* equal qualscope)
- * 'deduced_nullable_relids': if is_deduced is TRUE, the nullable relids to
+ * 'deduced_nullable_relids': if is_deduced is true, the nullable relids to
* impute to the clause; otherwise NULL
* 'postponed_qual_list': list of PostponedQual structs, which we can add
* this qual to if it turns out to belong to a higher join level.
* 'ojscope' is needed if we decide to force the qual up to the outer-join
* level, which will be ojscope not necessarily qualscope.
*
- * In normal use (when is_deduced is FALSE), at the time this is called,
+ * In normal use (when is_deduced is false), at the time this is called,
* root->join_info_list must contain entries for all and only those special
- * joins that are syntactically below this qual. But when is_deduced is TRUE,
+ * joins that are syntactically below this qual. But when is_deduced is true,
* we are adding new deduced clauses after completion of deconstruct_jointree,
* so it cannot be assumed that root->join_info_list has anything to do with
* qual placement.
* may force extra delay of higher-level outer joins.
*
* If the qual must be delayed, add relids to *relids_p to reflect the lowest
- * safe level for evaluating the qual, and return TRUE. Any extra delay for
- * higher-level joins is reflected by setting delay_upper_joins to TRUE in
+ * safe level for evaluating the qual, and return true. Any extra delay for
+ * higher-level joins is reflected by setting delay_upper_joins to true in
* SpecialJoinInfo structs. We also compute nullable_relids, the set of
* referenced relids that are nullable by lower outer joins (note that this
* can be nonempty even for a non-delayed qual).
* Lastly, a pushed-down qual that references the nullable side of any current
* join_info_list member and has to be evaluated above that OJ (because its
* required relids overlap the LHS too) causes that OJ's delay_upper_joins
- * flag to be set TRUE. This will prevent any higher-level OJs from
+ * flag to be set true. This will prevent any higher-level OJs from
* being interchanged with that OJ, which would result in not having any
* correct place to evaluate the qual. (The case we care about here is a
* sub-select WHERE clause within the RHS of some outer join. The WHERE
/*
* check_equivalence_delay
* Detect whether a potential equivalence clause is rendered unsafe
- * by outer-join-delay considerations. Return TRUE if it's safe.
+ * by outer-join-delay considerations. Return true if it's safe.
*
* The initial tests in distribute_qual_to_rels will consider a mergejoinable
* clause to be a potential equivalence clause if it is not outerjoin_delayed.
* that each one is a MIN/MAX aggregate. If so, build a list of the
* distinct aggregate calls in the tree.
*
- * Returns TRUE if a non-MIN/MAX aggregate is found, FALSE otherwise.
+ * Returns true if a non-MIN/MAX aggregate is found, false otherwise.
* (This seemingly-backward definition is used because expression_tree_walker
- * aborts the scan on TRUE return, which is what we want.)
+ * aborts the scan on true return, which is what we want.)
*
* Found aggregates are added to the list at *context; it's up to the caller
* to initialize the list to NIL.
* Given a MIN/MAX aggregate, try to build an indexscan Path it can be
* optimized with.
*
- * If successful, stash the best path in *mminfo and return TRUE.
- * Otherwise, return FALSE.
+ * If successful, stash the best path in *mminfo and return true.
+ * Otherwise, return false.
*/
static bool
build_minmax_path(PlannerInfo *root, MinMaxAggInfo *mminfo,
* below the Sort step (and the Distinct step, if any). This will be
* exactly final_target if we decide a projection step wouldn't be helpful.
*
- * In addition, *have_postponed_srfs is set to TRUE if we choose to postpone
+ * In addition, *have_postponed_srfs is set to true if we choose to postpone
* any set-returning functions to after the Sort.
*/
static PathTarget *
* tableOid is the OID of a table to be clustered on its index indexOid
* (which is already known to be a btree index). Decide whether it's
* cheaper to do an indexscan or a seqscan-plus-sort to execute the CLUSTER.
- * Return TRUE to use sorting, FALSE to use an indexscan.
+ * Return true to use sorting, false to use an indexscan.
*
* Note: caller had better already hold some type of lock on the table.
*/
* won't occur, nor will other side-effects of volatile functions. This seems
* unlikely to bother anyone in practice.
*
- * Returns TRUE if was able to discard the targetlist, else FALSE.
+ * Returns true if was able to discard the targetlist, else false.
*/
static bool
simplify_EXISTS_query(PlannerInfo *root, Query *query)
* This forces use of the PlaceHolderVar mechanism for all non-Var targetlist
* items, and puts some additional restrictions on what can be pulled up.
*
- * deletion_ok is TRUE if the caller can cope with us returning NULL for a
+ * deletion_ok is true if the caller can cope with us returning NULL for a
* deletable leaf node (for example, a VALUES RTE that could be pulled up).
- * If it's FALSE, we'll avoid pullup in such cases.
+ * If it's false, we'll avoid pullup in such cases.
*
* A tricky aspect of this code is that if we pull up a subquery we have
* to replace Vars that reference the subquery's outputs throughout the
* (Note subquery is not necessarily equal to rte->subquery; it could be a
* processed copy of that.)
* lowest_outer_join is the lowest outer join above the subquery, or NULL.
- * deletion_ok is TRUE if it'd be okay to delete the subquery entirely.
+ * deletion_ok is true if it'd be okay to delete the subquery entirely.
*/
static bool
is_simple_subquery(Query *subquery, RangeTblEntry *rte,
/*
* Don't pull up a subquery with an empty jointree, unless it has no quals
- * and deletion_ok is TRUE and we're not underneath an outer join.
+ * and deletion_ok is true and we're not underneath an outer join.
*
* query_planner() will correctly generate a Result plan for a jointree
* that's totally empty, but we can't cope with an empty FromExpr
* to pull up into the parent query.
*
* rte is the RTE_VALUES RangeTblEntry to check.
- * deletion_ok is TRUE if it'd be okay to delete the VALUES RTE entirely.
+ * deletion_ok is true if it'd be okay to delete the VALUES RTE entirely.
*/
static bool
is_simple_values(PlannerInfo *root, RangeTblEntry *rte, bool deletion_ok)
Assert(rte->rtekind == RTE_VALUES);
/*
- * We can only pull up a VALUES RTE if deletion_ok is TRUE. It's
+ * We can only pull up a VALUES RTE if deletion_ok is true. It's
* basically the same case as a sub-select with empty FROM list; see
* comments in is_simple_subquery().
*/
*
* If restricted is false, all level-1 Vars are allowed (but we still must
* search the jointree, since it might contain outer joins below which there
- * will be restrictions). If restricted is true, return TRUE when any qual
+ * will be restrictions). If restricted is true, return true when any qual
* in the jointree contains level-1 Vars coming from outside the rels listed
* in safe_upper_varnos.
*/
* contain_subplans
* Recursively search for subplan nodes within a clause.
*
- * If we see a SubLink node, we will return TRUE. This is only possible if
+ * If we see a SubLink node, we will return true. This is only possible if
* the expression tree hasn't yet been transformed by subselect.c. We do not
* know whether the node will produce a true subplan or just an initplan,
* but we make the conservative assumption that it will be a subplan.
* that either v1 or v2 can't be NULL, but it does prove that the t1 row
* as a whole can't be all-NULL.
*
- * top_level is TRUE while scanning top-level AND/OR structure; here, showing
- * the result is either FALSE or NULL is good enough. top_level is FALSE when
+ * top_level is true while scanning top-level AND/OR structure; here, showing
+ * the result is either FALSE or NULL is good enough. top_level is false when
* we have descended below a NOT or a strict function: now we must be able to
* prove that the subexpression goes to NULL.
*
* The result is a palloc'd List, but we have not copied the member Var nodes.
* Also, we don't bother trying to eliminate duplicate entries.
*
- * top_level is TRUE while scanning top-level AND/OR structure; here, showing
- * the result is either FALSE or NULL is good enough. top_level is FALSE when
+ * top_level is true while scanning top-level AND/OR structure; here, showing
+ * the result is either FALSE or NULL is good enough. top_level is false when
* we have descended below a NOT or a strict function: now we must be able to
* prove that the subexpression goes to NULL.
*
* input is TRUE and at least one is NULL. We don't actually include the NULL
* here, that's supposed to be done by the caller.
*
- * The output arguments *haveNull and *forceTrue must be initialized FALSE
- * by the caller. They will be set TRUE if a null constant or true constant,
+ * The output arguments *haveNull and *forceTrue must be initialized false
+ * by the caller. They will be set true if a NULL constant or TRUE constant,
* respectively, is detected anywhere in the argument list.
*/
static List *
* no input is FALSE and at least one is NULL. We don't actually include the
* NULL here, that's supposed to be done by the caller.
*
- * The output arguments *haveNull and *forceFalse must be initialized FALSE
- * by the caller. They will be set TRUE if a null constant or false constant,
+ * The output arguments *haveNull and *forceFalse must be initialized false
+ * by the caller. They will be set true if a null constant or false constant,
* respectively, is detected anywhere in the argument list.
*/
static List *
* simplified query passed to query_planner().
*
* Note: this should only be called after query_planner() has started. Also,
- * create_new_ph must not be TRUE after deconstruct_jointree begins, because
+ * create_new_ph must not be true after deconstruct_jointree begins, because
* make_outerjoininfo assumes that we already know about all placeholders.
*/
PlaceHolderInfo *
* Does the predicate implication test for a "simple clause" predicate
* and a "simple clause" restriction.
*
- * We return TRUE if able to prove the implication, FALSE if not.
+ * We return true if able to prove the implication, false if not.
*
* We have three strategies for determining whether one simple clause
* implies another:
* Does the predicate refutation test for a "simple clause" predicate
* and a "simple clause" restriction.
*
- * We return TRUE if able to prove the refutation, FALSE if not.
+ * We return true if able to prove the refutation, false if not.
*
* Unlike the implication case, checking for equal() clauses isn't
* helpful.
* 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] = {
* When refute_it == false, we want to prove the predicate true;
* when refute_it == true, we want to prove the predicate false.
* (There is enough common code to justify handling these two cases
- * in one routine.) We return TRUE if able to make the proof, FALSE
+ * in one routine.) We return true if able to make the proof, false
* if not able to prove it.
*
* We can make proofs involving several expression forms (here "foo" and "bar"
* Assuming that EXPR1 clause_op EXPR2 is true, try to prove or refute
* EXPR1 pred_op EXPR2.
*
- * Return TRUE if able to make the proof, false if not able to prove it.
+ * Return true if able to make the proof, false if not able to prove it.
*/
static bool
operator_same_subexprs_proof(Oid pred_op, Oid clause_op, bool refute_it)
* entries might now be arbitrary expressions, not just Vars. This affects
* this function in one important way: we might find ourselves inserting
* SubLink expressions into subqueries, and we must make sure that their
- * Query.hasSubLinks fields get set to TRUE if so. If there are any
+ * Query.hasSubLinks fields get set to true if so. If there are any
* SubLinks in the join alias lists, the outer Query should already have
- * hasSubLinks = TRUE, so this is only relevant to un-flattened subqueries.
+ * hasSubLinks = true, so this is only relevant to un-flattened subqueries.
*
* NOTE: this is used on not-yet-planned expressions. We do not expect it
* to be applied directly to the whole Query, so if we see a Query to start
}
| INHERIT
{
- $$ = makeDefElem("inherit", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("inherit", (Node *)makeInteger(true), @1);
}
| CONNECTION LIMIT SignedIconst
{
* size of the main parser.
*/
if (strcmp($1, "superuser") == 0)
- $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("superuser", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nosuperuser") == 0)
- $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("superuser", (Node *)makeInteger(false), @1);
else if (strcmp($1, "createrole") == 0)
- $$ = makeDefElem("createrole", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("createrole", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nocreaterole") == 0)
- $$ = makeDefElem("createrole", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("createrole", (Node *)makeInteger(false), @1);
else if (strcmp($1, "replication") == 0)
- $$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("isreplication", (Node *)makeInteger(true), @1);
else if (strcmp($1, "noreplication") == 0)
- $$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("isreplication", (Node *)makeInteger(false), @1);
else if (strcmp($1, "createdb") == 0)
- $$ = makeDefElem("createdb", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("createdb", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nocreatedb") == 0)
- $$ = makeDefElem("createdb", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("createdb", (Node *)makeInteger(false), @1);
else if (strcmp($1, "login") == 0)
- $$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("canlogin", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nologin") == 0)
- $$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("canlogin", (Node *)makeInteger(false), @1);
else if (strcmp($1, "bypassrls") == 0)
- $$ = makeDefElem("bypassrls", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("bypassrls", (Node *)makeInteger(true), @1);
else if (strcmp($1, "nobypassrls") == 0)
- $$ = makeDefElem("bypassrls", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("bypassrls", (Node *)makeInteger(false), @1);
else if (strcmp($1, "noinherit") == 0)
{
/*
* Note that INHERIT is a keyword, so it's handled by main parser, but
* NOINHERIT is handled here.
*/
- $$ = makeDefElem("inherit", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("inherit", (Node *)makeInteger(false), @1);
}
else
ereport(ERROR,
DROP ROLE role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->roles = $3;
$$ = (Node *)n;
}
| DROP ROLE IF_P EXISTS role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->roles = $5;
$$ = (Node *)n;
}
| DROP USER role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->roles = $3;
$$ = (Node *)n;
}
{
DropRoleStmt *n = makeNode(DropRoleStmt);
n->roles = $5;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
| DROP GROUP_P role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->roles = $3;
$$ = (Node *)n;
}
| DROP GROUP_P IF_P EXISTS role_list
{
DropRoleStmt *n = makeNode(DropRoleStmt);
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->roles = $5;
$$ = (Node *)n;
}
;
constraints_set_mode:
- DEFERRED { $$ = TRUE; }
- | IMMEDIATE { $$ = FALSE; }
+ DEFERRED { $$ = true; }
+ | IMMEDIATE { $$ = false; }
;
n->subtype = AT_DropColumn;
n->name = $5;
n->behavior = $6;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
/* ALTER TABLE <name> DROP [COLUMN] <colname> [RESTRICT|CASCADE] */
n->subtype = AT_DropColumn;
n->name = $3;
n->behavior = $4;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
$$ = (Node *)n;
}
/*
n->subtype = AT_DropConstraint;
n->name = $5;
n->behavior = $6;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
/* ALTER TABLE <name> DROP CONSTRAINT <name> [RESTRICT|CASCADE] */
n->subtype = AT_DropConstraint;
n->name = $3;
n->behavior = $4;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
$$ = (Node *)n;
}
/* ALTER TABLE <name> SET WITH OIDS */
n->subtype = AT_DropColumn;
n->name = $5;
n->behavior = $6;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
/* ALTER TYPE <name> DROP ATTRIBUTE <attname> [RESTRICT|CASCADE] */
n->subtype = AT_DropColumn;
n->name = $3;
n->behavior = $4;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
$$ = (Node *)n;
}
/* ALTER TYPE <name> ALTER ATTRIBUTE <attname> [SET DATA] TYPE <typename> [RESTRICT|CASCADE] */
;
copy_from:
- FROM { $$ = TRUE; }
- | TO { $$ = FALSE; }
+ FROM { $$ = true; }
+ | TO { $$ = false; }
;
opt_program:
- PROGRAM { $$ = TRUE; }
- | /* EMPTY */ { $$ = FALSE; }
+ PROGRAM { $$ = true; }
+ | /* EMPTY */ { $$ = false; }
;
/*
}
| OIDS
{
- $$ = makeDefElem("oids", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("oids", (Node *)makeInteger(true), @1);
}
| FREEZE
{
- $$ = makeDefElem("freeze", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("freeze", (Node *)makeInteger(true), @1);
}
| DELIMITER opt_as Sconst
{
}
| HEADER_P
{
- $$ = makeDefElem("header", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("header", (Node *)makeInteger(true), @1);
}
| QUOTE opt_as Sconst
{
opt_oids:
WITH OIDS
{
- $$ = makeDefElem("oids", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("oids", (Node *)makeInteger(true), @1);
}
| /*EMPTY*/ { $$ = NULL; }
;
}
;
-opt_no_inherit: NO INHERIT { $$ = TRUE; }
- | /* EMPTY */ { $$ = FALSE; }
+opt_no_inherit: NO INHERIT { $$ = true; }
+ | /* EMPTY */ { $$ = false; }
;
opt_column_list:
;
opt_with_data:
- WITH DATA_P { $$ = TRUE; }
- | WITH NO DATA_P { $$ = FALSE; }
- | /*EMPTY*/ { $$ = TRUE; }
+ WITH DATA_P { $$ = true; }
+ | WITH NO DATA_P { $$ = false; }
+ | /*EMPTY*/ { $$ = true; }
;
}
| CYCLE
{
- $$ = makeDefElem("cycle", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("cycle", (Node *)makeInteger(true), @1);
}
| NO CYCLE
{
- $$ = makeDefElem("cycle", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("cycle", (Node *)makeInteger(false), @1);
}
| INCREMENT opt_by NumericOnly
{
;
opt_trusted:
- TRUSTED { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ TRUSTED { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
/* This ought to be just func_name, but that causes reduce/reduce conflicts
}
| CASCADE
{
- $$ = makeDefElem("cascade", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("cascade", (Node *)makeInteger(true), @1);
}
;
n->columns = (List *) lsecond($5);
n->whenClause = $10;
n->transitionRels = $8;
- n->isconstraint = FALSE;
- n->deferrable = FALSE;
- n->initdeferred = FALSE;
+ n->isconstraint = false;
+ n->deferrable = false;
+ n->initdeferred = false;
n->constrrel = NULL;
$$ = (Node *)n;
}
n->relation = $8;
n->funcname = $17;
n->args = $19;
- n->row = TRUE;
+ n->row = true;
n->timing = TRIGGER_TYPE_AFTER;
n->events = intVal(linitial($6));
n->columns = (List *) lsecond($6);
n->whenClause = $14;
n->transitionRels = NIL;
- n->isconstraint = TRUE;
+ n->isconstraint = true;
processCASbits($10, @10, "TRIGGER",
&n->deferrable, &n->initdeferred, NULL,
NULL, yyscanner);
;
TransitionOldOrNew:
- NEW { $$ = TRUE; }
- | OLD { $$ = FALSE; }
+ NEW { $$ = true; }
+ | OLD { $$ = false; }
;
TransitionRowOrTable:
- TABLE { $$ = TRUE; }
+ TABLE { $$ = true; }
/*
* According to the standard, lack of a keyword here implies ROW.
* Support for that would require prohibiting ROW entirely here,
* next token. Requiring ROW seems cleanest and easiest to
* explain.
*/
- | ROW { $$ = FALSE; }
+ | ROW { $$ = false; }
;
TransitionRelName:
* If ROW/STATEMENT not specified, default to
* STATEMENT, per SQL
*/
- $$ = FALSE;
+ $$ = false;
}
;
;
TriggerForType:
- ROW { $$ = TRUE; }
- | STATEMENT { $$ = FALSE; }
+ ROW { $$ = true; }
+ | STATEMENT { $$ = false; }
;
TriggerWhen:
CreateTrigStmt *n = makeNode(CreateTrigStmt);
n->trigname = $3;
n->args = list_make1($6);
- n->isconstraint = TRUE;
+ n->isconstraint = true;
processCASbits($8, @8, "ASSERTION",
&n->deferrable, &n->initdeferred, NULL,
NULL, yyscanner);
}
;
-opt_default: DEFAULT { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_default: DEFAULT { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_opfamily: FAMILY any_name { $$ = $2; }
errmsg("RECHECK is no longer required"),
errhint("Update your data type."),
parser_errposition(@1)));
- $$ = TRUE;
+ $$ = true;
}
- | /*EMPTY*/ { $$ = FALSE; }
+ | /*EMPTY*/ { $$ = false; }
;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $5;
n->behavior = $6;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $3;
n->behavior = $4;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $5;
n->behavior = $6;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $3;
n->behavior = $4;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_TYPE;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $3;
n->behavior = $4;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_TYPE;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $5;
n->behavior = $6;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_DOMAIN;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $3;
n->behavior = $4;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_DOMAIN;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $5;
n->behavior = $6;
n->concurrent = false;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_INDEX;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
n->objects = $4;
n->behavior = $5;
n->concurrent = true;
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_INDEX;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
n->objects = $6;
n->behavior = $7;
n->concurrent = true;
FetchStmt: FETCH fetch_args
{
FetchStmt *n = (FetchStmt *) $2;
- n->ismove = FALSE;
+ n->ismove = false;
$$ = (Node *)n;
}
| MOVE fetch_args
{
FetchStmt *n = (FetchStmt *) $2;
- n->ismove = TRUE;
+ n->ismove = true;
$$ = (Node *)n;
}
;
opt_grant_grant_option:
- WITH GRANT OPTION { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ WITH GRANT OPTION { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
/*****************************************************************************
}
;
-opt_grant_admin_option: WITH ADMIN OPTION { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_grant_admin_option: WITH ADMIN OPTION { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_granted_by: GRANTED BY RoleSpec { $$ = $3; }
;
opt_unique:
- UNIQUE { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ UNIQUE { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_concurrently:
- CONCURRENTLY { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ CONCURRENTLY { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_index_name:
;
opt_or_replace:
- OR REPLACE { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ OR REPLACE { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
func_args: '(' func_args_list ')' { $$ = $2; }
{
$$ = makeTypeNameFromNameList(lcons(makeString($2), $3));
$$->pct_type = true;
- $$->setof = TRUE;
+ $$->setof = true;
$$->location = @2;
}
;
common_func_opt_item:
CALLED ON NULL_P INPUT_P
{
- $$ = makeDefElem("strict", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("strict", (Node *)makeInteger(false), @1);
}
| RETURNS NULL_P ON NULL_P INPUT_P
{
- $$ = makeDefElem("strict", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("strict", (Node *)makeInteger(true), @1);
}
| STRICT_P
{
- $$ = makeDefElem("strict", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("strict", (Node *)makeInteger(true), @1);
}
| IMMUTABLE
{
}
| EXTERNAL SECURITY DEFINER
{
- $$ = makeDefElem("security", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("security", (Node *)makeInteger(true), @1);
}
| EXTERNAL SECURITY INVOKER
{
- $$ = makeDefElem("security", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("security", (Node *)makeInteger(false), @1);
}
| SECURITY DEFINER
{
- $$ = makeDefElem("security", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("security", (Node *)makeInteger(true), @1);
}
| SECURITY INVOKER
{
- $$ = makeDefElem("security", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("security", (Node *)makeInteger(false), @1);
}
| LEAKPROOF
{
- $$ = makeDefElem("leakproof", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("leakproof", (Node *)makeInteger(true), @1);
}
| NOT LEAKPROOF
{
- $$ = makeDefElem("leakproof", (Node *)makeInteger(FALSE), @1);
+ $$ = makeDefElem("leakproof", (Node *)makeInteger(false), @1);
}
| COST NumericOnly
{
}
| WINDOW
{
- $$ = makeDefElem("window", (Node *)makeInteger(TRUE), @1);
+ $$ = makeDefElem("window", (Node *)makeInteger(true), @1);
}
| common_func_opt_item
{
}
;
-opt_if_exists: IF_P EXISTS { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_if_exists: IF_P EXISTS { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
makeNode(AlterTableSpaceOptionsStmt);
n->tablespacename = $3;
n->options = $5;
- n->isReset = FALSE;
+ n->isReset = false;
$$ = (Node *)n;
}
| ALTER TABLESPACE name RESET reloptions
makeNode(AlterTableSpaceOptionsStmt);
n->tablespacename = $3;
n->options = $5;
- n->isReset = TRUE;
+ n->isReset = true;
$$ = (Node *)n;
}
;
n->tables = (List *)$4;
/* FOR ALL TABLES */
else
- n->for_all_tables = TRUE;
+ n->for_all_tables = true;
}
$$ = (Node *)n;
}
}
| FOR ALL TABLES
{
- $$ = (Node *) makeInteger(TRUE);
+ $$ = (Node *) makeInteger(true);
}
;
n->kind = ALTER_SUBSCRIPTION_ENABLED;
n->subname = $3;
n->options = list_make1(makeDefElem("enabled",
- (Node *)makeInteger(TRUE), @1));
+ (Node *)makeInteger(true), @1));
$$ = (Node *)n;
}
| ALTER SUBSCRIPTION name DISABLE_P
n->kind = ALTER_SUBSCRIPTION_ENABLED;
n->subname = $3;
n->options = list_make1(makeDefElem("enabled",
- (Node *)makeInteger(FALSE), @1));
+ (Node *)makeInteger(false), @1));
$$ = (Node *)n;
}
;
;
opt_instead:
- INSTEAD { $$ = TRUE; }
- | ALSO { $$ = FALSE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ INSTEAD { $$ = true; }
+ | ALSO { $$ = false; }
+ | /*EMPTY*/ { $$ = false; }
;
makeStringConst($3, @3), @1); }
| READ ONLY
{ $$ = makeDefElem("transaction_read_only",
- makeIntConst(TRUE, @1), @1); }
+ makeIntConst(true, @1), @1); }
| READ WRITE
{ $$ = makeDefElem("transaction_read_only",
- makeIntConst(FALSE, @1), @1); }
+ makeIntConst(false, @1), @1); }
| DEFERRABLE
{ $$ = makeDefElem("transaction_deferrable",
- makeIntConst(TRUE, @1), @1); }
+ makeIntConst(true, @1), @1); }
| NOT DEFERRABLE
{ $$ = makeDefElem("transaction_deferrable",
- makeIntConst(FALSE, @1), @1); }
+ makeIntConst(false, @1), @1); }
;
/* Syntax with commas is SQL-spec, without commas is Postgres historical */
{
DropdbStmt *n = makeNode(DropdbStmt);
n->dbname = $3;
- n->missing_ok = FALSE;
+ n->missing_ok = false;
$$ = (Node *)n;
}
| DROP DATABASE IF_P EXISTS database_name
{
DropdbStmt *n = makeNode(DropdbStmt);
n->dbname = $5;
- n->missing_ok = TRUE;
+ n->missing_ok = true;
$$ = (Node *)n;
}
;
;
opt_verbose:
- VERBOSE { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ VERBOSE { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
-opt_full: FULL { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_full: FULL { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
-opt_freeze: FREEZE { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_freeze: FREEZE { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_name_list:
| ACCESS EXCLUSIVE { $$ = AccessExclusiveLock; }
;
-opt_nowait: NOWAIT { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+opt_nowait: NOWAIT { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_nowait_or_skip:
;
all_or_distinct:
- ALL { $$ = TRUE; }
- | DISTINCT { $$ = FALSE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ ALL { $$ = true; }
+ | DISTINCT { $$ = false; }
+ | /*EMPTY*/ { $$ = false; }
;
/* We use (NIL) as a placeholder to indicate that all target expressions
/* CROSS JOIN is same as unqualified inner join */
JoinExpr *n = makeNode(JoinExpr);
n->jointype = JOIN_INNER;
- n->isNatural = FALSE;
+ n->isNatural = false;
n->larg = $1;
n->rarg = $4;
n->usingClause = NIL;
{
JoinExpr *n = makeNode(JoinExpr);
n->jointype = $2;
- n->isNatural = FALSE;
+ n->isNatural = false;
n->larg = $1;
n->rarg = $4;
if ($5 != NULL && IsA($5, List))
/* letting join_type reduce to empty doesn't work */
JoinExpr *n = makeNode(JoinExpr);
n->jointype = JOIN_INNER;
- n->isNatural = FALSE;
+ n->isNatural = false;
n->larg = $1;
n->rarg = $3;
if ($4 != NULL && IsA($4, List))
{
JoinExpr *n = makeNode(JoinExpr);
n->jointype = $3;
- n->isNatural = TRUE;
+ n->isNatural = true;
n->larg = $1;
n->rarg = $5;
n->usingClause = NIL; /* figure out which columns later... */
/* letting join_type reduce to empty doesn't work */
JoinExpr *n = makeNode(JoinExpr);
n->jointype = JOIN_INNER;
- n->isNatural = TRUE;
+ n->isNatural = true;
n->larg = $1;
n->rarg = $4;
n->usingClause = NIL; /* figure out which columns later... */
{
$$ = $2;
$$->arrayBounds = $3;
- $$->setof = TRUE;
+ $$->setof = true;
}
/* SQL standard syntax, currently only one-dimensional */
| SimpleTypename ARRAY '[' Iconst ']'
{
$$ = $2;
$$->arrayBounds = list_make1(makeInteger($5));
- $$->setof = TRUE;
+ $$->setof = true;
}
| SimpleTypename ARRAY
{
{
$$ = $2;
$$->arrayBounds = list_make1(makeInteger(-1));
- $$->setof = TRUE;
+ $$->setof = true;
}
;
;
opt_varying:
- VARYING { $$ = TRUE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ VARYING { $$ = true; }
+ | /*EMPTY*/ { $$ = false; }
;
/*
;
opt_timezone:
- WITH_LA TIME ZONE { $$ = TRUE; }
- | WITHOUT TIME ZONE { $$ = FALSE; }
- | /*EMPTY*/ { $$ = FALSE; }
+ WITH_LA TIME ZONE { $$ = true; }
+ | WITHOUT TIME ZONE { $$ = false; }
+ | /*EMPTY*/ { $$ = false; }
;
opt_interval:
| func_name '(' VARIADIC func_arg_expr opt_sort_clause ')'
{
FuncCall *n = makeFuncCall($1, list_make1($4), @1);
- n->func_variadic = TRUE;
+ n->func_variadic = true;
n->agg_order = $5;
$$ = (Node *)n;
}
| func_name '(' func_arg_list ',' VARIADIC func_arg_expr opt_sort_clause ')'
{
FuncCall *n = makeFuncCall($1, lappend($3, $6), @1);
- n->func_variadic = TRUE;
+ n->func_variadic = true;
n->agg_order = $7;
$$ = (Node *)n;
}
{
FuncCall *n = makeFuncCall($1, $4, @1);
n->agg_order = $5;
- n->agg_distinct = TRUE;
+ n->agg_distinct = true;
$$ = (Node *)n;
}
| func_name '(' '*' ')'
* really was.
*/
FuncCall *n = makeFuncCall($1, NIL, @1);
- n->agg_star = TRUE;
+ n->agg_star = true;
$$ = (Node *)n;
}
;
errmsg("cannot use VARIADIC with WITHIN GROUP"),
parser_errposition(@2)));
n->agg_order = $2;
- n->agg_within_group = TRUE;
+ n->agg_within_group = true;
}
n->agg_filter = $3;
n->over = $4;
| CONTENT_P { $$ = XMLOPTION_CONTENT; }
;
-xml_whitespace_option: PRESERVE WHITESPACE_P { $$ = TRUE; }
- | STRIP_P WHITESPACE_P { $$ = FALSE; }
- | /*EMPTY*/ { $$ = FALSE; }
+xml_whitespace_option: PRESERVE WHITESPACE_P { $$ = true; }
+ | STRIP_P WHITESPACE_P { $$ = false; }
+ | /*EMPTY*/ { $$ = false; }
;
/* We allow several variants for SQL and other compatibility. */
}
| TRUE_P
{
- $$ = makeBoolAConst(TRUE, @1);
+ $$ = makeBoolAConst(true, @1);
}
| FALSE_P
{
- $$ = makeBoolAConst(FALSE, @1);
+ $$ = makeBoolAConst(false, @1);
}
| NULL_P
{
/*
* If no matches, construct a new target entry which is appended to the
- * end of the target list. This target is given resjunk = TRUE so that it
+ * end of the target list. This target is given resjunk = true so that it
* will not be projected into the final tuple.
*/
target_result = transformTargetEntry(pstate, node, expr, exprKind,
* that is, so long as there is no use of ANYELEMENT. This is mostly for
* backwards compatibility with the pre-7.4 behavior of ANYARRAY.
*
- * We do not ereport here, but just return FALSE if a rule is violated.
+ * We do not ereport here, but just return false if a rule is violated.
*/
bool
check_generic_type_consistency(Oid *actual_arg_types,
/* IsPreferredType()
* Check if this type is a preferred type for the given category.
*
- * If category is TYPCATEGORY_INVALID, then we'll return TRUE for preferred
+ * If category is TYPCATEGORY_INVALID, then we'll return true for preferred
* types of any category; otherwise, only for preferred types of that
* category.
*/
* make_oper_cache_key
* Fill the lookup key struct given operator name and arg types.
*
- * Returns TRUE if successful, FALSE if the search_path overflowed
+ * Returns true if successful, false if the search_path overflowed
* (hence no caching is possible).
*
* pstate/location are used only to report the error position; pass NULL/-1
*
* This creates lists of an RTE's column names (aliases if provided, else
* real names) and Vars for each column. Only user columns are considered.
- * If include_dropped is FALSE then dropped columns are omitted from the
- * results. If include_dropped is TRUE then empty strings and NULL constants
+ * If include_dropped is false then dropped columns are omitted from the
+ * results. If include_dropped is true then empty strings and NULL constants
* (not Vars!) are returned for dropped columns.
*
* rtindex, sublevels_up, and location are the varno, varlevelsup, and location
/*
- * Examine a fully-parsed query, and return TRUE iff any relation underlying
+ * Examine a fully-parsed query, and return true iff any relation underlying
* the query is a temporary relation (table, view, or materialized view).
*/
bool
column->colname, cxt->relation->relname),
parser_errposition(cxt->pstate,
constraint->location)));
- column->is_not_null = FALSE;
+ column->is_not_null = false;
saw_nullable = true;
break;
column->colname, cxt->relation->relname),
parser_errposition(cxt->pstate,
constraint->location)));
- column->is_not_null = TRUE;
+ column->is_not_null = true;
saw_nullable = true;
break;
column->identity = constraint->generated_when;
saw_identity = true;
- column->is_not_null = TRUE;
+ column->is_not_null = true;
break;
}
{
/* found column in the new table; force it to be NOT NULL */
if (constraint->contype == CONSTR_PRIMARY)
- column->is_not_null = TRUE;
+ column->is_not_null = true;
}
else if (SystemAttributeByName(key, cxt->hasoids) != NULL)
{
}
/*
- * scanner_isspace() --- return TRUE if flex scanner considers char whitespace
+ * scanner_isspace() --- return true if flex scanner considers char whitespace
*
* This should be used instead of the potentially locale-dependent isspace()
* function when it's important to match the lexer's behavior.
* pgstat_read_db_statsfile_timestamp() -
*
* Attempt to determine the timestamp of the last db statfile write.
- * Returns TRUE if successful; the timestamp is stored in *ts.
+ * Returns true if successful; the timestamp is stored in *ts.
*
* This needs to be careful about handling databases for which no stats file
* exists, such as databases without a stat entry or those not yet written:
| K_PROGRESS
{
$$ = makeDefElem("progress",
- (Node *)makeInteger(TRUE), -1);
+ (Node *)makeInteger(true), -1);
}
| K_FAST
{
$$ = makeDefElem("fast",
- (Node *)makeInteger(TRUE), -1);
+ (Node *)makeInteger(true), -1);
}
| K_WAL
{
$$ = makeDefElem("wal",
- (Node *)makeInteger(TRUE), -1);
+ (Node *)makeInteger(true), -1);
}
| K_NOWAIT
{
$$ = makeDefElem("nowait",
- (Node *)makeInteger(TRUE), -1);
+ (Node *)makeInteger(true), -1);
}
| K_MAX_RATE UCONST
{
| K_TABLESPACE_MAP
{
$$ = makeDefElem("tablespace_map",
- (Node *)makeInteger(TRUE), -1);
+ (Node *)makeInteger(true), -1);
}
;
K_EXPORT_SNAPSHOT
{
$$ = makeDefElem("export_snapshot",
- (Node *)makeInteger(TRUE), -1);
+ (Node *)makeInteger(true), -1);
}
| K_NOEXPORT_SNAPSHOT
{
$$ = makeDefElem("export_snapshot",
- (Node *)makeInteger(FALSE), -1);
+ (Node *)makeInteger(false), -1);
}
| K_USE_SNAPSHOT
{
$$ = makeDefElem("use_snapshot",
- (Node *)makeInteger(TRUE), -1);
+ (Node *)makeInteger(true), -1);
}
| K_RESERVE_WAL
{
$$ = makeDefElem("reserve_wal",
- (Node *)makeInteger(TRUE), -1);
+ (Node *)makeInteger(true), -1);
}
;
replace);
/*
- * Set pg_class 'relhasrules' field TRUE for event relation.
+ * Set pg_class 'relhasrules' field true for event relation.
*
* Important side effect: an SI notice is broadcast to force all
* backends (including me!) to update relcache entries with the new
* rt_index - RT index of result relation in original query
* event - type of rule event
* Output arguments:
- * *returning_flag - set TRUE if we rewrite RETURNING clause in rule_action
- * (must be initialized to FALSE)
+ * *returning_flag - set true if we rewrite RETURNING clause in rule_action
+ * (must be initialized to false)
* Return value:
* rewritten form of rule_action
*/
* event - type of rule event
* locks - list of rules to fire
* Output arguments:
- * *instead_flag - set TRUE if any unqualified INSTEAD rule is found
- * (must be initialized to FALSE)
- * *returning_flag - set TRUE if we rewrite RETURNING clause in any rule
- * (must be initialized to FALSE)
+ * *instead_flag - set true if any unqualified INSTEAD rule is found
+ * (must be initialized to false)
+ * *returning_flag - set true if we rewrite RETURNING clause in any rule
+ * (must be initialized to false)
* *qual_product - filled with modified original query if any qualified
* INSTEAD rule is found (must be initialized to NULL)
* Return value:
* appear in the expression.
*
* If the expression tree contains a whole-row Var for the target RTE,
- * *found_whole_row is set to TRUE. In addition, if to_rowtype is
+ * *found_whole_row is set to true. In addition, if to_rowtype is
* not InvalidOid, we replace the Var with a Var of that vartype, inserting
* a ConvertRowTypeExpr to map back to the rowtype expected by the expression.
* (Therefore, to_rowtype had better be a child rowtype of the rowtype of the
*
* The returned buffer is pinned and is already marked as holding the
* desired page. If it already did have the desired page, *foundPtr is
- * set TRUE. Otherwise, *foundPtr is set FALSE and the buffer is marked
+ * set true. Otherwise, *foundPtr is set false and the buffer is marked
* as IO_IN_PROGRESS; ReadBuffer will now need to do I/O to fill it.
*
* *foundPtr is actually redundant with the buffer's BM_VALID flag, but
/* Can release the mapping lock as soon as we've pinned it */
LWLockRelease(newPartitionLock);
- *foundPtr = TRUE;
+ *foundPtr = true;
if (!valid)
{
* If we get here, previous attempts to read the buffer must
* have failed ... but we shall bravely try again.
*/
- *foundPtr = FALSE;
+ *foundPtr = false;
}
}
/* Can release the mapping lock as soon as we've pinned it */
LWLockRelease(newPartitionLock);
- *foundPtr = TRUE;
+ *foundPtr = true;
if (!valid)
{
* If we get here, previous attempts to read the buffer
* must have failed ... but we shall bravely try again.
*/
- *foundPtr = FALSE;
+ *foundPtr = false;
}
}
* read it before we did, so there's nothing left for BufferAlloc() to do.
*/
if (StartBufferIO(buf, true))
- *foundPtr = FALSE;
+ *foundPtr = false;
else
- *foundPtr = TRUE;
+ *foundPtr = true;
return buf;
}
*
* Note that ResourceOwnerEnlargeBuffers must have been done already.
*
- * Returns TRUE if buffer is BM_VALID, else FALSE. This provision allows
+ * Returns true if buffer is BM_VALID, else false. This provision allows
* some callers to avoid an extra spinlock cycle.
*/
static bool
* This should be applied only to shared buffers, never local ones.
*
* Most but not all callers want CurrentResourceOwner to be adjusted.
- * Those that don't should pass fixOwner = FALSE.
+ * Those that don't should pass fixOwner = false.
*/
static void
UnpinBuffer(BufferDesc *buf, bool fixOwner)
* ConditionalLockBufferForCleanup - as above, but don't wait to get the lock
*
* We won't loop, but just check once to see if the pin count is OK. If
- * not, return FALSE with no lock held.
+ * not, return false with no lock held.
*/
bool
ConditionalLockBufferForCleanup(Buffer buffer)
* and output operations only on buffers that are BM_VALID and BM_DIRTY,
* so we can always tell if the work is already done.
*
- * Returns TRUE if we successfully marked the buffer as I/O busy,
- * FALSE if someone else already did the work.
+ * Returns true if we successfully marked the buffer as I/O busy,
+ * false if someone else already did the work.
*/
static bool
StartBufferIO(BufferDesc *buf, bool forInput)
* We hold the buffer's io_in_progress lock
* The buffer is Pinned
*
- * If clear_dirty is TRUE and BM_JUST_DIRTIED is not set, we clear the
+ * If clear_dirty is true and BM_JUST_DIRTIED is not set, we clear the
* buffer's BM_DIRTY flag. This is appropriate when terminating a
* successful write. The check on BM_JUST_DIRTIED is necessary to avoid
* marking the buffer clean if it was re-dirtied while we were writing.
ResourceOwnerRememberBuffer(CurrentResourceOwner,
BufferDescriptorGetBuffer(bufHdr));
if (buf_state & BM_VALID)
- *foundPtr = TRUE;
+ *foundPtr = true;
else
{
/* Previous read attempt must have failed; try again */
- *foundPtr = FALSE;
+ *foundPtr = false;
}
return bufHdr;
}
buf_state += BUF_USAGECOUNT_ONE;
pg_atomic_unlocked_write_u32(&bufHdr->state, buf_state);
- *foundPtr = FALSE;
+ *foundPtr = false;
return bufHdr;
}
* avoid making redundant FileSeek calls.
*/
- bool isTemp; /* can only add files if this is TRUE */
+ bool isTemp; /* can only add files if this is true */
bool isInterXact; /* keep open over transactions? */
bool dirty; /* does buffer need to be written? */
/*
* TempTablespacesAreSet
*
- * Returns TRUE if SetTempTablespaces has been called in current transaction.
+ * Returns true if SetTempTablespaces has been called in current transaction.
* (This is just so that tablespaces.c doesn't need its own per-transaction
* state.)
*/
* check that the source transaction is still running, and we'd better do
* that atomically with installing the new xmin.
*
- * Returns TRUE if successful, FALSE if source xact is no longer running.
+ * Returns true if successful, false if source xact is no longer running.
*/
bool
ProcArrayInstallImportedXmin(TransactionId xmin,
* PGPROC of the transaction from which we imported the snapshot, rather than
* an XID.
*
- * Returns TRUE if successful, FALSE if source xact is no longer running.
+ * Returns true if successful, false if source xact is no longer running.
*/
bool
ProcArrayInstallRestoredXmin(TransactionId xmin, PGPROC *proc)
* The current backend is always ignored; it is caller's responsibility to
* check whether the current backend uses the given DB, if it's important.
*
- * Returns TRUE if there are (still) other backends in the DB, FALSE if not.
+ * Returns true if there are (still) other backends in the DB, false if not.
* Also, *nbackends and *nprepared are set to the number of other backends
* and prepared transactions in the DB, respectively.
*
/*
* ShmemAddrIsValid -- test if an address refers to shared memory
*
- * Returns TRUE if the pointer points within the shared memory segment.
+ * Returns true if the pointer points within the shared memory segment.
*/
bool
ShmemAddrIsValid(const void *addr)
* for it. If it exists already, a pointer to the existing
* structure is returned.
*
- * Returns: pointer to the object. *foundPtr is set TRUE if the object was
+ * Returns: pointer to the object. *foundPtr is set true if the object was
* already in the shmem index (hence, already initialized).
*
* Note: before Postgres 9.0, this function returned NULL for some failure
/* Must be initializing a (non-standalone) backend */
Assert(shmemseghdr->index != NULL);
structPtr = shmemseghdr->index;
- *foundPtr = TRUE;
+ *foundPtr = true;
}
else
{
Assert(shmemseghdr->index == NULL);
structPtr = ShmemAlloc(size);
shmemseghdr->index = structPtr;
- *foundPtr = FALSE;
+ *foundPtr = false;
}
LWLockRelease(ShmemIndexLock);
return structPtr;
}
/*
- * SHMQueueIsDetached -- TRUE if element is not currently
+ * SHMQueueIsDetached -- true if element is not currently
* in a queue.
*/
bool
}
/*
- * SHMQueueEmpty -- TRUE if queue head is only element, FALSE otherwise
+ * SHMQueueEmpty -- true if queue head is only element, false otherwise
*/
bool
SHMQueueEmpty(const SHM_QUEUE *queue)
if (queue->prev == queue)
{
Assert(queue->next == queue);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
* SICleanupQueue
* Remove messages that have been consumed by all active backends
*
- * callerHasWriteLock is TRUE if caller is holding SInvalWriteLock.
+ * callerHasWriteLock is true if caller is holding SInvalWriteLock.
* minFree is the minimum number of message slots to make free.
*
* Possible side effects of this routine include marking one or more
* by an outer level of recursion. Add to this each possible solution
* constraint for any cycle detected at this level.
*
- * Returns TRUE if no solution exists. Returns FALSE if a deadlock-free
+ * Returns true if no solution exists. Returns false if a deadlock-free
* state is attainable, in which case waitOrders[] shows the required
* rearrangements of lock wait queues (if any).
*/
* FindLockCycle -- basic check for deadlock cycles
*
* Scan outward from the given proc to see if there is a cycle in the
- * waits-for graph that includes this proc. Return TRUE if a cycle
- * is found, else FALSE. If a cycle is found, we return a list of
+ * waits-for graph that includes this proc. Return true if a cycle
+ * is found, else false. If a cycle is found, we return a list of
* the "soft edges", if any, included in the cycle. These edges could
* potentially be eliminated by rearranging wait queues. We also fill
* deadlockDetails[] with information about the detected cycle; this info
* of nWaitOrders WAIT_ORDER structs in waitOrders[], with PGPROC array
* workspace in waitOrderProcs[].
*
- * Returns TRUE if able to build an ordering that satisfies all the
- * constraints, FALSE if not (there are contradictory constraints).
+ * Returns true if able to build an ordering that satisfies all the
+ * constraints, false if not (there are contradictory constraints).
*/
static bool
ExpandConstraints(EDGE *constraints,
* the "blocker" in the output array. The EDGE array may well contain
* edges associated with other locks; these should be ignored.
*
- * Returns TRUE if able to build an ordering that satisfies all the
- * constraints, FALSE if not (there are contradictory constraints).
+ * Returns true if able to build an ordering that satisfies all the
+ * constraints, false if not (there are contradictory constraints).
*/
static bool
TopoSort(LOCK *lock,
* ConditionalLockRelationOid
*
* As above, but only lock if we can get the lock without blocking.
- * Returns TRUE iff the lock was acquired.
+ * Returns true iff the lock was acquired.
*
* NOTE: we do not currently need conditional versions of all the
* LockXXX routines in this file, but they could easily be added if needed.
* ConditionalLockRelationForExtension
*
* As above, but only lock if we can get the lock without blocking.
- * Returns TRUE iff the lock was acquired.
+ * Returns true iff the lock was acquired.
*/
bool
ConditionalLockRelationForExtension(Relation relation, LOCKMODE lockmode)
* ConditionalLockPage
*
* As above, but only lock if we can get the lock without blocking.
- * Returns TRUE iff the lock was acquired.
+ * Returns true iff the lock was acquired.
*/
bool
ConditionalLockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode)
* ConditionalLockTuple
*
* As above, but only lock if we can get the lock without blocking.
- * Returns TRUE iff the lock was acquired.
+ * Returns true iff the lock was acquired.
*/
bool
ConditionalLockTuple(Relation relation, ItemPointer tid, LOCKMODE lockmode)
* ConditionalXactLockTableWait
*
* As above, but only lock if we can get the lock without blocking.
- * Returns TRUE if the lock was acquired.
+ * Returns true if the lock was acquired.
*/
bool
ConditionalXactLockTableWait(TransactionId xid)
locallock->nLocks = 0;
locallock->numLockOwners = 0;
locallock->maxLockOwners = 8;
- locallock->holdsStrongLockCount = FALSE;
+ locallock->holdsStrongLockCount = false;
locallock->lockOwners = NULL; /* in case next line fails */
locallock->lockOwners = (LOCALLOCKOWNER *)
MemoryContextAlloc(TopMemoryContext,
SpinLockAcquire(&FastPathStrongRelationLocks->mutex);
Assert(FastPathStrongRelationLocks->count[fasthashcode] > 0);
FastPathStrongRelationLocks->count[fasthashcode]--;
- locallock->holdsStrongLockCount = FALSE;
+ locallock->holdsStrongLockCount = false;
SpinLockRelease(&FastPathStrongRelationLocks->mutex);
}
BeginStrongLockAcquire(LOCALLOCK *locallock, uint32 fasthashcode)
{
Assert(StrongLockInProgress == NULL);
- Assert(locallock->holdsStrongLockCount == FALSE);
+ Assert(locallock->holdsStrongLockCount == false);
/*
* Adding to a memory location is not atomic, so we take a spinlock to
SpinLockAcquire(&FastPathStrongRelationLocks->mutex);
FastPathStrongRelationLocks->count[fasthashcode]++;
- locallock->holdsStrongLockCount = TRUE;
+ locallock->holdsStrongLockCount = true;
StrongLockInProgress = locallock;
SpinLockRelease(&FastPathStrongRelationLocks->mutex);
}
return;
fasthashcode = FastPathStrongLockHashPartition(locallock->hashcode);
- Assert(locallock->holdsStrongLockCount == TRUE);
+ Assert(locallock->holdsStrongLockCount == true);
SpinLockAcquire(&FastPathStrongRelationLocks->mutex);
Assert(FastPathStrongRelationLocks->count[fasthashcode] > 0);
FastPathStrongRelationLocks->count[fasthashcode]--;
- locallock->holdsStrongLockCount = FALSE;
+ locallock->holdsStrongLockCount = false;
StrongLockInProgress = NULL;
SpinLockRelease(&FastPathStrongRelationLocks->mutex);
}
{
elog(WARNING, "you don't own a lock of type %s",
lockMethodTable->lockModeNames[lockmode]);
- return FALSE;
+ return false;
}
/*
/* don't release a lock belonging to another owner */
elog(WARNING, "you don't own a lock of type %s",
lockMethodTable->lockModeNames[lockmode]);
- return FALSE;
+ return false;
}
}
locallock->nLocks--;
if (locallock->nLocks > 0)
- return TRUE;
+ return true;
/* Attempt fast release of any lock eligible for the fast path. */
if (EligibleForRelationFastPath(locktag, lockmode) &&
if (released)
{
RemoveLocalLock(locallock);
- return TRUE;
+ return true;
}
}
elog(WARNING, "you don't own a lock of type %s",
lockMethodTable->lockModeNames[lockmode]);
RemoveLocalLock(locallock);
- return FALSE;
+ return false;
}
/*
LWLockRelease(partitionLock);
RemoveLocalLock(locallock);
- return TRUE;
+ return true;
}
/*
* entry. We must retain the count until the prepared transaction is
* committed or rolled back.
*/
- locallock->holdsStrongLockCount = FALSE;
+ locallock->holdsStrongLockCount = false;
/*
* Create a 2PC record.
/*
* LWLockConditionalAcquire - acquire a lightweight lock in the specified mode
*
- * If the lock is not available, return FALSE with no side-effects.
+ * If the lock is not available, return false with no side-effects.
*
* If successful, cancel/die interrupts are held off until lock release.
*/
* If logging is needed, the duration in msec is formatted into msec_str[],
* which must be a 32-byte buffer.
*
- * was_logged should be TRUE if caller already logged query details (this
+ * was_logged should be true if caller already logged query details (this
* essentially prevents 2 from being returned).
*/
int
* in which to store a command completion status string.
* May be NULL if caller doesn't want a status string.
*
- * Returns TRUE if the portal's execution is complete, FALSE if it was
+ * Returns true if the portal's execution is complete, false if it was
* suspended due to exhaustion of the count parameter.
*/
bool
*
* The buffer at "next" must be of size BUFSIZ; we truncate the input to fit.
*
- * Returns TRUE if we found a field, FALSE if not.
+ * Returns true if we found a field, false if not.
*/
static bool
get_nextfield(char **str, char *next)
* Outputs:
* values[]: filled with converted data values.
* nulls[]: filled with is-null markers.
- * *hasnulls: set TRUE iff there are any null elements.
+ * *hasnulls: set true iff there are any null elements.
* *nbytes: set to total size of data area needed (including alignment
* padding but not including array header overhead).
*
* nulls: array of is-null flags (can be NULL if no nulls)
* nitems: number of Datums to be copied
* typbyval, typlen, typalign: info about element datatype
- * freedata: if TRUE and element type is pass-by-ref, pfree data values
+ * freedata: if true and element type is pass-by-ref, pfree data values
* referenced by Datums after copying them.
*
* If the input data is of varlena type, the caller must have ensured that
* Outputs:
* values[]: filled with converted data values.
* nulls[]: filled with is-null markers.
- * *hasnulls: set TRUE iff there are any null elements.
+ * *hasnulls: set true iff there are any null elements.
* *nbytes: set to total size of data area needed (including alignment
* padding but not including array header overhead).
*
int val;
int dterr;
int mer = HR24;
- bool haveTextMonth = FALSE;
- bool isjulian = FALSE;
- bool is2digits = FALSE;
- bool bc = FALSE;
+ bool haveTextMonth = false;
+ bool isjulian = false;
+ bool is2digits = false;
+ bool bc = false;
pg_tz *namedTz = NULL;
pg_tz *abbrevTz = NULL;
pg_tz *valtz;
return DTERR_FIELD_OVERFLOW;
j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
- isjulian = TRUE;
+ isjulian = true;
/* Get the time zone from the end of the string */
dterr = DecodeTimezone(cp, tzp);
return DTERR_FIELD_OVERFLOW;
tmask = DTK_DATE_M;
j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
- isjulian = TRUE;
+ isjulian = true;
/* fractional Julian Day? */
if (*cp == '.')
tm->tm_mday = tm->tm_mon;
tmask = DTK_M(DAY);
}
- haveTextMonth = TRUE;
+ haveTextMonth = true;
tm->tm_mon = val;
break;
int i;
int val;
int dterr;
- bool isjulian = FALSE;
- bool is2digits = FALSE;
- bool bc = FALSE;
+ bool isjulian = false;
+ bool is2digits = false;
+ bool bc = false;
int mer = HR24;
pg_tz *namedTz = NULL;
pg_tz *abbrevTz = NULL;
return DTERR_FIELD_OVERFLOW;
tmask = DTK_DATE_M;
j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
- isjulian = TRUE;
+ isjulian = true;
if (*cp == '.')
{
else
{
dterr = DecodeNumber(flen, field[i],
- FALSE,
+ false,
(fmask | DTK_DATE_M),
&tmask, tm,
fsec, &is2digits);
* str: field to be parsed
* fmask: bitmask for field types already seen
* *tmask: receives bitmask for fields found here
- * *is2digits: set to TRUE if we find 2-digit year
+ * *is2digits: set to true if we find 2-digit year
* *tm: field values are stored into appropriate members of this struct
*/
static int
int i,
len;
int dterr;
- bool haveTextMonth = FALSE;
+ bool haveTextMonth = false;
int type,
val,
dmask = 0;
{
case MONTH:
tm->tm_mon = val;
- haveTextMonth = TRUE;
+ haveTextMonth = true;
break;
default:
*tmask = DTK_M(DAY); /* YEAR is already set */
tm->tm_mday = tm->tm_year;
tm->tm_year = val;
- *is2digits = FALSE;
+ *is2digits = false;
}
else
{
*(str + (len - 4)) = '\0';
tm->tm_year = atoi(str);
if ((len - 4) == 2)
- *is2digits = TRUE;
+ *is2digits = true;
return DTK_DATE;
}
DecodeInterval(char **field, int *ftype, int nf, int range,
int *dtype, struct pg_tm *tm, fsec_t *fsec)
{
- bool is_before = FALSE;
+ bool is_before = false;
char *cp;
int fmask = 0,
tmask,
break;
case AGO:
- is_before = TRUE;
+ is_before = true;
type = val;
break;
* tad bizarre but it's how it worked before...
*/
*is_before = (value < 0);
- *is_zero = FALSE;
+ *is_zero = false;
return cp + strlen(cp);
}
else if (*is_before)
value = -value;
sprintf(cp, " %d %s%s", value, units, (value == 1) ? "" : "s");
- *is_zero = FALSE;
+ *is_zero = false;
return cp + strlen(cp);
}
int hour = tm->tm_hour;
int min = tm->tm_min;
int sec = tm->tm_sec;
- bool is_before = FALSE;
- bool is_zero = TRUE;
+ bool is_before = false;
+ bool is_zero = true;
/*
* The sign of year and month are guaranteed to match, since they are
if (sec < 0 || (sec == 0 && fsec < 0))
{
if (is_zero)
- is_before = TRUE;
+ is_before = true;
else if (!is_before)
*cp++ = '-';
}
cp = AppendSeconds(cp, sec, fsec, MAX_INTERVAL_PRECISION, false);
sprintf(cp, " sec%s",
(abs(sec) != 1 || fsec != 0) ? "s" : "");
- is_zero = FALSE;
+ is_zero = false;
}
/* identically zero? then put in a unitless zero... */
if (is_zero)
*/
static const KeyWord DCH_keywords[] = {
/* name, len, id, is_digit, date_mode */
- {"A.D.", 4, DCH_A_D, FALSE, FROM_CHAR_DATE_NONE}, /* A */
- {"A.M.", 4, DCH_A_M, FALSE, FROM_CHAR_DATE_NONE},
- {"AD", 2, DCH_AD, FALSE, FROM_CHAR_DATE_NONE},
- {"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 */
- {"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},
- {"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 */
- {"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 */
- {"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},
- {"IYY", 3, DCH_IYY, 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 */
- {"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 */
- {"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 */
- {"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 */
- {"YYYY", 4, DCH_YYYY, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"YYY", 3, DCH_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"YY", 2, DCH_YY, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"Y", 1, DCH_Y, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"a.d.", 4, DCH_a_d, FALSE, FROM_CHAR_DATE_NONE}, /* a */
- {"a.m.", 4, DCH_a_m, FALSE, FROM_CHAR_DATE_NONE},
- {"ad", 2, DCH_ad, FALSE, FROM_CHAR_DATE_NONE},
- {"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 */
- {"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 */
- {"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 */
- {"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},
- {"iyy", 3, DCH_IYY, 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 */
- {"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},
- {"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 */
- {"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 */
- {"yyyy", 4, DCH_YYYY, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"yyy", 3, DCH_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"yy", 2, DCH_YY, TRUE, FROM_CHAR_DATE_GREGORIAN},
- {"y", 1, DCH_Y, TRUE, FROM_CHAR_DATE_GREGORIAN},
+ {"A.D.", 4, DCH_A_D, false, FROM_CHAR_DATE_NONE}, /* A */
+ {"A.M.", 4, DCH_A_M, false, FROM_CHAR_DATE_NONE},
+ {"AD", 2, DCH_AD, false, FROM_CHAR_DATE_NONE},
+ {"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 */
+ {"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},
+ {"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 */
+ {"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 */
+ {"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},
+ {"IYY", 3, DCH_IYY, 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 */
+ {"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 */
+ {"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 */
+ {"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 */
+ {"YYYY", 4, DCH_YYYY, true, FROM_CHAR_DATE_GREGORIAN},
+ {"YYY", 3, DCH_YYY, true, FROM_CHAR_DATE_GREGORIAN},
+ {"YY", 2, DCH_YY, true, FROM_CHAR_DATE_GREGORIAN},
+ {"Y", 1, DCH_Y, true, FROM_CHAR_DATE_GREGORIAN},
+ {"a.d.", 4, DCH_a_d, false, FROM_CHAR_DATE_NONE}, /* a */
+ {"a.m.", 4, DCH_a_m, false, FROM_CHAR_DATE_NONE},
+ {"ad", 2, DCH_ad, false, FROM_CHAR_DATE_NONE},
+ {"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 */
+ {"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 */
+ {"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 */
+ {"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},
+ {"iyy", 3, DCH_IYY, 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 */
+ {"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},
+ {"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 */
+ {"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 */
+ {"yyyy", 4, DCH_YYYY, true, FROM_CHAR_DATE_GREGORIAN},
+ {"yyy", 3, DCH_YYY, true, FROM_CHAR_DATE_GREGORIAN},
+ {"yy", 2, DCH_YY, true, FROM_CHAR_DATE_GREGORIAN},
+ {"y", 1, DCH_Y, true, FROM_CHAR_DATE_GREGORIAN},
/* last */
{NULL, 0, 0, 0, 0}
case NUM_D:
num->flag |= NUM_F_LDECIMAL;
- num->need_locale = TRUE;
+ num->need_locale = true;
/* FALLTHROUGH */
case NUM_DEC:
if (IS_DECIMAL(num))
{
num->lsign = NUM_LSIGN_PRE;
num->pre_lsign_num = num->pre;
- num->need_locale = TRUE;
+ num->need_locale = true;
num->flag |= NUM_F_LSIGN;
}
else if (num->lsign == NUM_LSIGN_NONE)
{
num->lsign = NUM_LSIGN_POST;
- num->need_locale = TRUE;
+ num->need_locale = true;
num->flag |= NUM_F_LSIGN;
}
break;
case NUM_L:
case NUM_G:
- num->need_locale = TRUE;
+ num->need_locale = true;
break;
case NUM_V:
#endif /* DEBUG */
/* ----------
- * Return TRUE if next format picture is not digit value
+ * Return true if next format picture is not digit value
* ----------
*/
static bool
is_next_separator(FormatNode *n)
{
if (n->type == NODE_TYPE_END)
- return FALSE;
+ return false;
if (n->type == NODE_TYPE_ACTION && S_THth(n->suffix))
- return TRUE;
+ return true;
/*
* Next node
/* end of format string is treated like a non-digit separator */
if (n->type == NODE_TYPE_END)
- return TRUE;
+ return true;
if (n->type == NODE_TYPE_ACTION)
{
if (n->key->is_digit)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
else if (isdigit((unsigned char) n->character))
- return FALSE;
+ return false;
- return TRUE; /* some non-digit input (separator) */
+ return true; /* some non-digit input (separator) */
}
* Allocate new memory if format picture is bigger than static cache
* and do not use cache (call parser always)
*/
- incache = FALSE;
+ incache = false;
format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode));
*/
DCHCacheEntry *ent = DCH_cache_fetch(fmt_str);
- incache = TRUE;
+ incache = true;
format = ent->format;
}
* Allocate new memory if format picture is bigger than static
* cache and do not use cache (call parser always)
*/
- incache = FALSE;
+ incache = false;
format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode));
*/
DCHCacheEntry *ent = DCH_cache_fetch(fmt_str);
- incache = TRUE;
+ incache = true;
format = ent->format;
}
static void
NUM_numpart_from_char(NUMProc *Np, int id, int input_len)
{
- bool isread = FALSE;
+ bool isread = false;
#ifdef DEBUG_TO_FROM_CHAR
elog(DEBUG_elog_output, " --- scan start --- id=%s",
else
Np->read_pre++;
- isread = TRUE;
+ isread = true;
#ifdef DEBUG_TO_FROM_CHAR
elog(DEBUG_elog_output, "Read digit (%c)", *Np->inout_p);
#endif
}
- else if (IS_DECIMAL(Np->Num) && Np->read_dec == FALSE)
+ else if (IS_DECIMAL(Np->Num) && Np->read_dec == false)
{
/*
* We need not test IS_LDECIMAL(Np->Num) explicitly here, because
Np->inout_p += x - 1;
*Np->number_p = '.';
Np->number_p++;
- Np->read_dec = TRUE;
- isread = TRUE;
+ Np->read_dec = true;
+ isread = true;
}
}
*
* FM9.999999MI -> 5.01-
*
- * if (.... && IS_LSIGN(Np->Num)==FALSE) prevents read wrong formats
+ * if (.... && IS_LSIGN(Np->Num)==false) prevents read wrong formats
* like to_number('1 -', '9S') where sign is not anchored to last
* number.
*/
- else if (isread == FALSE && IS_LSIGN(Np->Num) == FALSE &&
+ else if (isread == false && IS_LSIGN(Np->Num) == false &&
(IS_PLUS(Np->Num) || IS_MINUS(Np->Num)))
{
#ifdef DEBUG_TO_FROM_CHAR
}
#define IS_PREDEC_SPACE(_n) \
- (IS_ZERO((_n)->Num)==FALSE && \
+ (IS_ZERO((_n)->Num)==false && \
(_n)->number == (_n)->number_p && \
*(_n)->number == '0' && \
(_n)->Num->post != 0)
Np->number_p,
Np->inout);
#endif
- Np->num_in = FALSE;
+ Np->num_in = false;
/*
* Write sign if real number will write to output Note: IS_PREDEC_SPACE()
* handle "9.9" --> " .1"
*/
- if (Np->sign_wrote == FALSE &&
+ if (Np->sign_wrote == false &&
(Np->num_curr >= Np->out_pre_spaces || (IS_ZERO(Np->Num) && Np->Num->zero_start == Np->num_curr)) &&
- (IS_PREDEC_SPACE(Np) == FALSE || (Np->last_relevant && *Np->last_relevant == '.')))
+ (IS_PREDEC_SPACE(Np) == false || (Np->last_relevant && *Np->last_relevant == '.')))
{
if (IS_LSIGN(Np->Num))
{
else
strcpy(Np->inout_p, Np->L_positive_sign);
Np->inout_p += strlen(Np->inout_p);
- Np->sign_wrote = TRUE;
+ Np->sign_wrote = true;
}
}
else if (IS_BRACKET(Np->Num))
{
*Np->inout_p = Np->sign == '+' ? ' ' : '<';
++Np->inout_p;
- Np->sign_wrote = TRUE;
+ Np->sign_wrote = true;
}
else if (Np->sign == '+')
{
*Np->inout_p = ' '; /* Write + */
++Np->inout_p;
}
- Np->sign_wrote = TRUE;
+ Np->sign_wrote = true;
}
else if (Np->sign == '-')
{ /* Write - */
*Np->inout_p = '-';
++Np->inout_p;
- Np->sign_wrote = TRUE;
+ Np->sign_wrote = true;
}
}
*/
*Np->inout_p = '0'; /* Write '0' */
++Np->inout_p;
- Np->num_in = TRUE;
+ Np->num_in = true;
}
else
{
{
*Np->inout_p = *Np->number_p; /* Write DIGIT */
++Np->inout_p;
- Np->num_in = TRUE;
+ Np->num_in = true;
}
}
/* do no exceed string length */
if (Np->num_curr + 1 == end)
{
- if (Np->sign_wrote == TRUE && IS_BRACKET(Np->Num))
+ if (Np->sign_wrote == true && IS_BRACKET(Np->Num))
{
*Np->inout_p = Np->sign == '+' ? ' ' : '>';
++Np->inout_p;
Np->last_relevant = NULL;
Np->read_post = 0;
Np->read_pre = 0;
- Np->read_dec = FALSE;
+ Np->read_dec = false;
if (Np->Num->zero_start)
--Np->Num->zero_start;
/* MI/PL/SG - write sign itself and not in number */
if (IS_PLUS(Np->Num) || IS_MINUS(Np->Num))
{
- if (IS_PLUS(Np->Num) && IS_MINUS(Np->Num) == FALSE)
- Np->sign_wrote = FALSE; /* need sign */
+ if (IS_PLUS(Np->Num) && IS_MINUS(Np->Num) == false)
+ Np->sign_wrote = false; /* need sign */
else
- Np->sign_wrote = TRUE; /* needn't sign */
+ Np->sign_wrote = true; /* needn't sign */
}
else
{
else if (Np->sign != '+' && IS_PLUS(Np->Num))
Np->Num->flag &= ~NUM_F_PLUS;
- if (Np->sign == '+' && IS_FILLMODE(Np->Num) && IS_LSIGN(Np->Num) == FALSE)
- Np->sign_wrote = TRUE; /* needn't sign */
+ if (Np->sign == '+' && IS_FILLMODE(Np->Num) && IS_LSIGN(Np->Num) == false)
+ Np->sign_wrote = true; /* needn't sign */
else
- Np->sign_wrote = FALSE; /* need sign */
+ Np->sign_wrote = false; /* need sign */
if (Np->Num->lsign == NUM_LSIGN_PRE && Np->Num->pre == Np->Num->pre_lsign_num)
Np->Num->lsign = NUM_LSIGN_POST;
}
}
else
- Np->sign = FALSE;
+ Np->sign = false;
/*
* Count
}
}
- if (Np->sign_wrote == FALSE && Np->out_pre_spaces == 0)
+ if (Np->sign_wrote == false && Np->out_pre_spaces == 0)
++Np->num_count;
}
else
{
PATH *path = PG_GETARG_PATH_P_COPY(0);
- path->closed = TRUE;
+ path->closed = true;
PG_RETURN_PATH_P(path);
}
{
PATH *path = PG_GETARG_PATH_P_COPY(0);
- path->closed = FALSE;
+ path->closed = false;
PG_RETURN_PATH_P(path);
}
SET_VARSIZE(path, size);
path->npts = poly->npts;
- path->closed = TRUE;
+ path->closed = true;
/* prevent instability in unused pad bytes */
path->dummy = 0;
printf("plist_same- ii = %d/%d after forward match\n", ii, npts);
#endif
if (ii == npts)
- return TRUE;
+ return true;
/* match not found forwards? then look backwards */
for (ii = 1, j = i - 1; ii < npts; ii++, j--)
printf("plist_same- ii = %d/%d after reverse match\n", ii, npts);
#endif
if (ii == npts)
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
/*
* Common subroutine for num_nulls() and num_nonnulls().
- * Returns TRUE if successful, FALSE if function should return NULL.
+ * Returns true if successful, false if function should return NULL.
* If successful, total argument count and number of nulls are
* returned into *nargs and *nulls.
*/
gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else
{
gistentryinit(*retval, (Datum) 0,
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
}
else
retval = palloc(sizeof(GISTENTRY));
gistentryinit(*retval, InetPGetDatum(dst), entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
PG_RETURN_POINTER(retval);
}
static const char *
set_var_from_str(const char *str, const char *cp, NumericVar *dest)
{
- bool have_dp = FALSE;
+ bool have_dp = false;
int i;
unsigned char *decdigits;
int sign = NUMERIC_POS;
if (*cp == '.')
{
- have_dp = TRUE;
+ have_dp = true;
cp++;
}
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type %s: \"%s\"",
"numeric", str)));
- have_dp = TRUE;
+ have_dp = true;
cp++;
}
else
/*
* Convert numeric to int8, rounding if needed.
*
- * If overflow, return FALSE (no error is raised). Return TRUE if okay.
+ * If overflow, return false (no error is raised). Return true if okay.
*/
static bool
numericvar_to_int64(const NumericVar *var, int64 *result)
/*
* Convert numeric to int128, rounding if needed.
*
- * If overflow, return FALSE (no error is raised). Return TRUE if okay.
+ * If overflow, return false (no error is raised). Return true if okay.
*/
static bool
numericvar_to_int128(const NumericVar *var, int128 *result)
/*
* RE_wchar_execute - execute a RE on pg_wchar data
*
- * Returns TRUE on match, FALSE on no match
+ * Returns true on match, false on no match
*
* re --- the compiled pattern as returned by RE_compile_and_cache
* data --- the data to match against (need not be null-terminated)
/*
* RE_execute - execute a RE
*
- * Returns TRUE on match, FALSE on no match
+ * Returns true on match, false on no match
*
* re --- the compiled pattern as returned by RE_compile_and_cache
* dat --- the data to match against (need not be null-terminated)
/*
* RE_compile_and_execute - compile and execute a RE
*
- * Returns TRUE on match, FALSE on no match
+ * Returns true on match, false on no match
*
* text_re --- the pattern, expressed as a TEXT object
* dat --- the data to match against (need not be null-terminated)
* regexp_fixed_prefix - extract fixed prefix, if any, for a regexp
*
* The result is NULL if there is no fixed prefix, else a palloc'd string.
- * If it is an exact match, not just a prefix, *exact is returned as TRUE.
+ * If it is an exact match, not just a prefix, *exact is returned as true.
*/
char *
regexp_fixed_prefix(text *text_re, bool case_insensitive, Oid collation,
* the argtypes array should be of size FUNC_MAX_ARGS). The function or
* operator name is returned to *names as a List of Strings.
*
- * If allowNone is TRUE, accept "NONE" and return it as InvalidOid (this is
+ * If allowNone is true, accept "NONE" and return it as InvalidOid (this is
* for unary operators).
*/
static void
*
* Check if we really need to fire the RI trigger for an update to a PK
* relation. This is called by the AFTER trigger queue manager to see if
- * it can skip queuing an instance of an RI trigger. Returns TRUE if the
- * trigger must be fired, FALSE if we can prove the constraint will still
+ * it can skip queuing an instance of an RI trigger. Returns true if the
+ * trigger must be fired, false if we can prove the constraint will still
* be satisfied.
* ----------
*/
*
* Check if we really need to fire the RI trigger for an update to an FK
* relation. This is called by the AFTER trigger queue manager to see if
- * it can skip queuing an instance of an RI trigger. Returns TRUE if the
- * trigger must be fired, FALSE if we can prove the constraint will still
+ * it can skip queuing an instance of an RI trigger. Returns true if the
+ * trigger must be fired, false if we can prove the constraint will still
* be satisfied.
* ----------
*/
int prettyFlags; /* enabling of pretty-print functions */
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 */
+ bool varprefix; /* true to print prefixes on Vars */
ParseExprKind special_exprkind; /* set only for exprkinds needing special
* handling */
} deparse_context;
* rtable_columns holds the column alias names to be used for each RTE.
*
* In some cases we need to make names of merged JOIN USING columns unique
- * across the whole query, not only per-RTE. If so, unique_using is TRUE
+ * across the whole query, not only per-RTE. If so, unique_using is true
* and using_names is a list of C strings representing names already assigned
* to USING columns.
*
* for interpreting Vars in the node tree. It can be NIL if no Vars are
* expected.
*
- * forceprefix is TRUE to force all Vars to be prefixed with their table names.
+ * forceprefix is true to force all Vars to be prefixed with their table names.
*
- * showimplicit is TRUE to force all implicit casts to be shown explicitly.
+ * showimplicit is true to force all implicit casts to be shown explicitly.
*
* Tries to pretty up the output according to prettyFlags and startIndent.
*
* If there's a USING clause, select the USING column names and push
* those names down to the children. We have two strategies:
*
- * If dpns->unique_using is TRUE, we force all USING names to be
+ * If dpns->unique_using is true, we force all USING names to be
* unique across the whole query level. In principle we'd only need
* the names of dangerous USING columns to be globally unique, but to
* safely assign all USING names in a single pass, we have to enforce
* this simplifies the logic and seems likely to lead to less aliasing
* overall.
*
- * If dpns->unique_using is FALSE, we only need USING names to be
+ * If dpns->unique_using is false, we only need USING names to be
* unique within their own join RTE. We still need to honor
* pushed-down names, though.
*
ListCell *lc;
/*
- * We want to return TRUE even if the Query also contains OLD or NEW rule
+ * We want to return true even if the Query also contains OLD or NEW rule
* RTEs. So the idea is to scan the rtable and see if there is only one
* inFromCl RTE that is a VALUES RTE.
*/
* the Var's varlevelsup has to be interpreted with respect to a context
* above the current one; levelsup indicates the offset.
*
- * If istoplevel is TRUE, the Var is at the top level of a SELECT's
+ * If istoplevel is true, the Var is at the top level of a SELECT's
* targetlist, which means we need special treatment of whole-row Vars.
* Instead of the normal "tab.*", we'll print "tab.*::typename", which is a
* dirty hack to prevent "tab.*" from being expanded into multiple columns.
* means a FuncExpr or Aggref, not some other way of calling a function), then
* has_variadic must specify whether variadic arguments have been merged,
* and *use_variadic_p will be set to indicate whether to print VARIADIC in
- * the output. For non-FuncExpr cases, has_variadic should be FALSE and
+ * the output. For non-FuncExpr cases, has_variadic should be false and
* use_variadic_p can be NULL.
*
* The result includes all necessary quoting and schema-prefixing.
* hand! (For example, we might have a '<=' operator rather than the '<'
* operator that will appear in staop.) For now, assume that whatever
* appears in pg_statistic is sorted the same way our operator sorts, or
- * the reverse way if isgt is TRUE.
+ * the reverse way if isgt is true.
*/
if (HeapTupleIsValid(vardata->statsTuple) &&
statistic_proc_security_check(vardata, opproc->fn_oid) &&
*
* Varinfos that aren't for simple Vars are ignored.
*
- * Return TRUE if we're able to find a match, FALSE otherwise.
+ * Return true if we're able to find a match, false otherwise.
*/
static bool
estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel,
* args: clause argument list
* varRelid: see specs for restriction selectivity functions
*
- * Outputs: (these are valid only if TRUE is returned)
+ * Outputs: (these are valid only if true is returned)
* *vardata: gets information about variable (see examine_variable)
* *other: gets other clause argument, aggressively reduced to a constant
- * *varonleft: set TRUE if variable is on the left, FALSE if on the right
+ * *varonleft: set true if variable is on the left, false if on the right
*
- * Returns TRUE if a variable is identified, otherwise FALSE.
+ * Returns true if a variable is identified, otherwise false.
*
* Note: if there are Vars on both sides of the clause, we must fail, because
* callers are expecting that the other side will act like a pseudoconstant.
* atttype, atttypmod: actual type/typmod of the "var" expression. This is
* commonly the same as the exposed type of the variable argument,
* but can be different in binary-compatible-type cases.
- * isunique: TRUE if we were able to match the var to a unique index or a
+ * isunique: true if we were able to match the var to a unique index or a
* single-column DISTINCT clause, implying its values are unique for
* this query. (Caution: this should be trusted for statistical
* purposes only, since we do not check indimmediate nor verify that
* the exact same definition of equality applies.)
- * acl_ok: TRUE if current user has permission to read the column(s)
+ * acl_ok: true if current user has permission to read the column(s)
* underlying the pg_statistic entry. This is consulted by
* statistic_proc_security_check().
*
* Estimate the number of distinct values of a variable.
*
* vardata: results of examine_variable
- * *isdefault: set to TRUE if the result is a default rather than based on
+ * *isdefault: set to true if the result is a default rather than based on
* anything meaningful.
*
* NB: be careful to produce a positive integral result, since callers may
/*
* get_variable_range
* Estimate the minimum and maximum value of the specified variable.
- * If successful, store values in *min and *max, and return TRUE.
- * If no data available, return FALSE.
+ * If successful, store values in *min and *max, and return true.
+ * If no data available, return false.
*
* sortop is the "<" comparison operator to use. This should generally
* be "<" not ">", as only the former is likely to be found in pg_statistic.
* Attempt to identify the current *actual* minimum and/or maximum
* of the specified variable, by looking for a suitable btree index
* and fetching its low and/or high values.
- * If successful, store values in *min and *max, and return TRUE.
+ * If successful, store values in *min and *max, and return true.
* (Either pointer can be NULL if that endpoint isn't needed.)
- * If no data available, return FALSE.
+ * If no data available, return false.
*
* sortop is the "<" comparison operator to use.
*/
/* int32 nkeys = PG_GETARG_INT32(3); */
Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
bool *recheck = (bool *) PG_GETARG_POINTER(5);
- bool res = FALSE;
+ bool res = false;
/* Initially assume query doesn't require recheck */
*recheck = false;
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(res),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
else if (ISSIGNKEY(DatumGetPointer(entry->key)) &&
!ISALLTRUE(DatumGetPointer(entry->key)))
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
gistentryinit(*retval, PointerGetDatum(res),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
PG_RETURN_POINTER(retval);
}
gistentryinit(*retval, PointerGetDatum(key),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
PG_RETURN_POINTER(retval);
}
gistentryinit(*retval, TSQuerySignGetDatum(sign),
entry->rel, entry->page,
- entry->offset, FALSE);
+ entry->offset, false);
}
PG_RETURN_POINTER(retval);
retval = (key & sq) != 0;
break;
default:
- retval = FALSE;
+ retval = false;
}
PG_RETURN_BOOL(retval);
}
* namelist: filled with a palloc'd list of pointers to identifiers within
* rawstring. Caller should list_free() this even on error return.
*
- * Returns TRUE if okay, FALSE if there is a syntax error in the string.
+ * Returns true if okay, false if there is a syntax error in the string.
*
* Note that an empty string is considered okay here, though not in
* textToQualifiedNameList.
* namelist: filled with a palloc'd list of directory names.
* Caller should list_free_deep() this even on error return.
*
- * Returns TRUE if okay, FALSE if there is a syntax error in the string.
+ * Returns true if okay, false if there is a syntax error in the string.
*
* Note that an empty string is considered okay here.
*/
/*
* XmlTableFetchRow
* Prepare the next "current" tuple for upcoming GetValue calls.
- * Returns FALSE if the row-filter expression returned no more rows.
+ * Returns false if the row-filter expression returned no more rows.
*/
static bool
XmlTableFetchRow(TableFuncScanState *state)
* determine its opfamily, its declared input datatype, and its
* strategy number (BTLessStrategyNumber or BTGreaterStrategyNumber).
*
- * Returns TRUE if successful, FALSE if no matching pg_amop entry exists.
+ * Returns true if successful, false if no matching pg_amop entry exists.
* (This indicates that the operator is not a valid ordering operator.)
*
* Note: the operator could be registered in multiple families, for example
* Get the OID of the datatype-specific btree equality operator
* associated with an ordering operator (a "<" or ">" operator).
*
- * If "reverse" isn't NULL, also set *reverse to FALSE if the operator is "<",
- * TRUE if it's ">"
+ * If "reverse" isn't NULL, also set *reverse to false if the operator is "<",
+ * true if it's ">"
*
* Returns InvalidOid if no matching equality operator can be found.
* (This indicates that the operator is not a valid ordering operator.)
/*
* equality_ops_are_compatible
- * Return TRUE if the two given equality operators have compatible
+ * Return true if the two given equality operators have compatible
* semantics.
*
* This is trivially true if they are the same operator. Otherwise,
* get_attstatsslot
*
* Extract the contents of a "slot" of a pg_statistic tuple.
- * Returns TRUE if requested slot type was found, else FALSE.
+ * Returns true if requested slot type was found, else false.
*
* Unlike other routines in this file, this takes a pointer to an
* already-looked-up tuple in the pg_statistic cache. We do this since
* reqop: STAOP value wanted, or InvalidOid if don't care.
* flags: bitmask of ATTSTATSSLOT_VALUES and/or ATTSTATSSLOT_NUMBERS.
*
- * If a matching slot is found, TRUE is returned, and *sslot is filled thus:
+ * If a matching slot is found, true is returned, and *sslot is filled thus:
* staop: receives the actual STAOP value.
* valuetype: receives actual datatype of the elements of stavalues.
* values: receives pointer to an array of the slot's stavalues.
* wasn't specified. Likewise, numbers/nnumbers are NULL/0 if
* ATTSTATSSLOT_NUMBERS wasn't specified.
*
- * If no matching slot is found, FALSE is returned, and *sslot is zeroed.
+ * If no matching slot is found, false is returned, and *sslot is zeroed.
*
* The data referred to by the fields of sslot is locally palloc'd and
* is independent of the original pg_statistic tuple. When the caller
* parserSetup: alternate method for handling query parameters
* parserSetupArg: data to pass to parserSetup
* cursor_options: options bitmask to pass to planner
- * fixed_result: TRUE to disallow future changes in query's result tupdesc
+ * fixed_result: true to disallow future changes in query's result tupdesc
*/
void
CompleteCachedPlan(CachedPlanSource *plansource,
typedef struct opclasscacheent
{
Oid opclassoid; /* lookup key: OID of opclass */
- bool valid; /* set TRUE after successful fill-in */
+ bool valid; /* set true after successful fill-in */
StrategyNumber numSupport; /* max # of support procs (from pg_am) */
Oid opcfamily; /* OID of opclass's family */
Oid opcintype; /* OID of opclass's declared input type */
* load_relcache_init_file -- attempt to load cache from the shared
* or local cache init file
*
- * If successful, return TRUE and set criticalRelcachesBuilt or
+ * If successful, return true and set criticalRelcachesBuilt or
* criticalSharedRelcachesBuilt to true.
- * If not successful, return FALSE.
+ * If not successful, return false.
*
* NOTE: we assume we are already switched into CacheMemoryContext.
*/
* The magic number and CRC are automatically updated in *newmap. On
* success, we copy the data to the appropriate permanent static variable.
*
- * If write_wal is TRUE then an appropriate WAL message is emitted.
+ * If write_wal is true then an appropriate WAL message is emitted.
* (It will be false for bootstrap and WAL replay cases.)
*
- * If send_sinval is TRUE then a SI invalidation message is sent.
+ * If send_sinval is true then a SI invalidation message is sent.
* (This should be true except in bootstrap case.)
*
- * If preserve_files is TRUE then the storage manager is warned not to
+ * If preserve_files is true then the storage manager is warned not to
* delete the files listed in the map.
*
* Because this may be called during WAL replay when MyDatabaseId,
* the stack entry. Finally, errfinish() will be called to actually process
* the error report.
*
- * Returns TRUE in normal case. Returns FALSE to short-circuit the error
+ * Returns true in normal case. Returns false to short-circuit the error
* report (if it's a warning or lower and not to be reported anywhere).
*/
bool
/*
* Now decide whether we need to process this report at all; if it's
- * warning or less and not enabled for logging, just return FALSE without
+ * warning or less and not enabled for logging, just return false without
* starting up any error logging machinery.
*/
/*
* Given the result tuple descriptor for a function with OUT parameters,
* replace any polymorphic columns (ANYELEMENT etc) with correct data types
- * deduced from the input arguments. Returns TRUE if able to deduce all types,
- * FALSE if not.
+ * deduced from the input arguments. Returns true if able to deduce all types,
+ * false if not.
*/
static bool
resolve_polymorphic_tupdesc(TupleDesc tupdesc, oidvector *declared_args,
/*
* Given the declared argument types and modes for a function, replace any
* polymorphic types (ANYELEMENT etc) with correct data types deduced from the
- * input arguments. Returns TRUE if able to deduce all types, FALSE if not.
+ * input arguments. Returns true if able to deduce all types, false if not.
* This is the same logic as resolve_polymorphic_tupdesc, but with a different
* argument representation.
*
* HASH_ENTER_NULL cannot be used with the default palloc-based allocator,
* since palloc internally ereports on out-of-memory.
*
- * If foundPtr isn't NULL, then *foundPtr is set TRUE if we found an
- * existing entry in the table, FALSE otherwise. This is needed in the
+ * If foundPtr isn't NULL, then *foundPtr is set true if we found an
+ * existing entry in the table, false otherwise. This is needed in the
* HASH_ENTER case, but is redundant with the return value otherwise.
*
* For hash_search_with_hash_value, the hashvalue parameter must have been
* Therefore this cannot suffer an out-of-memory failure, even if there are
* other processes operating in other partitions of the hashtable.
*
- * Returns TRUE if successful, FALSE if the requested new hash key is already
+ * Returns true if successful, false if the requested new hash key is already
* present. Throws error if the specified entry pointer isn't actually a
* table member.
*
* NB: currently, there is no special case for old and new hash keys being
- * identical, which means we'll report FALSE for that situation. This is
+ * identical, which means we'll report false for that situation. This is
* preferable for existing uses.
*
* NB: for a partitioned hashtable, caller must hold lock on both relevant
/*
* Recheck that the data directory lock file still exists with expected
- * content. Return TRUE if the lock file appears OK, FALSE if it isn't.
+ * content. Return true if the lock file appears OK, false if it isn't.
*
* We call this periodically in the postmaster. The idea is that if the
* lock file has been removed or replaced by another postmaster, we should
- * do a panic database shutdown. Therefore, we should return TRUE if there
+ * do a panic database shutdown. Therefore, we should return true if there
* is any doubt: we do not want to cause a panic shutdown unnecessarily.
* Transient failures like EINTR or ENFILE should not cause us to fail.
* (If there really is something wrong, we'll detect it on a future recheck.)
static int size_guc_variables;
-static bool guc_dirty; /* TRUE if need to do commit/abort work */
+static bool guc_dirty; /* true if need to do commit/abort work */
-static bool reporting_enabled; /* TRUE to enable GUC_REPORT */
+static bool reporting_enabled; /* true to enable GUC_REPORT */
static int GUCNestLevel = 0; /* 1 when in main transaction */
/*
* Look up option NAME. If it exists, return a pointer to its record,
- * else return NULL. If create_placeholders is TRUE, we'll create a
+ * else return NULL. If create_placeholders is true, we'll create a
* placeholder record for a valid-looking custom variable name.
*/
static struct config_generic *
* Lookup the value for an enum option with the selected name
* (case-insensitive).
* If the enum option is found, sets the retval value and returns
- * true. If it's not found, return FALSE and retval is set to 0.
+ * true. If it's not found, return false and retval is set to 0.
*/
bool
config_enum_lookup_by_name(struct config_enum *record, const char *value,
if (pg_strcasecmp(value, entry->name) == 0)
{
*retval = entry->val;
- return TRUE;
+ return true;
}
}
*retval = 0;
- return FALSE;
+ return false;
}
/*
* show_config_by_name_missing_ok - equiv to SHOW X command but implemented as
* a function. If X does not exist, suppress the error and just return NULL
- * if missing_ok is TRUE.
+ * if missing_ok is true.
*/
Datum
show_config_by_name_missing_ok(PG_FUNCTION_ARGS)
* or NULL for the Delete/Reset cases. If skipIfNoPermissions is true, it's
* not an error to have no permissions to set the option.
*
- * Returns TRUE if OK, FALSE if skipIfNoPermissions is true and user does not
+ * Returns true if OK, false if skipIfNoPermissions is true and user does not
* have permission to change this option (all other error cases result in an
* error being thrown).
*/
* define_custom_variable assumes we checked that.
*
* name is not known and can't be created as a placeholder. Throw error,
- * unless skipIfNoPermissions is true, in which case return FALSE.
+ * unless skipIfNoPermissions is true, in which case return false.
*/
gconf = find_option(name, true, WARNING);
if (!gconf)
/*
* Apply additional validation checks to a tzEntry
*
- * Returns TRUE if OK, else false
+ * Returns true if OK, else false
*/
static bool
validateTzEntry(tzEntry *tzentry)
* name zone
* name offset dst
*
- * Returns TRUE if OK, else false; data is stored in *tzentry
+ * Returns true if OK, else false; data is stored in *tzentry
*/
static bool
splitTzLine(const char *filename, int lineno, char *line, tzEntry *tzentry)
* *arraysize: allocated length of array (changeable if must enlarge array)
* n: current number of valid elements in array
* entry: new data to insert
- * override: TRUE if OK to override
+ * override: true if OK to override
*
* Returns the new array length (new value for n), or -1 if error
*/
* simply removed. Portals remaining from prior transactions should be
* left untouched.
*
- * Returns TRUE if any portals changed state (possibly causing user-defined
- * code to be run), FALSE if not.
+ * Returns true if any portals changed state (possibly causing user-defined
+ * code to be run), false if not.
*/
bool
PreCommit_Portals(bool isPrepare)
/*
* Grow the memtuples[] array, if possible within our memory constraint. We
* must not exceed INT_MAX tuples in memory or the caller-provided memory
- * limit. Return TRUE if we were able to enlarge the array, FALSE if not.
+ * limit. Return true if we were able to enlarge the array, false if not.
*
* Normally, at each increment we double the size of the array. When doing
* that would exceed a limit, we attempt one last, smaller increase (and then
/*
* Internal routine to fetch the next tuple in either forward or back
- * direction into *stup. Returns FALSE if no more tuples.
+ * direction into *stup. Returns false if no more tuples.
* Returned tuple belongs to tuplesort memory context, and must not be freed
* by caller. Note that fetched tuple is stored in memory that may be
* recycled by any future fetch.
/*
* Fetch the next tuple in either forward or back direction.
- * If successful, put tuple in slot and return TRUE; else, clear the slot
- * and return FALSE.
+ * If successful, put tuple in slot and return true; else, clear the slot
+ * and return false.
*
- * Caller may optionally be passed back abbreviated value (on TRUE return
+ * Caller may optionally be passed back abbreviated value (on true return
* value) when abbreviation was used, which can be used to cheaply avoid
* equality checks that might otherwise be required. Caller can safely make a
* determination of "non-equal tuple" based on simple binary inequality. A
/*
* Fetch the next Datum in either forward or back direction.
- * Returns FALSE if no more datums.
+ * Returns false if no more datums.
*
* If the Datum is pass-by-ref type, the returned value is freshly palloc'd
* and is now owned by the caller (this differs from similar routines for
* other types of tuplesorts).
*
- * Caller may optionally be passed back abbreviated value (on TRUE return
+ * Caller may optionally be passed back abbreviated value (on true return
* value) when abbreviation was used, which can be used to cheaply avoid
* equality checks that might otherwise be required. Caller can safely make a
* determination of "non-equal tuple" based on simple binary inequality. A
/*
* Advance over N tuples in either forward or back direction,
* without returning any data. N==0 is a no-op.
- * Returns TRUE if successful, FALSE if ran out of tuples.
+ * Returns true if successful, false if ran out of tuples.
*/
bool
tuplesort_skiptuples(Tuplesortstate *state, int64 ntuples, bool forward)
/*
* Grow the memtuples[] array, if possible within our memory constraint. We
* must not exceed INT_MAX tuples in memory or the caller-provided memory
- * limit. Return TRUE if we were able to enlarge the array, FALSE if not.
+ * limit. Return true if we were able to enlarge the array, false if not.
*
* Normally, at each increment we double the size of the array. When doing
* that would exceed a limit, we attempt one last, smaller increase (and then
/*
* tuplestore_gettupleslot - exported function to fetch a MinimalTuple
*
- * If successful, put tuple in slot and return TRUE; else, clear the slot
- * and return FALSE.
+ * If successful, put tuple in slot and return true; else, clear the slot
+ * and return false.
*
- * If copy is TRUE, the slot receives a copied tuple (allocated in current
+ * If copy is true, the slot receives a copied tuple (allocated in current
* memory context) that will stay valid regardless of future manipulations of
- * the tuplestore's state. If copy is FALSE, the slot may just receive a
+ * the tuplestore's state. If copy is false, the slot may just receive a
* pointer to a tuple held within the tuplestore. The latter is more
* efficient but the slot contents may be corrupted if additional writes to
* the tuplestore occur. (If using tuplestore_trim, see comments therein.)
/*
* Advance over N tuples in either forward or back direction,
* without returning any data. N<=0 is a no-op.
- * Returns TRUE if successful, FALSE if ran out of tuples.
+ * Returns true if successful, false if ran out of tuples.
*/
bool
tuplestore_skiptuples(Tuplestorestate *state, int64 ntuples, bool forward)
* into its t_cid field.
*
* If we don't need a combo CID, *cmax is unchanged and *iscombo is set to
- * FALSE. If we do need one, *cmax is replaced by a combo CID and *iscombo
- * is set to TRUE.
+ * false. If we do need one, *cmax is replaced by a combo CID and *iscombo
+ * is set to true.
*
* The reason this is separate from the actual HeapTupleHeaderSetCmax()
* operation is that this could fail due to out-of-memory conditions. Hence
* should already be set. We assume that if no hint bits are set, the xmin
* or xmax transaction is still running. This is therefore faster than
* HeapTupleSatisfiesVacuum, because we don't consult PGXACT nor CLOG.
- * It's okay to return FALSE when in doubt, but we must return TRUE only
+ * It's okay to return false when in doubt, but we must return true only
* if the tuple is removable.
*/
bool
* prefix: string to prefix to each generated command; typically empty
* remoteVersion: version of database
*
- * Returns TRUE if okay, FALSE if could not parse the acl string.
+ * Returns true if okay, false if could not parse the acl string.
* The resulting commands (if any) are appended to the contents of 'sql'.
*
* Note: when processing a default ACL, prefix is "ALTER DEFAULT PRIVILEGES "
* owner: username of privileges owner (will be passed through fmtId)
* remoteVersion: version of database
*
- * Returns TRUE if okay, FALSE if could not parse the acl string.
+ * Returns true if okay, false if could not parse the acl string.
* The resulting commands (if any) are appended to the contents of 'sql'.
*/
bool
* In 8.4 and up we can rely on the conislocal field to decide which
* constraints must be dumped; much safer.
*
- * This function assumes all conislocal flags were initialized to TRUE.
+ * This function assumes all conislocal flags were initialized to true.
* It clears the flag on anything that seems to be inherited.
*/
static void
TableInfo *adtable; /* link to table of attribute */
int adnum;
char *adef_expr; /* decompiled DEFAULT expression */
- bool separate; /* TRUE if must dump as separate item */
+ bool separate; /* true if must dump as separate item */
} AttrDefInfo;
typedef struct _tableDataInfo
char ev_type;
bool is_instead;
char ev_enabled;
- bool separate; /* TRUE if must dump as separate item */
+ bool separate; /* true if must dump as separate item */
/* separate is always true for non-ON SELECT rules */
} RuleInfo;
char *condef; /* definition, if CHECK or FOREIGN KEY */
Oid confrelid; /* referenced table, if FOREIGN KEY */
DumpId conindex; /* identifies associated index if any */
- bool condeferrable; /* TRUE if constraint is DEFERRABLE */
- bool condeferred; /* TRUE if constraint is INITIALLY DEFERRED */
- bool conislocal; /* TRUE if constraint has local definition */
- bool separate; /* TRUE if must dump as separate item */
+ bool condeferrable; /* true if constraint is DEFERRABLE */
+ bool condeferred; /* true if constraint is INITIALLY DEFERRED */
+ bool conislocal; /* true if constraint has local definition */
+ bool separate; /* true if must dump as separate item */
} ConstraintInfo;
typedef struct _procLangInfo
* The input is the list of numObjs objects in objs[]. This list is not
* modified.
*
- * Returns TRUE if able to build an ordering that satisfies all the
- * constraints, FALSE if not (there are contradictory constraints).
+ * Returns true if able to build an ordering that satisfies all the
+ * constraints, false if not (there are contradictory constraints).
*
- * On success (TRUE result), ordering[] is filled with a sorted array of
+ * On success (true result), ordering[] is filled with a sorted array of
* DumpableObject pointers, of length equal to the input list length.
*
- * On failure (FALSE result), ordering[] is filled with an unsorted array of
+ * On failure (false result), ordering[] is filled with an unsorted array of
* DumpableObject pointers of length *nOrdering, listing the objects that
* prevented the sort from being completed. In general, these objects either
* participate directly in a dependency cycle, or are depended on by objects
typedef struct
{
FILE *internal; /* internal log FILE */
- bool verbose; /* TRUE -> be verbose in messages */
+ bool verbose; /* true -> be verbose in messages */
bool retain; /* retain log files on success */
} LogOpts;
*/
typedef struct
{
- bool check; /* TRUE -> ask user for permission to make
+ bool check; /* true -> ask user for permission to make
* changes */
transferMode transfer_mode; /* copy files or link them? */
int jobs;
/*
* Look up the object identified by obj_type and desc. If successful,
- * store its OID in *obj_oid and return TRUE, else return FALSE.
+ * store its OID in *obj_oid and return true, else return false.
*
* Note that we'll fail if the object doesn't exist OR if there are multiple
* matching candidates OR if there's something syntactically wrong with the
* Returns output file pointer into *fout, and is-a-pipe flag into *is_pipe.
* Caller is responsible for adjusting SIGPIPE state if it's a pipe.
*
- * On error, reports suitable error message and returns FALSE.
+ * On error, reports suitable error message and returns false.
*/
bool
openQueryOutputFile(const char *fname, FILE **fout, bool *is_pipe)
* database queries. In most places, this is accomplished by checking
* cancel_pressed during long-running loops. However, that won't work when
* blocked on user input (in readline() or fgets()). In those places, we
- * set sigint_interrupt_enabled TRUE while blocked, instructing the signal
+ * set sigint_interrupt_enabled true while blocked, instructing the signal
* catcher to longjmp through sigint_interrupt_jmp. We assume readline and
* fgets are coded to handle possible interruption. (XXX currently this does
* not work on win32, so control-C is less useful there)
* Prepare to do a large-object operation. We *must* be inside a transaction
* block for all these operations, so start one if needed.
*
- * Returns TRUE if okay, FALSE if failed. *own_transaction is set to indicate
+ * Returns true if okay, false if failed. *own_transaction is set to indicate
* if we started our own transaction or not.
*/
static bool
* delim - set of non-whitespace separator characters (or NULL)
* quote - set of characters that can quote a token (NULL if none)
* escape - character that can quote quotes (0 if none)
- * e_strings - if TRUE, treat E'...' syntax as a valid token
- * del_quotes - if TRUE, strip quotes from the returned token, else return
+ * e_strings - if true, treat E'...' syntax as a valid token
+ * del_quotes - if true, strip quotes from the returned token, else return
* it exactly as found in the string
* encoding - the active character-set encoding
*
* a single quote character in the data. If escape isn't 0, then escape
* followed by anything (except \0) is a data character too.
*
- * The combination of e_strings and del_quotes both TRUE is not currently
+ * The combination of e_strings and del_quotes both true is not currently
* handled. This could be fixed but it's not needed anywhere at the moment.
*
* Note that the string s is _not_ overwritten in this implementation.
* Output format is "md5" followed by a 32-hex-digit MD5 checksum.
* Hence, the output buffer "buf" must be at least 36 bytes long.
*
- * Returns TRUE if okay, FALSE on error (out of memory).
+ * Returns true if okay, false on error (out of memory).
*/
bool
pg_md5_encrypt(const char *passwd, const char *salt, size_t salt_len,
/*
* Match status data. curItem is the TID most recently tested (could be a
- * lossy-page pointer). curItemMatches is TRUE if it passes the
+ * lossy-page pointer). curItemMatches is true if it passes the
* consistentFn test; if so, recheckCurItem is the recheck flag.
* isFinished means that all the input entry streams are finished, so this
* key cannot succeed for any later TIDs.
typedef struct xl_hash_move_page_contents
{
uint16 ntups;
- bool is_prim_bucket_same_wrt; /* TRUE if the page to which
+ 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;
BlockNumber prevblkno;
BlockNumber nextblkno;
uint16 ntups;
- bool is_prim_bucket_same_wrt; /* TRUE if the page to which
+ 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
+ bool is_prev_bucket_same_wrt; /* true if the page to which
* tuples are moved is the page
* previous to the freed overflow
* page */
*/
typedef struct xl_hash_delete
{
- bool clear_dead_marking; /* TRUE if this operation clears
+ 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
+ bool is_primary_bucket_page; /* true if the operation is for
* primary bucket page */
} xl_hash_delete;
/*
* Page status codes. Note that these do not include the "dirty" bit.
- * page_dirty can be TRUE only in the VALID or WRITE_IN_PROGRESS states;
+ * page_dirty can be true only in the VALID or WRITE_IN_PROGRESS states;
* in the latter case it implies that the page has been re-dirtied since
* the write started.
*/
/*
* Like InRecovery, standbyState is only valid in the startup process.
* In all other processes it will have the value STANDBY_DISABLED (so
- * InHotStandby will read as FALSE).
+ * InHotStandby will read as false).
*
* In DISABLED state, we're performing crash recovery or hot standby was
* disabled in postgresql.conf.
#define NameStr(name) ((name).data)
/*
- * Support macros for escaping strings. escape_backslash should be TRUE
+ * Support macros for escaping strings. escape_backslash should be true
* if generating a non-standard-conforming string. Prefixing a string
* with ESCAPE_STRING_SYNTAX guarantees it is non-standard-conforming.
* Beware of multiple evaluation of the "ch" argument!
* conforencoding FOR encoding id
* contoencoding TO encoding id
* conproc OID of the conversion proc
- * condefault TRUE if this is a default conversion
+ * condefault true if this is a default conversion
* ----------------------------------------------------------------
*/
#define ConversionRelationId 2607
/*
* typbyval determines whether internal Postgres routines pass a value of
- * this type by value or by reference. typbyval had better be FALSE if
+ * this type by value or by reference. typbyval had better be false if
* the length is not 1, 2, or 4 (or 8 on 8-byte-Datum machines).
* Variable-length types are always passed by reference. Note that
* typbyval can be false even if the length would allow pass-by-value;
* so they live until the end of the ANALYZE operation.
*
* The type-specific typanalyze function is passed a pointer to this struct
- * and must return TRUE to continue analysis, FALSE to skip analysis of this
- * column. In the TRUE case it must set the compute_stats and minrows fields,
+ * and must return true to continue analysis, false to skip analysis of this
+ * column. In the true case it must set the compute_stats and minrows fields,
* and can optionally set extra_data to pass additional info to compute_stats.
* minrows is its request for the minimum number of sample rows to be gathered
* (but note this request might not be honored, eg if there are fewer rows
* The fetchfunc may be called with rownum running from 0 to samplerows-1.
* It returns a Datum and an isNull flag.
*
- * compute_stats should set stats_valid TRUE if it is able to compute
+ * compute_stats should set stats_valid true if it is able to compute
* any useful statistics. If it does, the remainder of the struct holds
* the information to be stored in a pg_statistic row for the column. Be
* careful to allocate any pointed-to data in anl_context, which will NOT
/*
* These fields must be filled in by the typanalyze routine, unless it
- * returns FALSE.
+ * returns false.
*/
AnalyzeAttrComputeStatsFunc compute_stats; /* function pointer */
int minrows; /* Minimum # of rows wanted for stats */
typedef struct Instrumentation
{
/* Parameters set at node creation: */
- bool need_timer; /* TRUE if we need timer data */
- bool need_bufusage; /* TRUE if we need buffer usage data */
+ bool need_timer; /* true if we need timer data */
+ bool need_bufusage; /* true if we need buffer usage data */
/* Info about current plan cycle: */
- bool running; /* TRUE if we've completed first tuple */
+ bool running; /* true if we've completed first tuple */
instr_time starttime; /* Start time of current iteration of node */
instr_time counter; /* Accumulated runtime for this node */
double firsttuple; /* Time for first tuple of this cycle */
* A TupleTableSlot can also be "empty", holding no valid data. This is
* the only valid state for a freshly-created slot that has not yet had a
* tuple descriptor assigned to it. In this state, tts_isempty must be
- * TRUE, tts_shouldFree FALSE, tts_tuple NULL, tts_buffer InvalidBuffer,
+ * true, tts_shouldFree false, tts_tuple NULL, tts_buffer InvalidBuffer,
* and tts_nvalid zero.
*
* The tupleDescriptor is simply referenced, not copied, by the TupleTableSlot
ProjectionInfo *projRight; /* for projecting subselect output */
TupleHashTable hashtable; /* hash table for no-nulls subselect rows */
TupleHashTable hashnulls; /* hash table for rows with null(s) */
- bool havehashrows; /* TRUE if hashtable is not empty */
- bool havenullrows; /* TRUE if hashnulls is not empty */
+ bool havehashrows; /* true if hashtable is not empty */
+ bool havenullrows; /* true if hashnulls is not empty */
MemoryContext hashtablecxt; /* memory context containing hash tables */
MemoryContext hashtempcxt; /* temp memory context for hash tables */
ExprContext *innerecontext; /* econtext for computing inner tuples */
* Similarly, if "typmods" is NIL then the actual typmod is expected to
* be prespecified in typemod, otherwise typemod is unused.
*
- * If pct_type is TRUE, then names is actually a field name and we look up
+ * If pct_type is true, then names is actually a field name and we look up
* the type of that field. Otherwise (the normal case), names is a type
* name possibly qualified with schema and database name.
*/
* them from the joinaliasvars list, because that would affect the attnums
* of Vars referencing the rest of the list.)
*
- * inh is TRUE for relation references that should be expanded to include
- * inheritance children, if the rel has any. This *must* be FALSE for
+ * inh is true for relation references that should be expanded to include
+ * inheritance children, if the rel has any. This *must* be false for
* RTEs other than RTE_RELATION entries.
*
* inFromCl marks those range variables that are listed in the FROM clause.
* or InvalidOid if not available.
* nulls_first means about what you'd expect. If sortop is InvalidOid
* then nulls_first is meaningless and should be set to false.
- * hashable is TRUE if eqop is hashable (note this condition also depends
+ * hashable is true if eqop is hashable (note this condition also depends
* on the datatype of the input expression).
*
* In an ORDER BY item, all fields must be valid. (The eqop isn't essential
FetchDirection direction; /* see above */
long howMany; /* number of rows, or position argument */
char *portalname; /* name of portal (cursor) */
- bool ismove; /* TRUE if MOVE */
+ bool ismove; /* true if MOVE */
} FetchStmt;
/* ----------------------
List *aggorder; /* ORDER BY (list of SortGroupClause) */
List *aggdistinct; /* DISTINCT (list of SortGroupClause) */
Expr *aggfilter; /* FILTER expression, if any */
- bool aggstar; /* TRUE if argument list was really '*' */
+ bool aggstar; /* true if argument list was really '*' */
bool aggvariadic; /* true if variadic arguments have been
* combined into an array last argument */
char aggkind; /* aggregate kind (see pg_aggregate.h) */
List *args; /* arguments to the window function */
Expr *aggfilter; /* FILTER expression, if any */
Index winref; /* index of associated WindowClause */
- bool winstar; /* TRUE if argument list was really '*' */
+ bool winstar; /* true if argument list was really '*' */
bool winagg; /* is function a simple aggregate? */
int location; /* token location, or -1 if unknown */
} WindowFunc;
Oid firstColCollation; /* Collation of first column of subplan
* result */
/* Information about execution strategy: */
- bool useHashTable; /* TRUE to store subselect output in a hash
+ bool useHashTable; /* true to store subselect output in a hash
* table (implies we are doing "IN") */
- bool unknownEqFalse; /* TRUE if it's okay to return FALSE when the
+ bool unknownEqFalse; /* true if it's okay to return FALSE when the
* spec result is UNKNOWN; this allows much
* simpler handling of null values */
bool parallel_safe; /* is the subplan parallel-safe? */