On Thu, Sep 5, 2019, at 7:50 AM, Riccardo Cagnasso wrote:
> I have a table Activity that had a strategic_project_name column.
> I removed the strategic_project_name column from the declarative definition 
> of the Activity table and then the strategic_project_name column from the 
> database itself.
> 
> Now I get this error message every time I try to update the one Activity 
> record.
> 
> File 
> "/home/phas/virtualenvs/o35/lib/python3.5/site-packages/SQLAlchemy-1.3.8-py3.5-linux-x86_64.egg/sqlalchemy/engine/default.py",
>  line 552, in do_execute
>  cursor.execute(statement, parameters)
> sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column 
> "strategic_project_name" does not exist
> 
> [SQL: UPDATE activity SET subtitle=%(subtitle)s WHERE activity.id = 
> %(activity_id)s]
> [parameters: {'activity_id': 200, 'subtitle': 'gjh'}]
> 
> which is very odd because the SQL doesn't contain the column 
> strategic_project_name
> 
> If I manually create a strategic_project_name column in the database activity 
> table, it starts to work again, so it's not referring to some different 
> table.``
> 
> I can't track why does sqlalchemy think that Activity would still have a 
> "strategic_project_name" column. I removed all the occurrencies of the word 
> "strategic_project_name" from my whole project, but I'm still getting this 
> error.
> 
> Do you have any advice on how to track this in the internals of sqlalchemy?

the internals of SQLAlchemy don't have this string name either. your best bet 
would be to turn on logging in the Postgresql server and see what it's seeing 
directly

https://www.postgresql.org/docs/9.0/runtime-config-logging.html




> 

> --
>  SQLAlchemy - 
>  The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
>  To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
>  --- 
>  You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
>  To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
>  To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/729b8817-a4e5-45ef-b31d-17772ab9016b%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/729b8817-a4e5-45ef-b31d-17772ab9016b%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/2e1a3e39-de7d-4e03-a8a2-a15169c0d899%40www.fastmail.com.

Reply via email to