Definition at line 1068 of file raster2pgsql.c.
References _, append_sql_to_buffer(), chartrim(), rtalloc(), rtdealloc(), rterror(), and rtgdalraster::sql.
Referenced by process_rasters().
1075 char *_table = NULL;
1076 char *_column = NULL;
1078 assert(table != NULL);
1079 assert(column != NULL);
1085 len = strlen(
"CREATE INDEX \"__gist\" ON USING gist (st_convexhull());") + 1;
1087 len += strlen(schema);
1088 len += strlen(_table);
1089 len += strlen(_column);
1090 len += strlen(table);
1091 len += strlen(column);
1092 if (tablespace != NULL)
1093 len += strlen(
" TABLESPACE ") + strlen(tablespace);
1095 sql =
rtalloc(
sizeof(
char) * len);
1097 rterror(
_(
"create_index: Could not allocate memory for CREATE INDEX statement"));
1102 sprintf(sql,
"CREATE INDEX ON %s%s USING gist (st_convexhull(%s))%s%s;",
1103 (schema != NULL ? schema :
""),
1106 (tablespace != NULL ?
" TABLESPACE " :
""),
1107 (tablespace != NULL ? tablespace :
"")
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 int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)
void rtdealloc(void *mem)