Skip to content

Commit fd9df11

Browse files
committed
Small stylistic improvement in recent FORCE QUOTE * code - use a bool instead of a magic value.
1 parent de7531a commit fd9df11

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/backend/commands/copy.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.313 2009/07/25 00:07:11 adunstan Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.314 2009/07/25 13:35:32 adunstan Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -729,9 +729,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
729729
TupleDesc tupDesc;
730730
int num_phys_attrs;
731731
uint64 processed;
732-
733-
/* a dummy list that represents 'all-columns' */
734-
List all_columns = { T_List };
732+
bool force_quote_all = false;
735733

736734
/* Allocate workspace and zero all fields */
737735
cstate = (CopyStateData *) palloc0(sizeof(CopyStateData));
@@ -813,7 +811,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
813811
errmsg("conflicting or redundant options")));
814812

815813
if (IsA(defel->arg, A_Star))
816-
force_quote = &all_columns;
814+
force_quote_all = true;
817815
else
818816
force_quote = (List *) defel->arg;
819817
}
@@ -1099,7 +1097,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
10991097

11001098
/* Convert FORCE QUOTE name list to per-column flags, check validity */
11011099
cstate->force_quote_flags = (bool *) palloc0(num_phys_attrs * sizeof(bool));
1102-
if (force_quote == &all_columns)
1100+
if (force_quote_all)
11031101
{
11041102
int i;
11051103

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy