dump for this table only\n"
{"clean", no_argument, NULL, 'c'},
{"inserts",no_argument, NULL, 'd'},
{"attribute-inserts", no_argument, NULL, 'D'},
- {"output", required_argument, NULL, '\037'}, /* see note below */
{"host", required_argument, NULL, 'h'},
{"no-quotes", no_argument, NULL, 'n'},
{"quotes", no_argument, NULL, 'N'},
- {"oids", no_argument, NULL, 'O'},
+ {"oids", no_argument, NULL, 'o'},
{"port", required_argument, NULL, 'p'},
{"schema-only", no_argument, NULL, 's'},
{"table", required_argument, NULL, 't'},
/*
* A note on options:
*
- * The standard option for specifying an output file is -o/--output.
- * The standard option for specifying an input file is -f/--file.
- * pg_dump used to use -f for specifying an output file.
- * Unfortunately, -o is already in use for oids.
- *
- * Therefore I instituted the following:
- * + The -f option is gone. Most people use > for output redirection anyway
- * so there is really not a big point in supporting output files.
- * + If you like, and can, you can use --output, but it's not documented.
- * + The preferred option for oids is now -O. -o generates a warning.
- * + In the (very far) future the -o option could be used to used for
- * specifying an output file.
- * -- petere 2000-01-17
+ * The -f option was yanked because in the rest of the world (and
+ * PostgreSQL) it specifies an *input* file. You can use the shell's
+ * output redirection to achieve the same.
*/
#ifdef HAVE_GETOPT_LONG
- while ((c = getopt_long(argc, argv, "acdDf:h:nNoOp:st:uvxzV?\037", long_options, &optindex)) != -1)
+ while ((c = getopt_long(argc, argv, "acdDf:h:nNop:st:uvxzV?", long_options, &optindex)) != -1)
#else
- while ((c = getopt(argc, argv, "acdDf:h:nNoOp:st:uvxzV?-")) != -1)
+ while ((c = getopt(argc, argv, "acdDf:h:nNop:st:uvxzV?-")) != -1)
#endif
{
switch (c)
fprintf(stderr, "%s: The -f option is obsolete. You can achieve the same by writing %s > %s.\n",
progname, progname, optarg);
exit(1);
- case '\037': /* output file name, see note above */
- filename = optarg;
- break;
case 'h': /* server host */
pghost = optarg;
break;
case 'N': /* Force double-quotes on identifiers */
force_quotes = true;
break;
- case 'o':
- fprintf(stderr, "%s: The -o option for dumping oids is deprecated. Please use -O.\n", progname);
- /* FALLTHRU */
- case 'O': /* Dump oids */
+ case 'o': /* Dump oids */
oids = true;
break;
case 'p': /* server port */
/*
* psql - the PostgreSQL interactive terminal
*
- * Copyright 2000 by PostgreSQL Global Development Team
+ * Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.15 2000/01/18 23:30:23 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.16 2000/01/24 19:34:17 petere Exp $
*/
#include
#include "mainloop.h"
bool success;
char in_quote; /* == 0 for no in_quote */
- bool was_bslash; /* backslash */
bool xcomment; /* in extended comment */
int paren_level;
unsigned int query_start;
int count_eof;
const char *var;
+ bool was_bslash;
+ unsigned int bslash_count;
int i,
prevlen,
{
/* was the previous character a backslash? */
was_bslash = (i > 0 && line[i - prevlen] == '\\');
+ if (was_bslash)
+ bslash_count++;
+ else
+ bslash_count = 0;
/* in quote? */
if (in_quote)
{
/* end of quote */
- if (line[i] == in_quote && !was_bslash)
+ if (line[i] == in_quote && bslash_count % 2 == 0)
in_quote = '\0';
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nabstime.h,v 1.20 1999/05/25 16:14:56 momjian Exp $
+ * $Id: nabstime.h,v 1.21 2000/01/24 19:34:19 petere Exp $
*
*-------------------------------------------------------------------------
*/
*
* ----------------------------------------------------------------
*/
-/* The original typedefs are bogus - they assume that the system's 'time_t'
- * type is of size 32-bits. Under AlphaLinux, time_t is a long int, which
- * is 64-bits. Therefore, typedef these both as simply 'time_t', and let
- * the OS define what the size really is. -- RME 3/5/99
+/*
+ * Although time_t generally is a long int on 64 bit systems, these two
+ * types must be 4 bytes, because that's what the system assumes. They
+ * should be yanked (long) before 2038 and be replaced by timestamp and
+ * interval.
*/
-typedef time_t AbsoluteTime;
-typedef time_t RelativeTime;
+typedef int32 AbsoluteTime;
+typedef int32 RelativeTime;
typedef struct
{