leptonix / decoding-json

logical decoding output plugin for postgresql
18 stars 10 forks source link

{"***FIXME***"} is invalid JSON #6

Closed jmealo closed 8 years ago

jmealo commented 8 years ago

I finally noticed the {"***FIXME***"} coming up in my logs. Perhaps we could make it valid JSON so it won't throw syntax errors and can be handled in app. Do you know what work needs to be done to fix this or what the issue is?

PostgreSQL: SyntaxError: Unexpected token }{"type":"table","schema":"redacted","name":"assesses","change":"UPDATE","key":{"***FIXME***"},"data":{"student_id":9999,"sparkpoint_id":"M1000846","reflection":"redacted"}}

Thanks, Jeff

leptonix commented 8 years ago

Hi Jeff,

I have made it valid JSON for now.

I think the issue is not being able to find a unique key to identify a row in the table. If you give me the table structure with all indexes (if any), then I can see if that is really the problem

Regards, Hans

jmealo commented 8 years ago

Thanks for the quick reply. Here is the DDL for that table:

CREATE TABLE assesses
(
    student_id INTEGER NOT NULL,
    sparkpoint_id CHAR(8) NOT NULL,
    reflection TEXT,
    PRIMARY KEY (student_id, sparkpoint_id)
);
jmealo commented 8 years ago

It looks like 9d40fff41da098dd238c99b8d71888280aefd20b fixes the invalid JSON issue. I'm going to open a new ticket to actually fix the issue.