I have this super simple Python code to connect to Postgres and to create a schema. It shows no error but I don't see the schema being added in Postgres. I must be missing something that's apparent.
I am not even sure if this's connected to Postgres because when I gave it a wrong password, it still returned without errors. But when it keeps saying connection is in place when I do trial and error. Please help~ thanks!
import psycopg2
psycopg2.autocommit = True
def build_archive(db1):
db1 = psycopg2.connect(database='postgres', user='operator', password='1234', host='localhost', port='2280')
cursor = db1.cursor()
sql = """CREATE SCHEMA app_tools AUTHORIZATION operator;"""
cursor.execute(sql)
operatoruser create schemas in thepostgresdatabase?