{"id":15173150,"url":"https://github.com/supabase/pg_listen","last_synced_at":"2025-10-01T10:31:28.086Z","repository":{"id":65982104,"uuid":"258239197","full_name":"supabase/pg_listen","owner":"supabase","description":"Trigger shell command from NOTIFY","archived":true,"fork":true,"pushed_at":"2021-01-22T04:01:03.000Z","size":36,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-13T21:54:15.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"begriffs/pg_listen","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/supabase.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},"funding":{"github":["supabase"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-04-23T14:54:20.000Z","updated_at":"2023-09-02T00:31:29.000Z","dependencies_parsed_at":"2023-02-19T19:15:50.637Z","dependency_job_id":null,"html_url":"https://github.com/supabase/pg_listen","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fpg_listen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fpg_listen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fpg_listen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fpg_listen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supabase","download_url":"https://codeload.github.com/supabase/pg_listen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875258,"owners_count":16554659,"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","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":[],"created_at":"2024-09-27T10:41:31.367Z","updated_at":"2025-10-01T10:31:27.798Z","avatar_url":"https://github.com/supabase.png","language":"C","funding_links":["https://github.com/sponsors/supabase"],"categories":[],"sub_categories":[],"readme":"## pg_listen: trigger a shell command on a Postgres event\n\nSuper fast and lightweight. Written in C using libpq.\n\n### Usage\n\n```bash\npg_listen postgres://db-uri channel [/path/to/program] [args]\n\n# for example, to note when NOTIFY happened on \"hello\" channel\n# pg_listen postgres://localhost/postgres hello /bin/echo they said hi\n\n# print payload from the channel\n# (default action when no command is specified)\n# pg_listen postgres://localhost/postgres fun\n```\n\nNote that pg\\_listen line-buffers its output, so the payload raised by NOTIFY\nneeds to include a final newline (\"\\n\"). The program won't output anything\nuntil a newline is encountered.\n\n```sql\n-- incorrect\nNOTIFY foo, 'hi';\n\n-- correct\nNOTIFY foo, E'hi\\n';\n```\n\n### Building\n\nFor Supabase/KPS on Ubuntu use `make kps`\n\nFor everything else use:\n\nJust clone the repo and run `make`. The makefile is compatible with BSD and GNU\nMake and requires only that libpq be installed on the system.\n\nIf you use NixOS you can run `nix-shell` to build it.\n\nIf you installed PostgreSQL on Mac using homebrew or Macports, note that\npkg-config is not installed by default and needs to be installed by running\n`brew install pkg-config` prior to running `make`. Additionally you may need to\nupdate `$PKG_CONFIG_PATH` and add the directory containing `libpq.pc` for your\nsystem. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fpg_listen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupabase%2Fpg_listen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fpg_listen/lists"}