{"id":14383687,"url":"https://github.com/df7cb/pg_dirtyread","last_synced_at":"2025-10-06T18:49:16.151Z","repository":{"id":51261564,"uuid":"87690619","full_name":"df7cb/pg_dirtyread","owner":"df7cb","description":"Read dead but unvacuumed tuples from a PostgreSQL relation","archived":false,"fork":false,"pushed_at":"2024-09-13T16:17:32.000Z","size":102,"stargazers_count":140,"open_issues_count":0,"forks_count":28,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-30T11:34:48.283Z","etag":null,"topics":["extension","pg-dirtyread","postgresql","uncommitted"],"latest_commit_sha":null,"homepage":null,"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/df7cb.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-04-09T07:23:48.000Z","updated_at":"2025-04-29T10:01:01.000Z","dependencies_parsed_at":"2024-09-14T05:52:28.160Z","dependency_job_id":"d7e9371b-4ab3-4ec6-9d77-1fb887256704","html_url":"https://github.com/df7cb/pg_dirtyread","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/df7cb/pg_dirtyread","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df7cb%2Fpg_dirtyread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df7cb%2Fpg_dirtyread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df7cb%2Fpg_dirtyread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df7cb%2Fpg_dirtyread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/df7cb","download_url":"https://codeload.github.com/df7cb/pg_dirtyread/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df7cb%2Fpg_dirtyread/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278663196,"owners_count":26024387,"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-10-06T02:00:05.630Z","response_time":65,"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":["extension","pg-dirtyread","postgresql","uncommitted"],"created_at":"2024-08-28T18:00:57.600Z","updated_at":"2025-10-06T18:49:16.125Z","avatar_url":"https://github.com/df7cb.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"pg_dirtyread\n============\n\nThe pg_dirtyread extension provides the ability to read dead but unvacuumed\nrows from a relation. Supports PostgreSQL 9.2 and later. (On 9.2, at least\n9.2.9 is required.)\n\nBuilding\n--------\n\nTo build pg_dirtyread, just do this:\n\n    make\n    make install\n\nIf you encounter an error such as:\n\n    make: pg_config: Command not found\n\nBe sure that you have `pg_config` installed and in your path. If you used a\npackage management system such as RPM to install PostgreSQL, be sure that the\n`-devel` package is also installed. If necessary tell the build process where\nto find it:\n\n    make PG_CONFIG=/path/to/pg_config\n    make install PG_CONFIG=/path/to/pg_config\n\nLoading and Using\n-------\n\nOnce pg_dirtyread is built and installed, you can add it to a database. Loading\npg_dirtyread is as simple as connecting to a database as a super user and\nrunning:\n\n  ```sql\n    CREATE EXTENSION pg_dirtyread;\n    SELECT * FROM pg_dirtyread('tablename') AS t(col1 type1, col2 type2, ...);\n  ```\n\nThe `pg_dirtyread()` function returns RECORD, therefore it is necessary to\nattach a table alias clause that describes the table schema. Columns are\nmatched by name, so it is possible to omit some columns in the alias, or\nrearrange columns.\n\nExample:\n\n  ```sql\n    CREATE EXTENSION pg_dirtyread;\n\n    -- Create table and disable autovacuum\n    CREATE TABLE foo (bar bigint, baz text);\n    ALTER TABLE foo SET (\n      autovacuum_enabled = false, toast.autovacuum_enabled = false\n    );\n\n    INSERT INTO foo VALUES (1, 'Test'), (2, 'New Test');\n    DELETE FROM foo WHERE bar = 1;\n\n    SELECT * FROM pg_dirtyread('foo') as t(bar bigint, baz text);\n     bar │   baz\n    ─────┼──────────\n       1 │ Test\n       2 │ New Test\n  ```\n\nDropped Columns\n---------------\n\nThe content of dropped columns can be retrieved as long as the table has not\nbeen rewritten (e.g. via `VACUUM FULL` or `CLUSTER`). Use `dropped_N` to access\nthe Nth column, counting from 1. PostgreSQL deletes the type information of the\noriginal column, so only a few sanity checks can be done if the correct type\nwas specified in the table alias; checked are type length, type alignment, type\nmodifier, and pass-by-value.\n\n  ```sql\n    CREATE TABLE ab(a text, b text);\n    INSERT INTO ab VALUES ('Hello', 'World');\n    ALTER TABLE ab DROP COLUMN b;\n    DELETE FROM ab;\n    SELECT * FROM pg_dirtyread('ab') ab(a text, dropped_2 text);\n       a   │ dropped_2\n    ───────┼───────────\n     Hello │ World\n  ```\n\nSystem Columns\n--------------\n\nSystem columns such as `xmax` and `ctid` can be retrieved by including them in\nthe table alias attached to the `pg_dirtyread()` call. A special column `dead` of\ntype boolean is available to report dead rows (as by `HeapTupleIsSurelyDead`).\nThe `dead` column is not usable during recovery, i.e. most notably not on\nstandby servers. The `oid` column is only available in PostgreSQL version 11\nand earlier.\n\n  ```sql\n    SELECT * FROM pg_dirtyread('foo')\n        AS t(tableoid oid, ctid tid, xmin xid, xmax xid, cmin cid, cmax cid, dead boolean,\n             bar bigint, baz text);\n     tableoid │ ctid  │ xmin │ xmax │ cmin │ cmax │ dead │ bar │        baz\n    ──────────┼───────┼──────┼──────┼──────┼──────┼──────┼─────┼───────────────────\n        41823 │ (0,1) │ 1484 │ 1485 │    0 │    0 │ t    │   1 │ Delete\n        41823 │ (0,2) │ 1484 │    0 │    0 │    0 │ f    │   2 │ Insert\n        41823 │ (0,3) │ 1484 │ 1486 │    0 │    0 │ t    │   3 │ Update\n        41823 │ (0,4) │ 1484 │ 1488 │    0 │    0 │ f    │   4 │ Not deleted\n        41823 │ (0,5) │ 1484 │ 1489 │    1 │    1 │ f    │   5 │ Not updated\n        41823 │ (0,6) │ 1486 │    0 │    0 │    0 │ f    │   3 │ Updated\n        41823 │ (0,7) │ 1489 │    0 │    1 │    1 │ t    │   5 │ Not quite updated\n        41823 │ (0,8) │ 1490 │    0 │    2 │    2 │ t    │   6 │ Not inserted\n  ```\n\nAuthors\n-------\n\npg_dirtyread 1.0 was written by Phil Sorber in 2012. Christoph Berg added the\nability to retrieve system columns in version 1.1, released 2017, and took over\nfurther maintenance.\n\nLicense\n-------\n\nCopyright (c) 1996-2024, PostgreSQL Global Development Group\n\nCopyright (c) 2012, OmniTI Computer Consulting, Inc.\n\nPortions Copyright (c) 1994, The Regents of the University of California\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above\n  copyright notice, this list of conditions and the following\n  disclaimer in the documentation and/or other materials provided\n  with the distribution.\n* Neither the name OmniTI Computer Consulting, Inc. nor the names\n  of its contributors may be used to endorse or promote products\n  derived from this software without specific prior written\n  permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdf7cb%2Fpg_dirtyread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdf7cb%2Fpg_dirtyread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdf7cb%2Fpg_dirtyread/lists"}