Make USING in COPY optional.
authorBruce Momjian
Fri, 29 Oct 1999 23:52:22 +0000 (23:52 +0000)
committerBruce Momjian
Fri, 29 Oct 1999 23:52:22 +0000 (23:52 +0000)
doc/src/sgml/ref/copy.sgml
src/backend/parser/gram.y
src/bin/psql/psqlHelp.h

index cc67e878c2a401061a2c75916317395f5b2ba514..3653ae9ef60123835bc88622b33f785897d845a8 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -25,10 +25,10 @@ Postgres documentation
   
 COPY [ BINARY ] table [ WITH OIDS ]
     FROM { 'filename' | stdin }
-    [ USING DELIMITERS 'delimiter' ]
+    [ [USING] DELIMITERS 'delimiter' ]
 COPY [ BINARY ] table [ WITH OIDS ]
     TO { 'filename' | stdout }
-    [ USING DELIMITERS 'delimiter' ]
+    [ [USING] DELIMITERS 'delimiter' ]
   
   
   
index 7ea6f6179651737bb973d565dc0426bdbaa54f6c..ba16de5e443aad629160c5e712396f30c27cfcbc 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.112 1999/10/29 23:44:42 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.113 1999/10/29 23:52:20 momjian Exp $
  *
  * HISTORY
  *   AUTHOR            DATE            MAJOR EVENT
@@ -191,8 +191,8 @@ Oid param_type(int t); /* used in parse_expr.c */
 %type    substr_list, substr_from, substr_for, trim_list
 %type    opt_interval
 
-%type  opt_inh_star, opt_binary, opt_instead, opt_with_copy,
-               index_opt_unique, opt_verbose, opt_analyze
+%type  opt_inh_star, opt_binary, opt_using, opt_instead,
+               opt_with_copy, index_opt_unique, opt_verbose, opt_analyze
 %type  opt_cursor
 
 %type    copy_dirn, def_type, opt_direction, remove_type,
@@ -802,10 +802,14 @@ opt_with_copy:    WITH OIDS                       { $$ = TRUE; }
 /*
  * the default copy delimiter is tab but the user can configure it
  */
-copy_delimiter:  USING DELIMITERS Sconst       { $$ = $3; }
+copy_delimiter:  opt_using DELIMITERS Sconst   { $$ = $3; }
        | /*EMPTY*/                             { $$ = "\t"; }
        ;
 
+opt_using: USING                               { $$ = TRUE; }
+       | /*EMPTY*/                             { $$ = TRUE; }
+       ;
+
 
 /*****************************************************************************
  *
index 57bba44567398f6ed5d0db91ad183ab4074fa29e..0d4bc1c6873573a23e691c41afcd71ec95587959 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: psqlHelp.h,v 1.79 1999/10/27 16:33:45 momjian Exp $
+ * $Id: psqlHelp.h,v 1.80 1999/10/29 23:52:22 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -69,7 +69,7 @@ static struct _helpStruct QL_HELP[] = {
        "copy data to and from a table",
    "\
 \tCOPY [BINARY] table_name [WITH OIDS]\n\
-\tTO|FROM filename|STDIN|STDOUT [USING DELIMITERS 'delim'];"},
+\tTO|FROM filename|STDIN|STDOUT [ [USING] DELIMITERS 'delim'];"},
    {"create",
        "Please be more specific:",
    "\