Backslash N


What is backslash N, or more exactly, \N?

\N is a way of representing NULL. I Googled backslash N and found several resources. Indeed it does represent NULL or a missing value in various contexts. Here’s some of what I found.

The MySQL documentation webpage says “The \N synonym for the NULL is a non-standard SQL syntax extension.”

The VMWare documentation webpage says “NULL represents an unknown piece of data in a column or field. Within your data files you can designate a string to represent null values. The default string is \N (backslash-N) in TEXT mode, or an empty value with no quotations in CSV mode.”

PostgreSQL also makes reference to backslash N being used to represent NULL.

If you download any of the IMDB files you’ll find that they have \N representing nulls.

Leave a Reply