Definition at line 830 of file raster2pgsql.c.
References _, append_sql_to_buffer(), rtalloc(), rterror(), and rtgdalraster::sql.
Referenced by insert_records().
837 assert(table != NULL);
838 assert(column != NULL);
840 len = strlen(
"COPY () FROM stdin;") + 1;
842 len += strlen(schema);
843 len += strlen(table);
844 len += strlen(column);
845 if (filename != NULL)
846 len += strlen(
",") + strlen(file_column_name);
848 sql =
rtalloc(
sizeof(
char) * len);
850 rterror(
_(
"copy_from: Could not allocate memory for COPY statement"));
853 sprintf(sql,
"COPY %s%s (%s%s%s) FROM stdin;",
854 (schema != NULL ? schema :
""),
857 (filename != NULL ?
"," :
""),
858 (filename != NULL ? file_column_name :
"")
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)