PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ analyze_table()

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

Definition at line 1096 of file raster2pgsql.c.

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
1121
1122 return 1;
1123}
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
Datum buffer(PG_FUNCTION_ARGS)
static int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)
#define _(String)
Definition shpcommon.h:24

References _, append_sql_to_buffer(), buffer(), rtalloc(), and rterror().

Referenced by process_rasters().

Here is the call graph for this function:
Here is the caller graph for this function: