Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita72fce0

Browse files
committed
Add quotes to vacuum/analyze for upper/lowercase table names, per
Matthew T. O'Connor.
1 parent573f450 commita72fce0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎contrib/pg_autovacuum/pg_autovacuum.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ xid_wraparound_check(db_info * dbi)
581581
{
582582
PGresult*res=NULL;
583583

584-
res=send_query("vacuum",dbi);
584+
res=send_query("VACUUM",dbi);
585585
/* FIXME: Perhaps should add a check for PQ_COMMAND_OK */
586586
PQclear(res);
587587
return1;
@@ -733,7 +733,7 @@ check_stats_enabled(db_info * dbi)
733733
PGresult*res=NULL;
734734
intret=0;
735735

736-
res=send_query("show stats_row_level",dbi);
736+
res=send_query("SHOW stats_row_level",dbi);
737737
ret=
738738
strcmp("on",PQgetvalue(res,0,PQfnumber(res,"stats_row_level")));
739739
PQclear(res);
@@ -1082,7 +1082,7 @@ main(int argc, char *argv[])
10821082
*/
10831083
if ((tbl->curr_vacuum_count-tbl->CountAtLastVacuum) >=tbl->vacuum_threshold)
10841084
{
1085-
snprintf(buf,sizeof(buf),"vacuum analyze %s",tbl->table_name);
1085+
snprintf(buf,sizeof(buf),"VACUUM ANALYZE \"%s\"",tbl->table_name);
10861086
if (args->debug >=1)
10871087
{
10881088
sprintf(logbuffer,"Performing: %s",buf);
@@ -1096,7 +1096,7 @@ main(int argc, char *argv[])
10961096
}
10971097
elseif ((tbl->curr_analyze_count-tbl->CountAtLastAnalyze) >=tbl->analyze_threshold)
10981098
{
1099-
snprintf(buf,sizeof(buf),"analyze %s",tbl->table_name);
1099+
snprintf(buf,sizeof(buf),"ANALYZE \"%s\"",tbl->table_name);
11001100
if (args->debug >=1)
11011101
{
11021102
sprintf(logbuffer,"Performing: %s",buf);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp