changeset 1315:84bb7e2aecb1

Do not redefine existing operator. The removed SQL failed on PostgreSQL 9.5 because the operator is provided and needed by the system. Further, it does not seem to be used here.
author Tom Gottfried <tom@intevation.de>
date Fri, 17 Mar 2017 13:25:57 +0100
parents 1a3e86f4d768
children 6fbfb8f0927a
files db_schema/audit.sql
diffstat 1 files changed, 0 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/db_schema/audit.sql	Fri Mar 17 13:00:31 2017 +0100
+++ b/db_schema/audit.sql	Fri Mar 17 13:25:57 2017 +0100
@@ -50,24 +50,6 @@
 COMMENT ON OPERATOR - (jsonb, text[]) IS 'delete keys from left operand';
 
 
-CREATE OR REPLACE FUNCTION jsonb_delete_left(a jsonb, b text)
-  RETURNS jsonb AS
-  $BODY$
-       SELECT COALESCE(
-              (
-              SELECT ('{' || string_agg(to_json(key) || ':' || value, ',') || '}')
-              FROM jsonb_each(a)
-              WHERE key <> b
-              )
-       , '{}')::jsonb;
-       $BODY$
-LANGUAGE sql IMMUTABLE STRICT;
-COMMENT ON FUNCTION jsonb_delete_left(jsonb, text) IS 'delete key in second argument from first argument';
-DROP OPERATOR IF EXISTS - (jsonb, text);
-CREATE OPERATOR - ( PROCEDURE = jsonb_delete_left, LEFTARG = jsonb, RIGHTARG = text);
-COMMENT ON OPERATOR - (jsonb, text) IS 'delete key from left operand';
-
-
 CREATE OR REPLACE FUNCTION if_modified_func() RETURNS TRIGGER AS $body$
 DECLARE
     audit_row land.audit_trail;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)