PostGIS  2.5.0beta1dev-r@@SVN_REVISION@@

◆ vacuum_table()

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

Definition at line 1151 of file raster2pgsql.c.

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

Referenced by process_rasters().

1154  {
1155  char *sql = NULL;
1156  uint32_t len = 0;
1157 
1158  assert(table != NULL);
1159 
1160  len = strlen("VACUUM ANALYZE ;") + 1;
1161  if (schema != NULL)
1162  len += strlen(schema);
1163  len += strlen(table);
1164 
1165  sql = rtalloc(sizeof(char) * len);
1166  if (sql == NULL) {
1167  rterror(_("vacuum_table: Could not allocate memory for VACUUM statement"));
1168  return 0;
1169  }
1170  sprintf(sql, "VACUUM ANALYZE %s%s;",
1171  (schema != NULL ? schema : ""),
1172  table
1173  );
1174 
1175  append_sql_to_buffer(buffer, sql);
1176 
1177  return 1;
1178 }
#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:825
Here is the call graph for this function:
Here is the caller graph for this function: