pggeodb.nancy.inra.fr/db_robot - db_robot on pggeodb.nancy.inra.fr
Previous topic Chapter index Next topic

Function: disablelongtransactions

 

 

Schema

public

 

Owner

albenard

 

Descriptions

Disable long transaction support. This function removes the long transaction support metadata tables, and drops all triggers attached to lock-checked tables.

 

Options

Option

Value

Returns

text

Language

plpgsql

Parameters

There are no parameters for function disablelongtransactions

 

Definition

CREATE OR REPLACE FUNCTION public.disablelongtransactions (
)
RETURNS text AS
$span$
DECLARE

rec RECORD;

BEGIN

--
-- Drop all triggers applied by CheckAuth()
--

FOR rec IN
SELECT
c.relname, t.tgname, t.tgargs FROM pg_trigger t, pg_class c, pg_proc p
WHERE p.proname = 'checkauthtrigger' and t.tgfoid = p.oid and t.tgrelid = c.oid
LOOP
EXECUTE 'DROP TRIGGER ' || quote_ident(rec.tgname) ||
' ON ' || quote_ident(rec.relname);
END LOOP;

--
-- Drop the authorization_table table
--

FOR rec IN SELECT * FROM pg_class WHERE relname = 'authorization_table' LOOP
DROP TABLE authorization_table;
END LOOP;

--
-- Drop the authorized_tables view
--

FOR rec IN SELECT * FROM pg_class WHERE relname = 'authorized_tables' LOOP
DROP VIEW authorized_tables;
END LOOP;

RETURN 'Long transactions support disabled';
END;
$span$
LANGUAGE
'plpgsql'
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
COST
100;

COMMENT ON FUNCTION public.disablelongtransactions()
IS 'Disable long transaction support. This function removes the long transaction support metadata tables, and drops all triggers attached to lock-checked tables.';

This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 26/02/2014 11:51
Previous topic Chapter index Next topic