====== concatenating null strings ====== In Postgres, when using the || operator to concatenate fields into one string, if any of the fields contain a null value then the result will entirely be a null value. To avoid this problem, we can use the coalesce function: select 'Doe' || ', ' || null || 'John' as name -- result will be null select coalesce('Doe','') || coalesce(', ','') || coalesce(null,'') || coalesce('John','') as name -- result will be 'Doe, John'