PostGIS  2.1.10dev-r@@SVN_REVISION@@
static int analyze_table ( const char *  schema,
const char *  table,
STRINGBUFFER buffer 
)
static

Definition at line 1096 of file raster2pgsql.c.

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

Referenced by process_rasters().

1099  {
1100  char *sql = NULL;
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 
1110  sql = rtalloc(sizeof(char) * len);
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 
1120  append_sql_to_buffer(buffer, sql);
1121  rtdealloc(sql);
1122 
1123  return 1;
1124 }
void rtdealloc(void *mem)
Definition: rt_api.c:882
#define _(String)
Definition: shpcommon.h:23
static int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)
Definition: raster2pgsql.c:820
void * rtalloc(size_t size)
Raster core memory management functions.
Definition: rt_api.c:867
void rterror(const char *fmt,...)
Raster core error and info handlers.
Definition: rt_api.c:895

Here is the call graph for this function:

Here is the caller graph for this function: