PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ vacuum_table()

static int vacuum_table ( const char *  schema,
const char *  table,
STRINGBUFFER buffer 
)
static

Definition at line 1148 of file raster2pgsql.c.

References _, append_sql_to_buffer(), rtalloc(), rterror(), and rtgdalraster::sql.

Referenced by process_rasters().

1151  {
1152  char *sql = NULL;
1153  uint32_t len = 0;
1154 
1155  assert(table != NULL);
1156 
1157  len = strlen("VACUUM ANALYZE ;") + 1;
1158  if (schema != NULL)
1159  len += strlen(schema);
1160  len += strlen(table);
1161 
1162  sql = rtalloc(sizeof(char) * len);
1163  if (sql == NULL) {
1164  rterror(_("vacuum_table: Could not allocate memory for VACUUM statement"));
1165  return 0;
1166  }
1167  sprintf(sql, "VACUUM ANALYZE %s%s;",
1168  (schema != NULL ? schema : ""),
1169  table
1170  );
1171 
1172  append_sql_to_buffer(buffer, sql);
1173 
1174  return 1;
1175 }
#define _(String)
Definition: shpcommon.h:24
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
Definition: rt_context.c:199
void * rtalloc(size_t size)
Wrappers used for managing memory.
Definition: rt_context.c:171
unsigned int uint32_t
Definition: uthash.h:78
static int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)
Definition: raster2pgsql.c:822
Here is the call graph for this function:
Here is the caller graph for this function: