SQL Server → PostgreSQL

ISNULL vs COALESCE: Migrating Null Functions from SQL Server to PostgreSQL

ISNULL does not exist in PostgreSQL. Use COALESCE or NULLIF in T-SQL → PL/pgSQL migration without changing report semantics.

ISNULL(expr, fallback) is a SQL Server shortcut with two expressions. In PostgreSQL the direct equivalent is COALESCE(expr, fallback), which accepts N arguments and returns the first non-null.

Direct replacement

SQL Server

SELECT ISNULL(phone, 'N/A') FROM contacts;

PostgreSQL

SELECT COALESCE(phone, 'N/A') FROM contacts;

Analisador de Impacto

Scripts with dozens of ISNULL fail silently during migration. Paste into the Impact Analyzer and see every occurrence.

Abrir Análise de Projeto →