1129 {
1131 uint32_t len = 0;
1132
1133 assert(table != NULL);
1134
1135 len = strlen("VACUUM ANALYZE ;") + 1;
1136 if (schema != NULL)
1137 len += strlen(schema);
1138 len += strlen(table);
1139
1141 if (sql == NULL) {
1142 rterror(
_(
"vacuum_table: Could not allocate memory for VACUUM statement"));
1143 return 0;
1144 }
1145 sprintf(sql, "VACUUM ANALYZE %s%s;",
1146 (schema != NULL ? schema : ""),
1147 table
1148 );
1149
1151
1152 return 1;
1153}
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
Datum buffer(PG_FUNCTION_ARGS)
static int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)