I am working with postgreSQL DB, I need to delete a table with this script:
import psycopg2
# Connect to the PostgreSQL database
conn = psycopg2.connect(
host="your_host",
database="your_database",
user="your_username",
password="your_password"
)
# Create a cursor object to execute SQL commands
cur = conn.cursor()
# Define the name of the table to delete
table_name = "your_table_name"
# Define the SQL query to delete the table
delete_table_query = f"DROP TABLE IF EXISTS {table_name};"
cur.execute(delete_table_query)
conn.commit()
cur.close()
conn.close()
when i execute this code and i check the table deleted i see it deleted and empty but when i check on the size of my DB still the same despite i delete 4gb of data ,what is the problem in this script