1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-05 07:41:25 +03:00

Change TRUE/FALSE to true/false

The lower case spellings are C and C++ standard and are used in most
parts of the PostgreSQL sources.  The upper case spellings are only used
in some files/modules.  So standardize on the standard spellings.

The APIs for ICU, Perl, and Windows define their own TRUE and FALSE, so
those are left as is when using those APIs.

In code comments, we use the lower-case spelling for the C concepts and
keep the upper-case spelling for the SQL concepts.

Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
Peter Eisentraut
2017-08-16 00:22:32 -04:00
parent 4497f2f3b3
commit 2eb4a831e5
216 changed files with 1168 additions and 1168 deletions

View File

@@ -88,7 +88,7 @@ typedef enum EolType
* 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
@@ -726,7 +726,7 @@ CopyGetInt16(CopyState cstate, int16 *val)
/*
* 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.
@@ -763,7 +763,7 @@ CopyLoadRawBuf(CopyState cstate)
* 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.
*

View File

@@ -1718,8 +1718,8 @@ AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
/*
* 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,
@@ -1923,7 +1923,7 @@ remove_dbtablespaces(Oid db_id)
/*
* 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

View File

@@ -513,7 +513,7 @@ find_language_template(const char *languageName)
/*
* 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)

View File

@@ -2307,7 +2307,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
*
* 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
@@ -5778,7 +5778,7 @@ ATExecDropNotNull(Relation rel, const char *colName, LOCKMODE lockmode)
*/
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);
@@ -5859,7 +5859,7 @@ ATExecSetNotNull(AlteredTableInfo *tab, Relation rel,
*/
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);
@@ -8312,16 +8312,16 @@ validateForeignKeyConstraint(char *conname,
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))

View File

@@ -655,7 +655,7 @@ create_tablespace_directories(const char *location, const Oid tablespaceoid)
* 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)

View File

@@ -127,7 +127,7 @@ static bool before_stmt_triggers_fired(Oid relid, CmdType cmdType);
*
* 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
@@ -4124,10 +4124,10 @@ AfterTriggerExecute(AfterTriggerEvent event,
* 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,
@@ -4191,14 +4191,14 @@ 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

View File

@@ -3399,9 +3399,9 @@ AlterTypeOwner(List *names, Oid newOwnerId, ObjectType objecttype)
* 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.
@@ -3567,10 +3567,10 @@ AlterTypeNamespace_oid(Oid typeOid, Oid nspOid, ObjectAddresses *objsMoved)
* 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.
*