Commit 60f3e6b3 authored by Bruce Momjian's avatar Bruce Momjian

Make USING in COPY optional.

parent ba1714b6
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.9 1999/07/22 15:09:07 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.10 1999/10/29 23:52:20 momjian Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -25,10 +25,10 @@ Postgres documentation ...@@ -25,10 +25,10 @@ Postgres documentation
<synopsis> <synopsis>
COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ] COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ]
FROM { '<replaceable class="parameter">filename</replaceable>' | <filename>stdin</filename> } FROM { '<replaceable class="parameter">filename</replaceable>' | <filename>stdin</filename> }
[ USING DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ] [ [USING] DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ] COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ]
TO { '<replaceable class="parameter">filename</replaceable>' | <filename>stdout</filename> } TO { '<replaceable class="parameter">filename</replaceable>' | <filename>stdout</filename> }
[ USING DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ] [ [USING] DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
</synopsis> </synopsis>
<refsect2 id="R2-SQL-COPY-1"> <refsect2 id="R2-SQL-COPY-1">
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * 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 * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -191,8 +191,8 @@ Oid param_type(int t); /* used in parse_expr.c */ ...@@ -191,8 +191,8 @@ Oid param_type(int t); /* used in parse_expr.c */
%type <list> substr_list, substr_from, substr_for, trim_list %type <list> substr_list, substr_from, substr_for, trim_list
%type <list> opt_interval %type <list> opt_interval
%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy, %type <boolean> opt_inh_star, opt_binary, opt_using, opt_instead,
index_opt_unique, opt_verbose, opt_analyze opt_with_copy, index_opt_unique, opt_verbose, opt_analyze
%type <boolean> opt_cursor %type <boolean> opt_cursor
%type <ival> copy_dirn, def_type, opt_direction, remove_type, %type <ival> copy_dirn, def_type, opt_direction, remove_type,
...@@ -802,10 +802,14 @@ opt_with_copy: WITH OIDS { $$ = TRUE; } ...@@ -802,10 +802,14 @@ opt_with_copy: WITH OIDS { $$ = TRUE; }
/* /*
* the default copy delimiter is tab but the user can configure it * 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"; } | /*EMPTY*/ { $$ = "\t"; }
; ;
opt_using: USING { $$ = TRUE; }
| /*EMPTY*/ { $$ = TRUE; }
;
/***************************************************************************** /*****************************************************************************
* *
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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[] = { ...@@ -69,7 +69,7 @@ static struct _helpStruct QL_HELP[] = {
"copy data to and from a table", "copy data to and from a table",
"\ "\
\tCOPY [BINARY] table_name [WITH OIDS]\n\ \tCOPY [BINARY] table_name [WITH OIDS]\n\
\tTO|FROM filename|STDIN|STDOUT [USING DELIMITERS 'delim'];"}, \tTO|FROM filename|STDIN|STDOUT [ [USING] DELIMITERS 'delim'];"},
{"create", {"create",
"Please be more specific:", "Please be more specific:",
"\ "\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment