Remove double-quoting of table names in clusterdb. BACKWARD COMPABILITY

BREAKAGE.

Remove double-quoting of index/table names in reindexdb.  BACKWARD
COMPABILITY BREAKAGE.

Document thate user/database names are preserved with double-quoting by
command-line tools like vacuumdb.
This commit is contained in:
Bruce Momjian 2011-09-10 16:39:02 -04:00
parent 52ce20589a
commit d68ccf536e
8 changed files with 21 additions and 6 deletions

View File

@ -90,7 +90,8 @@ PostgreSQL documentation
<term><option>--tablespace=<replaceable class="parameter">tablespace</replaceable></></term> <term><option>--tablespace=<replaceable class="parameter">tablespace</replaceable></></term>
<listitem> <listitem>
<para> <para>
Specifies the default tablespace for the database. Specifies the default tablespace for the database. (This name
is processed as a double-quoted identifier.)
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -154,6 +155,7 @@ PostgreSQL documentation
<listitem> <listitem>
<para> <para>
Specifies the database user who will own the new database. Specifies the database user who will own the new database.
(This name is processed as a double-quoted identifier.)
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -163,7 +165,8 @@ PostgreSQL documentation
<term><option>--template=<replaceable class="parameter">template</replaceable></></term> <term><option>--template=<replaceable class="parameter">template</replaceable></></term>
<listitem> <listitem>
<para> <para>
Specifies the template database from which to build this database. Specifies the template database from which to build this
database. (This name is processed as a double-quoted identifier.)
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -70,7 +70,8 @@ PostgreSQL documentation
<term><replaceable class="parameter">langname</replaceable></term> <term><replaceable class="parameter">langname</replaceable></term>
<listitem> <listitem>
<para> <para>
Specifies the name of the procedural language to be installed. Specifies the name of the procedural language to be
installed. (This name is lower-cased.)
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -73,6 +73,7 @@ PostgreSQL documentation
<listitem> <listitem>
<para> <para>
Specifies the name of the procedural language to be removed. Specifies the name of the procedural language to be removed.
(This name is lower-cased.)
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -198,6 +198,14 @@
applications is that they can be run on any host, independent of applications is that they can be run on any host, independent of
where the database server resides. where the database server resides.
</para> </para>
<para>
When specified on the command line, user and databases names have
their case preserved &mdash; the presence of spaces or special
characters might require quoting. Table names and other identifiers
do not have their case preserved, except where documented, and
might require quoting.
</para>
</partintro> </partintro>
&clusterdb; &clusterdb;

View File

@ -177,7 +177,7 @@ cluster_one_database(const char *dbname, bool verbose, const char *table,
if (verbose) if (verbose)
appendPQExpBuffer(&sql, " VERBOSE"); appendPQExpBuffer(&sql, " VERBOSE");
if (table) if (table)
appendPQExpBuffer(&sql, " %s", fmtId(table)); appendPQExpBuffer(&sql, " %s", table);
appendPQExpBuffer(&sql, ";\n"); appendPQExpBuffer(&sql, ";\n");
conn = connectDatabase(dbname, host, port, username, prompt_password, progname); conn = connectDatabase(dbname, host, port, username, prompt_password, progname);

View File

@ -164,6 +164,7 @@ main(int argc, char *argv[])
exit(1); exit(1);
} }
/* lower case language name */
for (p = langname; *p; p++) for (p = langname; *p; p++)
if (*p >= 'A' && *p <= 'Z') if (*p >= 'A' && *p <= 'Z')
*p += ('a' - 'A'); *p += ('a' - 'A');

View File

@ -165,6 +165,7 @@ main(int argc, char *argv[])
exit(1); exit(1);
} }
/* lower case language name */
for (p = langname; *p; p++) for (p = langname; *p; p++)
if (*p >= 'A' && *p <= 'Z') if (*p >= 'A' && *p <= 'Z')
*p += ('a' - 'A'); *p += ('a' - 'A');

View File

@ -223,9 +223,9 @@ reindex_one_database(const char *name, const char *dbname, const char *type,
appendPQExpBuffer(&sql, "REINDEX"); appendPQExpBuffer(&sql, "REINDEX");
if (strcmp(type, "TABLE") == 0) if (strcmp(type, "TABLE") == 0)
appendPQExpBuffer(&sql, " TABLE %s", fmtId(name)); appendPQExpBuffer(&sql, " TABLE %s", name);
else if (strcmp(type, "INDEX") == 0) else if (strcmp(type, "INDEX") == 0)
appendPQExpBuffer(&sql, " INDEX %s", fmtId(name)); appendPQExpBuffer(&sql, " INDEX %s", name);
else if (strcmp(type, "DATABASE") == 0) else if (strcmp(type, "DATABASE") == 0)
appendPQExpBuffer(&sql, " DATABASE %s", fmtId(name)); appendPQExpBuffer(&sql, " DATABASE %s", fmtId(name));
appendPQExpBuffer(&sql, ";\n"); appendPQExpBuffer(&sql, ";\n");