File: cull_null.sql

package info (click to toggle)
postgis 1.5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 17,296 kB
  • sloc: sql: 77,621; ansic: 59,025; xml: 18,553; sh: 11,043; java: 6,061; perl: 2,133; makefile: 981; yacc: 299; python: 192
file content (8 lines) | stat: -rw-r--r-- 243 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
-- Returns the value passed, or an empty string if null.
-- This is used to concatinate values that may be null.
CREATE OR REPLACE FUNCTION cull_null(VARCHAR) RETURNS VARCHAR
AS $_$
BEGIN
    RETURN coalesce($1,'');
END;
$_$ LANGUAGE plpgsql;