pg_plugins
pg_plugins copied to clipboard
Issue with where clause when NULL values exist in the data
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,
Would you like to write a patch for it?
I faced the same issue.