PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ analyze_table()

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

Definition at line 1121 of file raster2pgsql.c.

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

Referenced by process_rasters().

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