Skip to content

Commit 60f3e6b

Browse files
committed
Make USING in COPY optional.
1 parent ba1714b commit 60f3e6b

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

doc/src/sgml/ref/copy.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.9 1999/07/22 15:09:07 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.10 1999/10/29 23:52:20 momjian Exp $
33
Postgres documentation
44
-->
55

@@ -25,10 +25,10 @@ Postgres documentation
2525
<synopsis>
2626
COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ]
2727
FROM { '<replaceable class="parameter">filename</replaceable>' | <filename>stdin</filename> }
28-
[ USING DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
28+
[ [USING] DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
2929
COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ]
3030
TO { '<replaceable class="parameter">filename</replaceable>' | <filename>stdout</filename> }
31-
[ USING DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
31+
[ [USING] DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
3232
</synopsis>
3333

3434
<refsect2 id="R2-SQL-COPY-1">

src/backend/parser/gram.y

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.112 1999/10/29 23:44:42 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.113 1999/10/29 23:52:20 momjian Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -191,8 +191,8 @@ Oid param_type(int t); /* used in parse_expr.c */
191191
%type <list> substr_list, substr_from, substr_for, trim_list
192192
%type <list> opt_interval
193193

194-
%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy,
195-
index_opt_unique, opt_verbose, opt_analyze
194+
%type <boolean> opt_inh_star, opt_binary, opt_using, opt_instead,
195+
opt_with_copy, index_opt_unique, opt_verbose, opt_analyze
196196
%type <boolean> opt_cursor
197197

198198
%type <ival> copy_dirn, def_type, opt_direction, remove_type,
@@ -802,10 +802,14 @@ opt_with_copy: WITH OIDS { $$ = TRUE; }
802802
/*
803803
* the default copy delimiter is tab but the user can configure it
804804
*/
805-
copy_delimiter: USING DELIMITERS Sconst { $$ = $3; }
805+
copy_delimiter: opt_using DELIMITERS Sconst { $$ = $3; }
806806
| /*EMPTY*/ { $$ = "\t"; }
807807
;
808808

809+
opt_using: USING { $$ = TRUE; }
810+
| /*EMPTY*/ { $$ = TRUE; }
811+
;
812+
809813

810814
/*****************************************************************************
811815
*

src/bin/psql/psqlHelp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: psqlHelp.h,v 1.79 1999/10/27 16:33:45 momjian Exp $
8+
* $Id: psqlHelp.h,v 1.80 1999/10/29 23:52:22 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -69,7 +69,7 @@ static struct _helpStruct QL_HELP[] = {
6969
"copy data to and from a table",
7070
"\
7171
\tCOPY [BINARY] table_name [WITH OIDS]\n\
72-
\tTO|FROM filename|STDIN|STDOUT [USING DELIMITERS 'delim'];"},
72+
\tTO|FROM filename|STDIN|STDOUT [ [USING] DELIMITERS 'delim'];"},
7373
{"create",
7474
"Please be more specific:",
7575
"\

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