How can I insert column comments in PostGreSQL via Python?

后端 未结 1 367
星月不相逢
星月不相逢 2020-12-20 09:26

Problem

I want to add a comment to a number of columns from Python in a PostGreSQL database. If I run the statement that my Python script produces in a database cl

1条回答
  •  暖寄归人
    2020-12-20 09:44

    You did not commit your changes, so they are automatically rolled back. One way to do it is:

    con.execute(text(stmt).execution_options(autocommit=True))
    

    0 讨论(0)
提交回复
热议问题