Definition at line 1178 of file raster2pgsql.c.
References _, append_sql_to_buffer(), chartrim(), rtalloc(), rtdealloc(), rterror(), rtgdalraster::sql, and strreplace().
Referenced by process_rasters().
1187 char *_schema = NULL;
1188 char *_table = NULL;
1189 char *_column = NULL;
1191 assert(table != NULL);
1192 assert(column != NULL);
1195 if (schema != NULL) {
1214 len = strlen(
"SELECT AddRasterConstraints('','','',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE,TRUE,TRUE,TRUE,FALSE);") + 1;
1215 if (_schema != NULL)
1216 len += strlen(_schema);
1217 len += strlen(_table);
1218 len += strlen(_column);
1220 sql =
rtalloc(
sizeof(
char) * len);
1222 rterror(
_(
"add_raster_constraints: Could not allocate memory for AddRasterConstraints statement"));
1225 sprintf(sql,
"SELECT AddRasterConstraints('%s','%s','%s',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,%s,TRUE,TRUE,TRUE,TRUE,%s);",
1226 (_schema != NULL ? _schema :
""),
1229 (regular_blocking ?
"TRUE" :
"FALSE"),
1230 (max_extent ?
"TRUE" :
"FALSE")
1233 if (_schema != NULL)
static char * chartrim(const char *input, char *remove)
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
static char * strreplace(const char *str, const char *oldstr, const char *newstr, int *count)
static int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)
void rtdealloc(void *mem)