1111 {
1113 uint32_t len = 0;
1114
1115 assert(table != NULL);
1116
1117 len = strlen("ANALYZE ;") + 1;
1118 if (schema != NULL)
1119 len += strlen(schema);
1120 len += strlen(table);
1121
1123 if (sql == NULL) {
1124 rterror(
_(
"analyze_table: Could not allocate memory for ANALYZE TABLE statement"));
1125 return 0;
1126 }
1127 sprintf(sql, "ANALYZE %s%s;",
1128 (schema != NULL ? schema : ""),
1129 table
1130 );
1131
1133
1134 return 1;
1135}
void rterror(const char *fmt,...) __attribute__((format(printf
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)