]> granicus.if.org Git - postgresql/commitdiff
In default nextval('foo') expression for a SERIAL column, use double
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 28 May 2002 22:15:42 +0000 (22:15 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 28 May 2002 22:15:42 +0000 (22:15 +0000)
quotes only when necessary.

src/backend/parser/analyze.c

index 72a0c8be513d2f6437c02d1f39bd8b5f7abd8f6c..916067a1d0484e6a1b79697726c9221a387e53dc 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- *     $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.234 2002/05/12 20:10:03 tgl Exp $
+ *     $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.235 2002/05/28 22:15:42 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -856,8 +856,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
                 * Create an expression tree representing the function call
                 * nextval('"sequencename"')
                 */
-               qstring = palloc(strlen(snamespace) + strlen(sname) + 5 + 1);
-               sprintf(qstring, "\"%s\".\"%s\"", snamespace, sname);
+               qstring = quote_qualified_identifier(snamespace, sname);
                snamenode = makeNode(A_Const);
                snamenode->val.type = T_String;
                snamenode->val.val.str = qstring;