1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

more psql bug squashing:

\copy without arguments failed
commands with too many arguments were too silent
This commit is contained in:
Peter Eisentraut
2000-04-16 15:46:40 +00:00
parent 82849df6c6
commit aae70b2dca
4 changed files with 36 additions and 28 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.14 2000/04/14 23:43:44 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.15 2000/04/16 15:46:40 petere Exp $
*/
#include "postgres.h"
#include "copy.h"
@ -34,7 +34,7 @@ bool copy_in_state;
* parse_slash_copy
* -- parses \copy command line
*
* Accepted syntax: \copy [binary] table|"table" [with oids] from|to filename|'filename' using delimiters ['<char>'] [ with null as 'string' ]
* Accepted syntax: \copy [binary] table|"table" [with oids] from|to filename|'filename' [ using delimiters '<char>'] [ with null as 'string' ]
* (binary is not here yet)
*
* returns a malloc'ed structure with the options, or NULL on parsing error
@ -74,7 +74,13 @@ parse_slash_copy(const char *args)
bool error = false;
char quote;
line = xstrdup(args);
if (args)
line = xstrdup(args);
else
{
psql_error("\\copy: arguments required\n");
return NULL;
}
if (!(result = calloc(1, sizeof(struct copy_options))))
{
@ -191,6 +197,8 @@ parse_slash_copy(const char *args)
}
}
}
else
error = true;
}
}
}