973 {
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
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.
void * rtalloc(size_t size)
Wrappers used for managing memory.
Datum buffer(PG_FUNCTION_ARGS)
static int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)