Could not parse CHECK constraint text
See original GitHub issueHello,
I have the following CHECK constraint on one of my tables:
CONSTRAINT ownership_fk CHECK(foreign_property('OWNERSHIP', ownership_id))
And I am getting the following warning using sqlalchemy 1.3.8:
c:\program files\python37\lib\site-packages\sqlalchemy\dialects\postgresql\base.py:3450:
SAWarning: Could not parse CHECK constraint text: "CHECK (foreign_property('OWNERSHIP'::text, (ownership_id)::text))"
What should I do to fix or suppress this warning?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
O2SS0007: Check constraint condition not parsed (Error)
When you try to convert the schema of a table having a constraint condition which is checking for NAN values, SSMA generates an...
Read more >Parsing SQL Check Constraint - Stack Overflow
Simple answer: this will NOT be easy. At least not if you're trying to do it right... You are talking about defining a...
Read more >Parsing check constraints - Oracle Communities
Hello, I need to write a tool that will analyze the text of the check constraints ; but before starting, I wanted to...
Read more >How to use SQL Check Constraints - SQLShack
This article will show details about SQL check constraints and the relationship between constraints and query performance.
Read more >How to Use Check Constraint in PostgreSQL?
Values that meet the specified criteria/condition will be inserted/updated into PostgreSQL, while those that do not will be rejected. This post ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@pipriles - Your fix seems to work fine. Thanks!
@pipriles - I did some testing and if
foreign_property
is a user-defined function that returns a boolean value you could also avoid the warning by changing your CHECK constraint fromto
I’ve also started working on a patch for this issue. Stay tuned …