diff options
author | Thomas G. Lockhart <lockhart@fourpalms.org> | 1998-11-12 15:39:06 +0000 |
---|---|---|
committer | Thomas G. Lockhart <lockhart@fourpalms.org> | 1998-11-12 15:39:06 +0000 |
commit | 2795fae5bf9aad2880be0b8b89f3d695394208fe (patch) | |
tree | bc762a7156de0b12be0d6e4ef6a00cb1941eeef7 /src | |
parent | c7d9aca135b7af60f7e777df1ef99b19bd9e7348 (diff) | |
download | postgresql-2795fae5bf9aad2880be0b8b89f3d695394208fe.tar.gz postgresql-2795fae5bf9aad2880be0b8b89f3d695394208fe.zip |
Fix test for table existance to allow mixed-case and whitespace in
the table name. Problem reported by Billy Allie.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/heap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index bcac9479788..df329eeb35f 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.64 1998/09/01 04:27:29 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.65 1998/11/12 15:39:06 thomas Exp $ * * INTERFACE ROUTINES * heap_create() - Create an uncataloged heap relation @@ -1515,7 +1515,10 @@ StoreRelCheck(Relation rel, ConstrCheck *check) char nulls[4] = {' ', ' ', ' ', ' '}; extern GlobalMemory CacheCxt; - sprintf(str, "select 1 from %.*s where %s", + /* Check for table's existance. Surround table name with double-quotes + * to allow mixed-case and whitespace names. - thomas 1998-11-12 + */ + sprintf(str, "select 1 from \"%.*s\" where %s", NAMEDATALEN, rel->rd_rel->relname.data, check->ccsrc); setheapoverride(true); planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE); |