nvlfunc
nvlfunc · Oracle-compatible NVL function
Overview
Usage
Sources:
nvlfunc version 1.0 provides one Oracle-style NVL convenience function. Its actual SQL surface is deliberately narrow: public.NVL(smallint, smallint) returns the first non-null argument by calling PostgreSQL COALESCE.
Core Workflow
Important Objects
public.NVL(smallint, smallint) RETURNS smallint: anIMMUTABLESQL wrapper aroundCOALESCE($1, $2). PostgreSQL folds the unquoted declaration to function namenvl.
Operational Notes
This extension does not implement Oracle’s broad NVL type-conversion behavior and has no overloads for integer, bigint, numeric, text, date, or timestamp values. Cast both arguments to smallint when literals or NULL make overload resolution ambiguous, and use built-in COALESCE for other types. The function is installed explicitly in public and the extension is non-relocatable, so review name collisions and search-path policy before installation. The upstream repository contains only this function and minimal documentation; validate compatibility on the target PostgreSQL version rather than inferring a wider Oracle-compatibility layer.