*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.73 2000/07/14 15:43:32 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.74 2000/08/06 17:50:38 thomas Exp $
*
*-------------------------------------------------------------------------
*/
dquote \"
xdstart {dquote}
xdstop {dquote}
+xddouble {dquote}{dquote}
xdinside [^"]+
/* C-style comments
yylval.str = pstrdup(literalbuf);
return IDENT;
}
+{xddouble} {
+ addlit(yytext, yyleng-1);
+ }
{xdinside} {
addlit(yytext, yyleng);
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.44 2000/07/04 14:25:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.45 2000/08/06 17:50:48 thomas Exp $
*
*
if (!force_quotes)
{
+ /* do a quick check on the first character... */
if (!islower((int) *rawid))
force_quotes = true;
+ /* otherwise check the entire string */
else
for (cp = rawid; *cp; cp++)
{
appendPQExpBufferChar(id_return, '\"');
for (cp = rawid; *cp; cp++)
{
+ /* Did we find a double-quote in the string?
+ * Then make this a double double-quote per SQL99.
+ * Before, we put in a backslash/double-quote pair.
+ * - thomas 2000-08-05 */
if (*cp == '\"')
- appendPQExpBufferChar(id_return, '\\');
+ {
+ appendPQExpBufferChar(id_return, '\"');
+ appendPQExpBufferChar(id_return, '\"');
+ }
appendPQExpBufferChar(id_return, *cp);
}
appendPQExpBufferChar(id_return, '\"');