1099 {
1101 uint32_t len = 0;
1102
1103 assert(table != NULL);
1104
1105 len = strlen("ANALYZE ;") + 1;
1106 if (schema != NULL)
1107 len += strlen(schema);
1108 len += strlen(table);
1109
1111 if (sql == NULL) {
1112 rterror(
_(
"analyze_table: Could not allocate memory for ANALYZE TABLE statement"));
1113 return 0;
1114 }
1115 sprintf(sql, "ANALYZE %s%s;",
1116 (schema != NULL ? schema : ""),
1117 table
1118 );
1119
1121
1122 return 1;
1123}
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)