]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Backpatch into 6.5.*.
authorBruce Momjian <bruce@momjian.us>
Thu, 23 Sep 1999 19:13:55 +0000 (19:13 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 23 Sep 1999 19:13:55 +0000 (19:13 +0000)
One last missing quoting bug in pg_dump:
now that sequence names are properly quoted for field defaults, mixed
case sequence names are generated. These are properly quoted in the
CREATE SEQUENCE lines, but not in the SELECT nextval lines, as per
below:

CREATE SEQUENCE "Teams_TeamID_seq" start 10 increment 1 maxvalue
2147483647 minvalue 1  cache 1 ;
SELECT nextval ('Teams_TeamID_seq');

This needs to be:
SELECT nextval ('"Teams_TeamID_seq"');

Patch included below.
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>

src/bin/pg_dump/pg_dump.c
src/pl/plpgsql/src/pl_comp.c

index b11459dca367967c3f217619f8a6180666552122..269edb89814630d37c6756a23ad4d8783557e5a0 100644 (file)
@@ -21,7 +21,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.115.2.1 1999/09/01 23:06:26 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.115.2.2 1999/09/23 19:13:49 momjian Exp $
  *
  * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
  *
@@ -3193,7 +3193,7 @@ dumpSequence(FILE *fout, TableInfo tbinfo)
        if (called == 'f')
                return;                                 /* nothing to do more */
 
-       sprintf(query, "SELECT nextval ('%s');\n", tbinfo.relname);
+       sprintf(query, "SELECT nextval ('%s');\n", fmtId(tbinfo.relname, force_quotes));
        fputs(query, fout);
 
 }
index 772e631cbfc3cdff74d328b2240d3a2b939be89a..c2da4a4ca1caac3ac7ba9630368c51e31aa02da7 100644 (file)
@@ -3,7 +3,7 @@
  *                       procedural language
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.7.2.1 1999/09/20 21:47:21 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.7.2.2 1999/09/23 19:13:55 momjian Exp $
  *
  *       This software is copyrighted by Jan Wieck - Hamburg.
  *
  * ----------
  */
 PLPGSQL_YYSTYPE plpgsql_yylval;
-int    plpgsql_yylineno;
-char plpgsql_yytext[];
+int            plpgsql_yylineno;
+char   plpgsql_yytext[];
 
-void           plpgsql_yyerror(const char *s);
+void   plpgsql_yyerror(const char *s);
 
 /* ----------
  * Our own local and global variables
  * ----------
  */
 static int     datums_alloc;
-int                    plpgsql_nDatums;
+int            plpgsql_nDatums;
 PLpgSQL_datum **plpgsql_Datums;
 static int     datums_last = 0;
 
-int                    plpgsql_error_lineno;
-char      *plpgsql_error_funcname;
-int                    plpgsql_DumpExecTree = 0;
+int            plpgsql_error_lineno;
+char   *plpgsql_error_funcname;
+int            plpgsql_DumpExecTree = 0;
 
 PLpgSQL_function *plpgsql_curr_compile;