On the surface, PostgreSQL’s quote_literal() and quote_nullable() functions appear to do the same thing. But there is a difference.
It all comes down to how they deal with null arguments; quote_literal() returns null while quote_nullable() returns the string NULL.