Using an Emoji in Place of NULL in YSQL

The \pset meta-command in ysqlsh can be used to display an alternative value for NULL, which shows up as blank by default.

Example:

				
					yugabyte=# SELECT 1 AS c1, null AS c2; -- NULL shows as blank
 c1 | c2
----+----
  1 |
(1 row)

yugabyte=# \pset null null
Null display is "null".

yugabyte=# SELECT 1 AS c1, null AS c2; -- NULL shows as the text "null"
 c1 |  c2
----+------
  1 | null
(1 row)
				
			

What’s fun is that we can also set null to display as an emoji! So, in the sprit of the holiday season, let’s try some holiday emojis…

Example:

Have Fun!