Set null Placeholder in PostgreSQL psql
By default, psql
outputs null
as nothing, which is easily mistaken for an empty string.
You can useRead more about the available psql
commands here:
\pset null '<chosen alternative>'
This seems to be tied to a particular session of psql
as it was reset when I restarted the psql
session.
Unicode tangent
The impetus for finding this command came from seeing ¤
used as a null placeholder in “The Art of PostgreSQL”.
It is U+00A4 Currency Sign
Read more about the unicode here. used to denote an unspecified currency. I’ve never seen the symbol before, but apparently it is common enough to be in the International Reference Variant of ASCII.Thanks to Jeff for exploring PostgreSQL with me!