1626bf200adf345e37cf40eb0e4721aeb7dfad15
[xtuple] / foundation-database / public / functions / logout.sql
1
2 CREATE OR REPLACE FUNCTION logout() RETURNS integer AS $$
3 -- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple. 
4 -- See www.xtuple.com/CPAL for the full text of the software license.
5 BEGIN
6   PERFORM pg_advisory_unlock(datid::integer, procpid)
7      FROM pg_stat_activity
8     WHERE(procpid = pg_backend_pid());
9
10   RETURN 0;
11 END;
12 $$ LANGUAGE 'plpgsql';
13
14