Custom Postgres Enum on a pre-existing database causes unhandled Error #3511
Labels
needs: troubleshooting
Issues that we can't reproduce or need to investigate further before picking a course of action
type: bug
Something isn't working
user reported
Reported by a Mathesar user
work: backend
Related to Python, Django, and simple SQL
work: db-layer
Related to SQL or PL/pgSQL
Milestone
Description
Connecting mathesar to a pre-existing postgres database with custom enumerations causes an unspecified error when loading tables.
Running the Production config with the DEBUG flag on (I know this isn't realistic but I was poking around) an AssertionError is raised when serializing the offending column.
Expected behavior
Tables should load in with the Enumerations or a detailed error message should be raised.
To Reproduce
Connect mathesar to a postgres database with custom enumerations
Environment
Workaround (Very ugly bandaid)
I'm sure this larger than just ENUMs and probably extends to all custom types in postgres but for my use case I just patched
db/columns/base.py:MathesarColumn.db_type
property to default to atext
type if no valid type was found.This mostly works but doesn't understand the enum and provides no usable feedback for invalid inputs.
Updating a row:
Inserting a row:
Additional context
I looked through several issues looking to see if this was already discussed and I'm not sure if it ties in with the higher level discussion in issue 403
This sounds like an issue the maintainers would want to address but I work with python and have passing familiarity with django if there's a direction for a more permanent solution I'd be happy to put some time towards that.
The text was updated successfully, but these errors were encountered: