{"id":20644025,"url":"https://github.com/adjust/pg_lock_pool","last_synced_at":"2025-12-06T16:03:05.372Z","repository":{"id":52454184,"uuid":"155349399","full_name":"adjust/pg_lock_pool","owner":"adjust","description":"A postgres Extension to wait on a lock pool","archived":false,"fork":false,"pushed_at":"2025-06-26T08:59:16.000Z","size":22,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-06-26T09:44:14.314Z","etag":null,"topics":["adjust-pg-extension"],"latest_commit_sha":null,"homepage":"","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adjust.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-10-30T08:23:33.000Z","updated_at":"2025-06-26T08:59:19.000Z","dependencies_parsed_at":"2024-04-22T14:07:54.744Z","dependency_job_id":null,"html_url":"https://github.com/adjust/pg_lock_pool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adjust/pg_lock_pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpg_lock_pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpg_lock_pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpg_lock_pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpg_lock_pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adjust","download_url":"https://codeload.github.com/adjust/pg_lock_pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpg_lock_pool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27546461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-06T02:00:06.463Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adjust-pg-extension"],"created_at":"2024-11-16T16:14:35.117Z","updated_at":"2025-12-06T16:03:05.351Z","avatar_url":"https://github.com/adjust.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://github.com/adjust/pg_lock_pool/workflows/CI/badge.svg)\n\n# pg_lock_pool\n\nA postgres Extension to wait on a lock pool\n\nThe functions\nget_lock_pool(pool int, poolsize int, timeout int )\nget_xact_lock_pool(pool int, poolsize int, timeout int )\nwaits on a lock pool defined by key until timeout occurs.\nThe poolsize can be defined by the application for each call.\nThe timeout can be defined in seconds (defaults to 10).\n\nOn success the function returns a positive integer which can be used\nto manually release the lock.\nIf timeout occurs the return value is -1.\n\nOtherwise the lock is automatically released on session end (get_lock_pool)\nor transaction end (get_xact_lock_pool)\n\n\n\n### Usage\n\nsee test/expected/pg_lock_pool_test.out for examples\n\nSession Level Lock\n\n```SQL\n-- wait 30 sec to get a lock from the pool of size 3\nSELECT get_lock_pool(999, 3, 30);\n get_lock_pool\n---------------\n             1\n(1 row)\n\n-- release lock\nSELECT pg_advisory_unlock(999, 1);\n pg_advisory_unlock\n--------------------\n t\n(1 row)\n\n```\n\nTransaction Level Lock\n\n```SQL\n-- wait 30 sec to get a lock from the pool of size 3\nBEGIN;\nSELECT get_xact_lock_pool(999, 3, 30);\n get_xact_lock_pool \n--------------------\n                  1\n(1 row)\nEND;\n-- lock will be released on transaction end\n```\n\n### Installation\n\n```shell\n$ make install\n```\n\n```SQL\nCREATE EXTENSION pg_lock_pool;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Fpg_lock_pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadjust%2Fpg_lock_pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Fpg_lock_pool/lists"}