Skip to content

pgTap does not allow to use pg_advisory_lock(key1 int, key2 int) #357

@floratmin

Description

@floratmin

When I have a function and set a pg_advisory_lock(key bigint) the test passes without problems. But when I use the second form with two integers, the execution of the test gets blocked and waits till I cancel the test execution.

create function foo() RETURNS boolean AS $$
BEGIN
  PERFORM pg_advisory_lock(1, 1);
  PERFORM pg_advisory_unlock(1, 1);
  RETURN true;
END;
$$ LANGUAGE plpgsql;

BEGIN;

SELECT plan(1);

select is(foo(), true);

SELECT * FROM finish();
ROLLBACK;

It also does not work when the bigint is 2e10::bigint + 1.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions