Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Internal Error when adding CHECK constraint with nonexistent column name #30
Postico will encounter an "Internal Error" when a user tries to add a
From the looks of the error (see below), some type of loop isn't stopped before going beyond the bounds of the mutable array that holds the column names. Normally, this is fine because a
Also, when I restart Postico after the crash, I can't go back into my table to correct the constant expression. Whenever I try to open the structure of that table, I get a similar "Internal Error" alert. If I choose the "Continue" option in the alert, I just see a blank view. Do you have any temporary workaround ideas for fixing that constraint expression until the issue is fixed?
I encountered the error in v0.24 and was able to reproduce it in v0.25 also.
See below for the error message and stack trace generated by Postico before crashing:
Hi! I assume you are running the El Capitan Beta since you get the Internal Error message?
I don't think the problem is related to the typo, that typo should just cause a PostgreSQL error.
Could you send me the full crash report or at least the part with the load address for Postico so I can look up the symbols in the backtrace? The part I'm looking for looks like this:
Hi again! I just looked throught the source and I think I found the cause of the problem. When Postico tries to match constraints with columns, it crashes when it can't find the column a constraint belongs to. (The index 9223372036854775807 is equal to the constant NSNotFound). I've now fixed the crash.
Can you try if this build works?
Unfortunately, your constraint might now disappear, because Postico only shows constraints that are attached to a specific column.
As a workaround, you can look for the constraint in the system table "pg_constraint". Make sure you enabled "Show System Tables" in Postico preferences. You can quickly find recently added constraints by sorting by OID. Then you can delete the constraint using a query like
I fixed the typo, thanks for pointing it out.
I'm curious: what system are you connecting to that allows typos in check constraints? Are you connecting to Redshift? When I mistype a column name on PostgreSQL 9.4, I just get an error stating that the column with that name doesn't exist.