pg_dump quoting bug
Started by Ross J. Reedstromover 26 years ago1 messages
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>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005
Attachments:
pg_dump.difftext/plain; charset=us-asciiDownload
Index: src/bin/pg_dump/pg_dump.c
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.115
diff -c -r1.115 pg_dump.c
*** src/bin/pg_dump/pg_dump.c 1999/06/03 04:01:16 1.115
--- src/bin/pg_dump/pg_dump.c 1999/07/19 22:19:33
***************
*** 3193,3199 ****
if (called == 'f')
return; /* nothing to do more */
! sprintf(query, "SELECT nextval ('%s');\n", tbinfo.relname);
fputs(query, fout);
}
--- 3193,3199 ----
if (called == 'f')
return; /* nothing to do more */
! sprintf(query, "SELECT nextval ('%s');\n", fmtId(tbinfo.relname, force_quotes));
fputs(query, fout);
}