schema/spacewalk/postgres/procs/nvl.sql | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
New commits: commit 34633222aac6a3ad8f0f613866a96e5a9dd03c0f Author: Jan Pazdziora jpazdziora@redhat.com Date: Mon Oct 4 10:54:11 2010 +0200
The nvl source is PostgreSQL-specific.
diff --git a/schema/spacewalk/postgres/procs/nvl.sql b/schema/spacewalk/postgres/procs/nvl.sql index e7430fb..8f88524 100644 --- a/schema/spacewalk/postgres/procs/nvl.sql +++ b/schema/spacewalk/postgres/procs/nvl.sql @@ -1,3 +1,4 @@ +-- oracle equivalent source none -- -- Copyright (c) 2010 Red Hat, Inc. --
commit 908cb290655c8e04ed0354e3616f8bb811b63874 Author: Colin Coe colin.coe@gmail.com Date: Tue Aug 10 20:31:19 2010 +0800
PostgreSQL NVL stored procedure
PATCH: make NVL work in PostgreSQL
Attached is a patch that makes the NVL errors GoAway(tm).
diff --git a/schema/spacewalk/postgres/procs/nvl.sql b/schema/spacewalk/postgres/procs/nvl.sql new file mode 100644 index 0000000..e7430fb --- /dev/null +++ b/schema/spacewalk/postgres/procs/nvl.sql @@ -0,0 +1,25 @@ +-- +-- Copyright (c) 2010 Red Hat, Inc. +-- +-- This software is licensed to you under the GNU General Public License, +-- version 2 (GPLv2). There is NO WARRANTY for this software, express or +-- implied, including the implied warranties of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 +-- along with this software; if not, see +-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. +-- +-- Red Hat trademarks are not licensed under GPLv2. No permission is +-- granted to use or replicate Red Hat trademarks that are incorporated +-- in this software or its documentation. +-- +-- +-- +-- + + +create or replace +function nvl(input varchar, replace_with varchar) returns varchar +as $$ + SELECT COALESCE(NULLIF($1,''), $2); +$$ +LANGUAGE SQL;