pg_plugins icon indicating copy to clipboard operation
pg_plugins copied to clipboard

Issue with where clause when NULL values exist in the data

Open mitso32 opened this issue 5 years ago • 2 comments

Hello,

Thank you for the work on the decoder raw plugin! We were performing tests with the decoder_raw plugin and encountered an issue with tables that have NULL values in some of the fields.

In our testing, we had a number of tables that were set to REPLICA IDENTITY FULL, since they lacked a primary key.

In the SQL that was generated by the plugin the UPDATE statement would have the UPDATE where clause with the following format:

WHERE lastname = NULL ...

With most SQL standards the '= ' sign should be replaced with the word 'is' for the NULL value. This would also impact DELETE statements.

The decoder_raw.c file was the file that I reviewed for the WHERE clause function.

Thank you,

mitso32 avatar Jan 16 '20 21:01 mitso32

Would you like to write a patch for it?

michaelpq avatar Jan 17 '20 01:01 michaelpq

I faced the same issue.

sergeykono avatar Jul 22 '20 19:07 sergeykono