1992 {
1993 uint32_t i = 0;
1994
1995 assert(config != NULL);
1996 assert(config->
table != NULL);
1998
2001 rterror(
_(
"process_rasters: Could not add BEGIN statement to string buffer"));
2002 return 0;
2003 }
2004 }
2005
2006
2007 if (config->
opt ==
'd') {
2009 rterror(
_(
"process_rasters: Could not add DROP TABLE statement to string buffer"));
2010 return 0;
2011 }
2012
2016 rterror(
_(
"process_rasters: Could not add an overview's DROP TABLE statement to string buffer"));
2017 return 0;
2018 }
2019 }
2020 }
2021 }
2022
2023
2024 if (config->
opt !=
'a') {
2030 )) {
2031 rterror(
_(
"process_rasters: Could not add CREATE TABLE statement to string buffer"));
2032 return 0;
2033 }
2034
2042 )) {
2043 rterror(
_(
"process_rasters: Could not add an overview's CREATE TABLE statement to string buffer"));
2044 return 0;
2045 }
2046 }
2047 }
2048 }
2049
2050
2051 if (config->
opt !=
'p') {
2054
2055
2059
2061
2064
2065
2067 rterror(
_(
"process_rasters: Could not process raster: %s"), config->
rt_file[i]);
2070 return 0;
2071 }
2072
2073
2077 config->file_column_name,
2078 config->copy_statements, config->out_srid,
2080 )) {
2081 rterror(
_(
"process_rasters: Could not convert raster tiles into INSERT or COPY statements"));
2084 return 0;
2085 }
2086
2088
2089
2091
2092
2094 uint32_t j = 0;
2095
2097
2099 rterror(
_(
"process_rasters: Could not create overview of factor %d for raster %s"), config->
overview[j], config->
rt_file[i]);
2102 return 0;
2103 }
2104
2108 config->copy_statements, config->out_srid,
2110 )) {
2111 rterror(
_(
"process_rasters: Could not convert overview tiles into INSERT or COPY statements"));
2114 return 0;
2115 }
2116
2118
2119
2121 }
2122 }
2123
2125 if (i < 1)
2127 else {
2129 }
2130 }
2131
2133 }
2134
2136 }
2137
2138
2140
2145 )) {
2146 rterror(
_(
"process_rasters: Could not add CREATE INDEX statement to string buffer"));
2147 return 0;
2148 }
2149
2150
2151 if (config->
opt !=
'p') {
2155 )) {
2156 rterror(
_(
"process_rasters: Could not add ANALYZE statement to string buffer"));
2157 return 0;
2158 }
2159 }
2160
2163
2168 )) {
2169 rterror(
_(
"process_rasters: Could not add an overview's CREATE INDEX statement to string buffer"));
2170 return 0;
2171 }
2172
2173
2174 if (config->
opt !=
'p') {
2178 )) {
2179 rterror(
_(
"process_rasters: Could not add an overview's ANALYZE statement to string buffer"));
2180 return 0;
2181 }
2182 }
2183 }
2184 }
2185 }
2186
2187
2193 )) {
2194 rterror(
_(
"process:rasters: Could not add AddRasterConstraints statement to string buffer"));
2195 return 0;
2196 }
2197
2204 )) {
2205 rterror(
_(
"process_rasters: Could not add an overview's AddRasterConstraints statement to string buffer"));
2206 return 0;
2207 }
2208 }
2209 }
2210 }
2211
2212
2220 )) {
2221 rterror(
_(
"process_rasters: Could not add an overview's AddOverviewConstraints statement to string buffer"));
2222 return 0;
2223 }
2224 }
2225 }
2226
2229 rterror(
_(
"process_rasters: Could not add END statement to string buffer"));
2230 return 0;
2231 }
2232 }
2233
2234
2239 )) {
2240 rterror(
_(
"process_rasters: Could not add VACUUM statement to string buffer"));
2241 return 0;
2242 }
2243
2249 )) {
2250 rterror(
_(
"process_rasters: Could not add an overview's VACUUM statement to string buffer"));
2251 return 0;
2252 }
2253 }
2254 }
2255
2256 }
2257
2258 return 1;
2259}
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
Datum buffer(PG_FUNCTION_ARGS)
static int add_overview_constraints(const char *ovschema, const char *ovtable, const char *ovcolumn, const char *schema, const char *table, const char *column, const int factor, STRINGBUFFER *buffer)
static int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)
static int build_overview(int idx, RTLOADERCFG *config, RASTERINFO *info, uint32_t ovx, STRINGBUFFER *tileset, STRINGBUFFER *buffer)
static void diff_rastinfo(RASTERINFO *x, RASTERINFO *ref)
static int convert_raster(int idx, RTLOADERCFG *config, RASTERINFO *info, STRINGBUFFER *tileset, STRINGBUFFER *buffer)
static void rtdealloc_stringbuffer(STRINGBUFFER *buffer, int freebuffer)
static int insert_records(const char *schema, const char *table, const char *column, const char *filename, const char *file_column_name, int copy_statements, int out_srid, STRINGBUFFER *tileset, STRINGBUFFER *buffer)
static void flush_stringbuffer(STRINGBUFFER *buffer)
static void rtdealloc_rastinfo(RASTERINFO *info)
static void init_rastinfo(RASTERINFO *info)
static int vacuum_table(const char *schema, const char *table, STRINGBUFFER *buffer)
static int create_index(const char *schema, const char *table, const char *column, const char *tablespace, STRINGBUFFER *buffer)
static int add_raster_constraints(const char *schema, const char *table, const char *column, int regular_blocking, int max_extent, STRINGBUFFER *buffer)
static int drop_table(const char *schema, const char *table, STRINGBUFFER *buffer)
static int copy_rastinfo(RASTERINFO *dst, RASTERINFO *src)
static void init_stringbuffer(STRINGBUFFER *buffer)
static int analyze_table(const char *schema, const char *table, STRINGBUFFER *buffer)
static int create_table(const char *schema, const char *table, const char *column, const int file_column, const char *file_column_name, const char *tablespace, const char *idx_tablespace, STRINGBUFFER *buffer)