PostGIS 3.7.0dev-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 1108 of file raster2pgsql.c.

1111 {
1112 char *sql = NULL;
1113 uint32_t len = 0;
1114
1115 assert(table != NULL);
1116
1117 len = strlen("ANALYZE ;") + 1;
1118 if (schema != NULL)
1119 len += strlen(schema);
1120 len += strlen(table);
1121
1122 sql = rtalloc(sizeof(char) * len);
1123 if (sql == NULL) {
1124 rterror(_("analyze_table: Could not allocate memory for ANALYZE TABLE statement"));
1125 return 0;
1126 }
1127 sprintf(sql, "ANALYZE %s%s;",
1128 (schema != NULL ? schema : ""),
1129 table
1130 );
1131
1133
1134 return 1;
1135}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
Definition rt_context.c:191
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: