Update spelling of COPY options
authorPeter Eisentraut <[email protected]>
Thu, 5 Nov 2015 02:01:26 +0000 (21:01 -0500)
committerPeter Eisentraut <[email protected]>
Thu, 5 Nov 2015 02:01:26 +0000 (21:01 -0500)
The preferred spelling was changed from FORCE QUOTE to FORCE_QUOTE and
the like, but some code was still referring to the old spellings.

src/backend/commands/copy.c
src/test/regress/expected/copy2.out

index 9a52ec6c3f8c1f45eaccf13292c3dbb387563a53..443b9e7376fef2083547a7b97eb5d29ffa578e72 100644 (file)
@@ -121,7 +121,7 @@ typedef struct CopyStateData
    char       *quote;          /* CSV quote char (must be 1 byte) */
    char       *escape;         /* CSV escape char (must be 1 byte) */
    List       *force_quote;    /* list of column names */
-   bool        force_quote_all;    /* FORCE QUOTE *? */
+   bool        force_quote_all;    /* FORCE_QUOTE *? */
    bool       *force_quote_flags;      /* per-column CSV FQ flags */
    List       *force_notnull;  /* list of column names */
    bool       *force_notnull_flags;    /* per-column CSV FNN flags */
@@ -1469,7 +1469,7 @@ BeginCopy(bool is_from,
 
    num_phys_attrs = tupDesc->natts;
 
-   /* Convert FORCE QUOTE name list to per-column flags, check validity */
+   /* Convert FORCE_QUOTE name list to per-column flags, check validity */
    cstate->force_quote_flags = (bool *) palloc0(num_phys_attrs * sizeof(bool));
    if (cstate->force_quote_all)
    {
@@ -1492,13 +1492,13 @@ BeginCopy(bool is_from,
            if (!list_member_int(cstate->attnumlist, attnum))
                ereport(ERROR,
                        (errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
-                  errmsg("FORCE QUOTE column \"%s\" not referenced by COPY",
+                  errmsg("FORCE_QUOTE column \"%s\" not referenced by COPY",
                          NameStr(tupDesc->attrs[attnum - 1]->attname))));
            cstate->force_quote_flags[attnum - 1] = true;
        }
    }
 
-   /* Convert FORCE NOT NULL name list to per-column flags, check validity */
+   /* Convert FORCE_NOT_NULL name list to per-column flags, check validity */
    cstate->force_notnull_flags = (bool *) palloc0(num_phys_attrs * sizeof(bool));
    if (cstate->force_notnull)
    {
@@ -1514,13 +1514,13 @@ BeginCopy(bool is_from,
            if (!list_member_int(cstate->attnumlist, attnum))
                ereport(ERROR,
                        (errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
-               errmsg("FORCE NOT NULL column \"%s\" not referenced by COPY",
+               errmsg("FORCE_NOT_NULL column \"%s\" not referenced by COPY",
                       NameStr(tupDesc->attrs[attnum - 1]->attname))));
            cstate->force_notnull_flags[attnum - 1] = true;
        }
    }
 
-   /* Convert FORCE NULL name list to per-column flags, check validity */
+   /* Convert FORCE_NULL name list to per-column flags, check validity */
    cstate->force_null_flags = (bool *) palloc0(num_phys_attrs * sizeof(bool));
    if (cstate->force_null)
    {
@@ -1536,7 +1536,7 @@ BeginCopy(bool is_from,
            if (!list_member_int(cstate->attnumlist, attnum))
                ereport(ERROR,
                        (errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
-                   errmsg("FORCE NULL column \"%s\" not referenced by COPY",
+                   errmsg("FORCE_NULL column \"%s\" not referenced by COPY",
                           NameStr(tupDesc->attrs[attnum - 1]->attname))));
            cstate->force_null_flags[attnum - 1] = true;
        }
index 72ada21e63fc2aba34b47a4046dcca98126e7330..5f6260a8f1b1bf6b1655b1329d9a30bf27d185b0 100644 (file)
@@ -421,12 +421,12 @@ ROLLBACK;
 -- should fail with "not referenced by COPY" error
 BEGIN;
 COPY forcetest (d, e) FROM STDIN WITH (FORMAT csv, FORCE_NOT_NULL(b));
-ERROR:  FORCE NOT NULL column "b" not referenced by COPY
+ERROR:  FORCE_NOT_NULL column "b" not referenced by COPY
 ROLLBACK;
 -- should fail with "not referenced by COPY" error
 BEGIN;
 COPY forcetest (d, e) FROM STDIN WITH (FORMAT csv, FORCE_NULL(b));
-ERROR:  FORCE NULL column "b" not referenced by COPY
+ERROR:  FORCE_NULL column "b" not referenced by COPY
 ROLLBACK;
 \pset null ''
 -- test case with whole-row Var in a check constraint