Here's another, quicker way to do it.
SELECT column1, column2, COALESCE(maybe_null_column, 'NULL') FROM your_table;
Note: If maybe_null_column is not a character data type, then you need to coerce it. ie: maybe_null_column::text
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.