{"id":14974072,"url":"https://github.com/johto/plpgsql-topological-sort","last_synced_at":"2026-03-02T02:43:08.536Z","repository":{"id":148506475,"uuid":"97758286","full_name":"johto/plpgsql-topological-sort","owner":"johto","description":"Topological sort in plain PL/PgSQL (and hstore)","archived":false,"fork":false,"pushed_at":"2017-07-23T23:51:15.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T13:27:06.071Z","etag":null,"topics":["hstore","kahn","kahns-algorithm","pgsql","plpgsql","postgresql","sort","topological","topological-sort"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johto.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,"publiccode":null,"codemeta":null}},"created_at":"2017-07-19T20:27:40.000Z","updated_at":"2021-07-02T04:18:37.000Z","dependencies_parsed_at":"2023-05-20T08:45:25.457Z","dependency_job_id":null,"html_url":"https://github.com/johto/plpgsql-topological-sort","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"f8aa2ad0e6a8487e3cb41a583e585fd060b38e58"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johto/plpgsql-topological-sort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johto%2Fplpgsql-topological-sort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johto%2Fplpgsql-topological-sort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johto%2Fplpgsql-topological-sort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johto%2Fplpgsql-topological-sort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johto","download_url":"https://codeload.github.com/johto/plpgsql-topological-sort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johto%2Fplpgsql-topological-sort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","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":["hstore","kahn","kahns-algorithm","pgsql","plpgsql","postgresql","sort","topological","topological-sort"],"created_at":"2024-09-24T13:49:54.832Z","updated_at":"2026-03-02T02:43:08.509Z","avatar_url":"https://github.com/johto.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"I needed a topological sort in PL/PgSQL, so here it is.  This is probably not\nespecially fast, but it's written in pure PL/PgSQL using only hstore.\n\nExample usage with the graph on the Wikipedia page:\n\n```SQL\nSELECT topological_sort(\n    ARRAY[5,7,3,11,8,2,9,10],\n    hstore '11 =\u003e \"{5,7}\", 8 =\u003e \"{7,3}\", 2 =\u003e \"{11}\", 9 =\u003e \"{8,11}\", 10 =\u003e \"{3,11}\"'\n);\n```\n\nresult:\n\n```\n  topological_sort\n---------------------\n {5,7,3,11,8,2,10,9}\n(1 row)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohto%2Fplpgsql-topological-sort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohto%2Fplpgsql-topological-sort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohto%2Fplpgsql-topological-sort/lists"}