Better null display psql

  • March 29, 2018

I’ve been frustating recently to differenciate NULL and empty strings in postgresql when requeting manually with psql

Turns out there’s an easy way to change that.

Just use

\pset null 'Ø'

and now

 id |          email          |  first  | last
----+-------------------------+---------+-------
  1 | your-email@example.com  | Foo     | Bar
  2 | first-is-null@foo.com   |         |

will be

 id |          email          |  first  | last
----+-------------------------+---------+-------
  1 | your-email@example.com  | Foo     | Bar
  2 | first-is-null@foo.com   | Ø       |