985 {
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
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.
Datum buffer(PG_FUNCTION_ARGS)
static int append_sql_to_buffer(STRINGBUFFER *buffer, const char *str)