PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ analyze_table()

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

Definition at line 1118 of file raster2pgsql.c.

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

Referenced by process_rasters().

1121  {
1122  char *sql = NULL;
1123  uint32_t len = 0;
1124 
1125  assert(table != NULL);
1126 
1127  len = strlen("ANALYZE ;") + 1;
1128  if (schema != NULL)
1129  len += strlen(schema);
1130  len += strlen(table);
1131 
1132  sql = rtalloc(sizeof(char) * len);
1133  if (sql == NULL) {
1134  rterror(_("analyze_table: Could not allocate memory for ANALYZE TABLE statement"));
1135  return 0;
1136  }
1137  sprintf(sql, "ANALYZE %s%s;",
1138  (schema != NULL ? schema : ""),
1139  table
1140  );
1141 
1142  append_sql_to_buffer(buffer, sql);
1143 
1144  return 1;
1145 }
#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: