PostGIS 3.7.0dev-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 985 of file raster2pgsql.c.

985 {
986 char *sql = NULL;
987 uint32_t len = 0;
988
989 len = strlen("DROP TABLE IF EXISTS ;") + 1;
990 if (schema != NULL)
991 len += strlen(schema);
992 len += strlen(table);
993
994 sql = rtalloc(sizeof(char) * len);
995 if (sql == NULL) {
996 rterror(_("drop_table: Could not allocate memory for DROP TABLE statement"));
997 return 0;
998 }
999 sprintf(sql, "DROP TABLE IF EXISTS %s%s;",
1000 (schema != NULL ? schema : ""),
1001 table
1002 );
1003
1005
1006 return 1;
1007}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
Definition rt_context.c:191
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: