mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Add quotes to vacuum/analyze for upper/lowercase table names, per
Matthew T. O'Connor.
This commit is contained in:
parent
573f4500a3
commit
a72fce035d
@ -581,7 +581,7 @@ xid_wraparound_check(db_info * dbi)
|
|||||||
{
|
{
|
||||||
PGresult *res = NULL;
|
PGresult *res = NULL;
|
||||||
|
|
||||||
res = send_query("vacuum", dbi);
|
res = send_query("VACUUM", dbi);
|
||||||
/* FIXME: Perhaps should add a check for PQ_COMMAND_OK */
|
/* FIXME: Perhaps should add a check for PQ_COMMAND_OK */
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
return 1;
|
return 1;
|
||||||
@ -733,7 +733,7 @@ check_stats_enabled(db_info * dbi)
|
|||||||
PGresult *res = NULL;
|
PGresult *res = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
res = send_query("show stats_row_level", dbi);
|
res = send_query("SHOW stats_row_level", dbi);
|
||||||
ret =
|
ret =
|
||||||
strcmp("on", PQgetvalue(res, 0, PQfnumber(res, "stats_row_level")));
|
strcmp("on", PQgetvalue(res, 0, PQfnumber(res, "stats_row_level")));
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
@ -1082,7 +1082,7 @@ main(int argc, char *argv[])
|
|||||||
*/
|
*/
|
||||||
if ((tbl->curr_vacuum_count - tbl->CountAtLastVacuum) >= tbl->vacuum_threshold)
|
if ((tbl->curr_vacuum_count - tbl->CountAtLastVacuum) >= tbl->vacuum_threshold)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "vacuum analyze %s", tbl->table_name);
|
snprintf(buf, sizeof(buf), "VACUUM ANALYZE \"%s\"", tbl->table_name);
|
||||||
if (args->debug >= 1)
|
if (args->debug >= 1)
|
||||||
{
|
{
|
||||||
sprintf(logbuffer, "Performing: %s", buf);
|
sprintf(logbuffer, "Performing: %s", buf);
|
||||||
@ -1096,7 +1096,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if ((tbl->curr_analyze_count - tbl->CountAtLastAnalyze) >= tbl->analyze_threshold)
|
else if ((tbl->curr_analyze_count - tbl->CountAtLastAnalyze) >= tbl->analyze_threshold)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "analyze %s", tbl->table_name);
|
snprintf(buf, sizeof(buf), "ANALYZE \"%s\"", tbl->table_name);
|
||||||
if (args->debug >= 1)
|
if (args->debug >= 1)
|
||||||
{
|
{
|
||||||
sprintf(logbuffer, "Performing: %s", buf);
|
sprintf(logbuffer, "Performing: %s", buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user