git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 43ea370)
Additional fixes for mixed-case table names from Billy Allie.
1998年11月24日 05:50:42 +0000 (05:50 +0000)
1998年11月24日 05:50:42 +0000 (05:50 +0000)
Same changes I tried to commit last time.
Hope the new version of cvs keeps it down...


diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index a5d6cfa00614b039830656880097b7389e166615..de9339d8eef750a8ef6d275520edd48087593a61 100644 (file)
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.163 1998年10月26日 01:04:37 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.163.2.1 1998年11月24日 05:50:42 thomas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -460,12 +460,17 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type,
perror("malloc");
/* load table table */
+ /* Put double quotes around the table name to allow for mixed-case
+ * and whitespaces in the table name. - BGA 1998年11月14日
+ */
for (i = 0; i < nColumns; i++)
{
- table[i] = (char *) malloc(PQgetlength(res, i, 1) * sizeof(char) + 1);
+ table[i] = (char *) malloc(PQgetlength(res, i, 1) * sizeof(char) + 3);
if (table[i] == NULL)
perror("malloc");
- strcpy(table[i], PQgetvalue(res, i, 1));
+ strcpy(table[i], "\"");
+ strcat(table[i], PQgetvalue(res, i, 1));
+ strcat(table[i], "\"");
}
PQclear(res);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /