PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ drop_table()

static int drop_table ( const char *  schema,
const char *  table,
STRINGBUFFER buffer 
)
static

Definition at line 973 of file raster2pgsql.c.

973 {
974 char *sql = NULL;
975 uint32_t len = 0;
976
977 len = strlen("DROP TABLE IF EXISTS ;") + 1;
978 if (schema != NULL)
979 len += strlen(schema);
980 len += strlen(table);
981
982 sql = rtalloc(sizeof(char) * len);
983 if (sql == NULL) {
984 rterror(_("drop_table: Could not allocate memory for DROP TABLE statement"));
985 return 0;
986 }
987 sprintf(sql, "DROP TABLE IF EXISTS %s%s;",
988 (schema != NULL ? schema : ""),
989 table
990 );
991
993
994 return 1;
995}
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
Definition rt_context.c:199
void * rtalloc(size_t size)
Wrappers used for managing memory.
Definition rt_context.c:171
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: