Postgresql cannot drop trigger I'm running the following with alembic:

def downgrade():
    conn = op.get_bind()
    conn.execute(sa.sql.text('''
DROP TRIGGER update_rated_trigger ON rating;
DROP FUNCTION update_rated;
    '''))


It gives the error:


  sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) syntax error at or near ";"
  LINE 2: DROP TRIGGER "update_rated_trigger";


Not sure what the problem is with postgres?
The issue is that Postgres requires you to include the braces at the end of the function name when calling DROP FUNCTION.

If you change your code to the following, it'll work:

def downgrade():
    conn = op.get_bind()
    conn.execute(sa.sql.text('''
DROP TRIGGER update_rated_trigger ON rating;
DROP FUNCTION update_rated();
    '''))