|
3 | 3 | * |
4 | 4 | * Copyright (c) 2000-2007, PostgreSQL Global Development Group |
5 | 5 | * |
6 | | - * $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.72 2007/01/05 22:19:49 momjian Exp $ |
| 6 | + * $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.73 2007/02/05 15:22:18 adunstan Exp $ |
7 | 7 | */ |
8 | 8 | #include "postgres_fe.h" |
9 | 9 | #include "copy.h" |
@@ -268,7 +268,7 @@ parse_slash_copy(const char *args) |
268 | 268 | 0, false, false, pset.encoding); |
269 | 269 |
|
270 | 270 | /* |
271 | | - * Allows old COPY syntax for backward compatibility 2002-06-19 |
| 271 | + * Allows old COPY syntax for backward compatibility. |
272 | 272 | */ |
273 | 273 | if (token && pg_strcasecmp(token, "using") == 0) |
274 | 274 | { |
@@ -480,32 +480,28 @@ do_copy(const char *args) |
480 | 480 |
|
481 | 481 | printfPQExpBuffer(&query, "COPY "); |
482 | 482 |
|
483 | | - /* Uses old COPY syntax for backward compatibility 2002-06-19 */ |
484 | | - if (options->binary) |
485 | | - appendPQExpBuffer(&query, "BINARY "); |
486 | | - |
487 | 483 | appendPQExpBuffer(&query, "%s ", options->table); |
488 | 484 |
|
489 | 485 | if (options->column_list) |
490 | 486 | appendPQExpBuffer(&query, "%s ", options->column_list); |
491 | 487 |
|
492 | | - /* Uses old COPY syntax for backward compatibility 2002-06-19 */ |
493 | | - if (options->oids) |
494 | | - appendPQExpBuffer(&query, "WITH OIDS "); |
495 | | - |
496 | 488 | if (options->from) |
497 | 489 | appendPQExpBuffer(&query, "FROM STDIN"); |
498 | 490 | else |
499 | 491 | appendPQExpBuffer(&query, "TO STDOUT"); |
500 | 492 |
|
501 | 493 |
|
502 | | - /* Uses old COPY syntax for backward compatibility 2002-06-19 */ |
| 494 | + if (options->binary) |
| 495 | + appendPQExpBuffer(&query, " BINARY "); |
| 496 | + |
| 497 | + if (options->oids) |
| 498 | + appendPQExpBuffer(&query, " OIDS "); |
| 499 | + |
503 | 500 | if (options->delim) |
504 | | - emit_copy_option(&query, " USING DELIMITERS ", options->delim); |
| 501 | + emit_copy_option(&query, " DELIMITER ", options->delim); |
505 | 502 |
|
506 | | - /* There is no backward-compatible CSV syntax */ |
507 | 503 | if (options->null) |
508 | | - emit_copy_option(&query, " WITH NULL AS ", options->null); |
| 504 | + emit_copy_option(&query, " NULL AS ", options->null); |
509 | 505 |
|
510 | 506 | if (options->csv_mode) |
511 | 507 | appendPQExpBuffer(&query, " CSV"); |
|
0 commit comments