2
I am developing a simple application where you will need to create a views in Postgresql through Python function. Until then it seems a simple code, but what I did it does not create the views
in the database and also does not present error to my despair.
The function is:
def cria_view(self):
cursor = self.connectBanco()
sql = "CREATE OR REPLACE VIEW espacial.teste AS SELECT *FROM espacial.fx_pedestre;"
cursor.execute(sql)
Here I call the method:
instancia_sql.cria_view()
With this same SQL create the view by Postgresql Query, but by the Python function does not create, but also does not give error. Anyone knows why? I am missing something?
Thanks stderr, the commit was missing anyway. Rookie error, and I spent a lot of time researching and I didn’t remember that I was changing the structure of the bank.
– Francisco Fabio