views:

67

answers:

1

Thank you for Denis who solves the first bug!

How can you have two Postgres queries in one Python method?

Example where the 2nd query is not run

def comp_func(pgmasi):
        pgmasi.query("""CREATE TABLE courses (
        course_id       SERIAL PRIMARY KEY)""")
        pgmasi.query("""CREATE TABLE files (    # not executed for some unknown reason
        file_id         SERIAL PRIMARY KEY""")
+2  A: 

Probably you missed closing parentheses in the line as error message says:

pgmasi.query("INSERT INTO files('binf','file_name') VALUES(file,file_name)"
Denis Otkidach