Closed jakubgs closed 2 years ago
Since there doesn't seem to be any interest in fixing this I have mitigated it by adding a constraint to the id
column:
ALTER TABLE pageviews ADD CONSTRAINT no_single_quotes CHECK (id NOT LIKE '%''%');
Which now results in an error when trying to insert a row with single quotes in the id
column:
ERROR: new row for relation "pageviews" violates check constraint "no_single_quotes"
Better than nothing.
@LKaemmerling Not sure if this can be fixed easily, but please take a look as this is odd.
I found today a lot of errors like this in my app logs:
I checked the DB logs and found these:
It continues like that for a while, but the point is the 3rd entry in the
IN
clause, which appears to contain a'
character in it. I found these two records by querying thepageviews
table:After removing them the errors stopped happening:
Any idea why this kind of
id
field value could have been generated?