X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=enyo-client%2Fdatabase%2Fsource%2Fxt%2Ffunctions%2Fpg_advisory_unlock.sql;h=25c3b7aff08178d4caae6f0d3541cdcd94d45681;hb=878495eac6191e6ebefdcbb3fa7b3377c9637fc1;hp=c892882ca8f4e3d9a5e377d5622d66cdf040952b;hpb=25f8bb068c4a2a65a8d681f168b4e9e212194a41;p=xtuple diff --git a/enyo-client/database/source/xt/functions/pg_advisory_unlock.sql b/enyo-client/database/source/xt/functions/pg_advisory_unlock.sql index c892882ca..25c3b7aff 100644 --- a/enyo-client/database/source/xt/functions/pg_advisory_unlock.sql +++ b/enyo-client/database/source/xt/functions/pg_advisory_unlock.sql @@ -1,4 +1,8 @@ create or replace function xt.pg_advisory_unlock(oid integer, id integer) returns boolean as $$ + var sql = "select pg_catalog.pg_advisory_unlock($1, $2) as result;"; + return plv8.execute(sql, [oid, id])[0].result; + /* temporary: let qt client use advisory locks but web client use xt.lock */ + var pid = plv8.execute("select pg_backend_pid() as pid;")[0].pid, username = plv8.execute("select geteffectivextuser() as username;")[0].username, sql = "select * from xt.lock where lock_table_oid = $1 and lock_record_id = $2 and lock_username = $3 and lock_pid = $4;",