]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Additional fix for creating tables with constraints
authorThomas G. Lockhart <lockhart@fourpalms.org>
Tue, 17 Nov 1998 14:42:52 +0000 (14:42 +0000)
committerThomas G. Lockhart <lockhart@fourpalms.org>
Tue, 17 Nov 1998 14:42:52 +0000 (14:42 +0000)
 when table name is mixed-case from Billy Allie.

src/backend/catalog/heap.c

index e3e7bade9fc7473d326a620d62c42dbe241ae8ba..9cfc267d9affeb9e27cc4f047aefc87249a17d17 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.64.2.1 1998/11/12 15:34:30 thomas Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.64.2.2 1998/11/17 14:42:52 thomas Exp $
  *
  * INTERFACE ROUTINES
  *             heap_create()                   - Create an uncataloged heap relation
@@ -1444,7 +1444,10 @@ StoreAttrDefault(Relation rel, AttrDefault *attrdef)
        extern GlobalMemory CacheCxt;
 
 start:;
-       sprintf(str, "select %s%s from %.*s", attrdef->adsrc, cast,
+       /* Surround table name with double quotes to allow mixed-case and
+        * whitespaces in names. - BGA 1998-11-14
+        */
+       sprintf(str, "select %s%s from \"%.*s\"", attrdef->adsrc, cast,
                        NAMEDATALEN, rel->rd_rel->relname.data);
        setheapoverride(true);
        planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE);