{"id":42924737,"url":"https://github.com/pierreforstmann/pg_set_acl","last_synced_at":"2026-01-30T18:06:59.615Z","repository":{"id":131595450,"uuid":"454032841","full_name":"pierreforstmann/pg_set_acl","owner":"pierreforstmann","description":"PostgreSQL set statement access control list","archived":false,"fork":false,"pushed_at":"2025-01-27T18:08:18.000Z","size":45,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T19:32:53.416Z","etag":null,"topics":["c","postgresql","postgresql-extension"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pierreforstmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-01-31T14:14:17.000Z","updated_at":"2025-01-27T18:08:21.000Z","dependencies_parsed_at":"2023-06-11T01:00:17.614Z","dependency_job_id":null,"html_url":"https://github.com/pierreforstmann/pg_set_acl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pierreforstmann/pg_set_acl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreforstmann%2Fpg_set_acl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreforstmann%2Fpg_set_acl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreforstmann%2Fpg_set_acl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreforstmann%2Fpg_set_acl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pierreforstmann","download_url":"https://codeload.github.com/pierreforstmann/pg_set_acl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreforstmann%2Fpg_set_acl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c","postgresql","postgresql-extension"],"created_at":"2026-01-30T18:06:58.938Z","updated_at":"2026-01-30T18:06:59.610Z","avatar_url":"https://github.com/pierreforstmann.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pg_set_acl\nPostgreSQL extension that implements a SET command access control list.\n# Installation\n\n## Compiling\n\nThis module can be built using the standard PGXS infrastructure. For this to work, the `pg_config` program must be available in your $PATH:\n\n```\ngit clone https://github.com/pierreforstmann/pg_set_acl.git\ncd pg_set_acl\nmake\nmake install\n```\n\nThis extension has been validated with PostgreSQL 10, 11, 12, 13, 14, 15, 16, 17 and 18.\n\n## PostgreSQL setup\n\nExtension should be loaded at server level with `shared_preload_libraries` parameter:\n```\nshared_preload_libraries='pg_set_acl'\n```\nExtension must be created in each database with:\n```\ncreate extension pg_set_acl;\n```\n\n# Usage\n\n`pg_set_acl` has no specific GUC setting.\nNote that installing `pg_set_acl` removes execution privilege on `set_config` function from PUBLIC.\n\n`pg_set_acl` checks that all SET and RESET commands are in the access control list materialized by `set_acl.privs` table (for all users who are not superusers):\n\n```\n \\d set_acl.privs;\n                   Table \"set_acl.privs\"\n     Column     | Type | Collation | Nullable |   Default   \n----------------+------+-----------+----------+-------------\n privilege      | text |           |          | 'SET'::text\n parameter_name | text |           | not null | \n user_name      | text |           | not null | \n\n# \n```\nIf this table is empty, only superusers can use the SET and RESET command. In other words, user must have been explicitly granted privilege to use SET  or RESET command with a given setting using `set_acl.grant` function:\n```\nselect set_acl.grant(setting, user);\n```\nTo revoke privilege to use SET or RESET command with a given setting use:\n```\nselect set_acl.revoke(setting, user);\n```\nOnly superusers can execute `set_acl.grant` and `set_acl.revoke`.\n\n# Example\n```\ntestdb=# \\c testdb postgres\nYou are now connected to database \"testdb\" as user \"postgres\".\ntestdb=# create extension pg_set_acl;\nCREATE EXTENSION\ntestdb=# \\c testdb testuser;\nYou are now connected to database \"testdb\" as user \"testuser\".\ntestdb=\u003e select * from set_acl.privs;\n privilege | parameter_name | user_name \n-----------+----------------+-----------\n(0 rows)\n\ntestdb=\u003e set work_mem='1GB';\nERROR:  pg_set_acl: permission denied for (work_mem,testuser)\ntestdb=\u003e \\c testdb postgres\nYou are now connected to database \"testdb\" as user \"postgres\".\ntestdb=# select set_acl.grant('work_mem','testuser');\n grant \n-------\n t\n(1 row)\n\ntestdb=# \\c testdb testuser;\nYou are now connected to database \"testdb\" as user \"testuser\".\ntestdb=\u003e select * from set_acl.privs;\n privilege | parameter_name | user_name \n-----------+----------------+-----------\n SET       | work_mem       | testuser\n(1 row)\n\ntestdb=\u003e set work_mem='1GB';\nSET\ntestdb=\u003e show work_mem;\n work_mem \n----------\n 1GB\n(1 row)\n\ntestdb=\u003e \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierreforstmann%2Fpg_set_acl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierreforstmann%2Fpg_set_acl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierreforstmann%2Fpg_set_acl/lists"}