1

We've noticed in QGIS (v. 3.8.1) that VARCHAR columns from PostgreSQL(v9.5) containing empty values are being read as the text value of the word "NULL".

Here's the data in QGIS (highlighted records are VARCHAR, the other one is integer):

enter image description here

And here's the same data for the same record in DBeaver:

enter image description here

You can see that DBeaver treats the NULL values as empty, while QGIS treats the same empty data as the word NULL.

This is an issue for a number of reasons, but came to our attention when trying to filter a set of data in QGIS using a WHERE COLUMN_NAME LIKE 'N%' - we were looking for values referring to NO/NON/N but ended up picking up all the NULL values as well!

1
  • you can add a phrase like AND NOT LIKE 'NULL' to your expressions. Eg, your filter expression would be WHERE COLUMN_NAME LIKE 'N%' AND COLUMN_NAME NOT LIKE 'NULL'
    – csk
    Aug 27 '19 at 18:56
1

In the QGIS options, data sources tab there is a "Representation for NULL values" setting that seem to be set to NULL by default, you could try to alter this setting (erasing the NULL and let it empty ?)

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.