{"id":13437528,"url":"https://github.com/dolthub/doltgresql","last_synced_at":"2026-02-21T04:05:36.715Z","repository":{"id":205001205,"uuid":"689017703","full_name":"dolthub/doltgresql","owner":"dolthub","description":"DoltgreSQL - Version Controlled PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-05-09T00:07:04.000Z","size":22567,"stargazers_count":1255,"open_issues_count":65,"forks_count":30,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-09T00:28:37.486Z","etag":null,"topics":["database-version-control","git","postgres","postgresql","version-conrolled-database"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dolthub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"dolthub"}},"created_at":"2023-09-08T15:46:36.000Z","updated_at":"2025-05-08T23:59:04.000Z","dependencies_parsed_at":"2024-02-26T16:58:12.388Z","dependency_job_id":"7c2a043a-3539-44db-8734-6e2ecf55c4d6","html_url":"https://github.com/dolthub/doltgresql","commit_stats":null,"previous_names":["dolthub/doltgresql"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fdoltgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fdoltgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fdoltgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fdoltgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dolthub","download_url":"https://codeload.github.com/dolthub/doltgresql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149867,"owners_count":22022850,"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":["database-version-control","git","postgres","postgresql","version-conrolled-database"],"created_at":"2024-07-31T03:00:58.032Z","updated_at":"2026-01-18T02:40:24.933Z","avatar_url":"https://github.com/dolthub.png","language":"Go","readme":"# Doltgres is Dolt for Postgres!\n\n\n\nFrom the creators of [Dolt](https://www.doltdb.com), the world's first version controlled SQL\ndatabase, comes [Doltgres](https://www.doltgres.com), the Postgres-flavored version of Dolt. It's a\nSQL database that you can branch and merge, fork and clone, push and pull just like a Git\nrepository. Connect to your Doltgres server just like any Postgres database to read or modify schema\nand data. Version control functionality is exposed in SQL via system tables, functions, and\nprocedures.\n\nGit versions file, Doltgres versions tables. It's like Git and Postgres had a baby.\n\n# Doltgres is Beta\n\n[Doltgres is now Beta quality](https://dolthub.com/blog/2025-04-16-doltgres-goes-beta/), which means\nit's ready for your production use case. There will be bugs and missing features, but [we can fix\nmost of them in 24 hours](https://www.dolthub.com/blog/2024-05-15-24-hour-bug-fixes/) if you [file\nan issue](https://github.com/dolthub/doltgresql/issues).\n\nThe wait is over! Now is the time to [try out Doltgres](#getting-started) and let us know what you\nthink. Import your existing Postgres database into Doltgres with `pg_dump` and `psql`, and let us\nknow if anything doesn't work.\n\nIf you're excited about this project, you can also help speed it along in a few other ways:\n\n- Star this repo\n- Create [issues](https://github.com/dolthub/doltgresql/issues) if you find bugs\n- Create [issues](https://github.com/dolthub/doltgresql/issues) for missing functionality you want\n- Contribute code for features you want (see the [Contribution\n  Guide](https://github.com/dolthub/doltgresql/blob/main/CONTRIBUTING.md))\n- Tell your friends and colleagues\n\n# Full Documentation\n\nDoltgres has a [documentation website](https://docs.doltgres.com) with extensive documentation.\n\n# Installation\n\nTo install Doltgres on Linx or Mac based systems run this command in your terminal:\n\n```\nsudo bash -c 'curl -L https://github.com/dolthub/doltgresql/releases/latest/download/install.sh | bash'\n```\n\nThis will download the latest doltgres release and put it in `/usr/local/bin/`, which is probably on\nyour `$PATH`.\n\n## Windows\n\nDownload the latest Microsoft Installer (`.msi` file) in\n[releases](https://github.com/dolthub/doltgresql/releases) and run it.\n\n## Docker\n\nDoltgres publishes an official Docker image on every release:\n\n* [dolthub/doltgresql](https://hub.docker.com/r/dolthub/doltgresql)\n\nRun it on your local Docker like this:\n\n```bash\n$ docker run -e DOLTGRES_PASSWORD=myPassword -p 5432:5432 dolthub/doltgresql:latest\n```\n\n## Building From Source\n\nTo produce a binary from source code, run `./scripts/build.sh`.\n\n# Getting Started\n\n1. Run `doltgres`. This will create a `postgres` user and a `postgres` database in the current\ndirectory. The default password will be `password`, just like in Postgres. You can use a\n`config.yaml` file or set the `DOLTGRES_DATA_DIR` environment variable to use a different directory\nfor your databases.\n\nYou can change the name and password of the super-user by setting the `DOLTGRES_USER` and\n`DOLTGRES_PASSWORD` environment variables before running `doltgres` for the first time.\n\n```bash\n$ doltgres\nINFO[0000] Server ready. Accepting connections.\n```\n\n2. Install Postgres to get the `psql` tool. I used Homebrew to install Postgres on my Mac.  This\nrequires I manually add `/opt/homebrew/opt/postgresql@15/bin` to my path. We only need Postgres in\norder to use `psql`, so feel free to skip this step if you already have `psql`, or if you have\nanother Postgres client you use instead.\n\n```\nexport PATH=\"/opt/homebrew/opt/postgresql@15/bin:$PATH\"\n```\n\n3. Open a new terminal. Connect with the following command: `PGPASSWORD=password psql -h localhost\n-U postgres`. This will connect to the `postgres` database with the `postgres` user.\n\n```bash\n$ PGPASSWORD=password psql -h localhost\npsql (15.4 (Homebrew), server 15.0)\nType \"help\" for help.\n\npostgres=\u003e\n```\n\n4. Create a `getting_started` database. Create the `getting_started` example tables.\n\n```sql\npostgres=\u003e create database getting_started;\n--\n(0 rows)\n\npostgres=\u003e \\c getting_started;\npsql (15.4 (Homebrew), server 15.0)\nYou are now connected to database \"getting_started\" as user \"postgres\".\ngetting_started=\u003e create table employees (\n    id int8,\n    last_name text,\n    first_name text,\n    primary key(id));\n--\n(0 rows)\n\ngetting_started=\u003e create table teams (\n    id int8,\n    team_name text,\n    primary key(id));\n--\n(0 rows)\n\ngetting_started=\u003e create table employees_teams(\n    team_id int8,\n    employee_id int8,\n    primary key(team_id, employee_id),\n    foreign key (team_id) references teams(id),\n    foreign key (employee_id) references employees(id));\n--\n(0 rows)\n\ngetting_started=\u003e \\d\n              List of relations\n Schema |      Name       | Type  |  Owner\n--------+-----------------+-------+----------\n public | employees       | table | postgres\n public | employees_teams | table | postgres\n public | teams           | table | postgres\n(3 rows)\n```\n\n5. Make a Dolt Commit.\n\n```sql\ngetting_started=\u003e select * from dolt.status;\n   table_name           | staged |  status\n------------------------+--------+-----------\n public.employees       | f      | new table\n public.employees_teams | f      | new table\n public.teams           | f      | new table\n(3 rows)\n\ngetting_started=\u003e select dolt_add('teams', 'employees', 'employees_teams');\n dolt_add\n----------\n {0}\n(1 row)\ngetting_started=\u003e select * from dolt.status;\n   table_name          | staged |  status\n-----------------------+--------+-----------\npublic.employees       | t      | new table\npublic.employees_teams | t      | new table\npublic.teams           | t      | new table\n(3 rows)\n\ngetting_started=\u003e select dolt_commit('-m', 'Created initial schema');\n            dolt_commit\n------------------------------------\n {peqq98e2dl5gscvfvic71e7j6ne34533}\n(1 row)\n```\n\n6. View the Dolt log.\n\n```sql\ngetting_started=\u003e select * from dolt.log;\n           commit_hash            | committer |       email        |        date         |          message\n----------------------------------+-----------+--------------------+---------------------+----------------------------\n peqq98e2dl5gscvfvic71e7j6ne34533 | postgres  | postgres@127.0.0.1 | 2023-11-01 22:08:04 | Created initial schema\n in7bk735qa6p6rv6i3s797jjem2pg4ru | timsehn   | tim@dolthub.com    | 2023-11-01 22:04:03 | Initialize data repository\n(2 rows)\n```\n\n7. Continue with [Dolt Getting Started](https://docs.dolthub.com/introduction/getting-started/database#insert-some-data)\n   to test out more Doltgres versioning functionality.\n\n# Limitations and differences from Dolt\n\n- No [Git-style CLI](https://docs.dolthub.com/cli-reference/cli) for version control like in\n  [Dolt](https://github.com/dolthub/dolt), only a SQL interface.\n- Can't push to DoltHub or DoltLab, only custom remotes (such as on the file system or to S3).\n- Backup and replication are a work in progress.\n- No GSSAPI support.\n- No extension support yet.\n- Some Postgres syntax, types, functions, and features are not yet implemented. If you encounter a\n  missing feature you need for your application, please [file an issue to let us\n  know](https://github.com/dolthub/doltgresql/issues).\n\n# Performance\n\nDolt is [1.1X slower than MySQL](https://docs.dolthub.com/sql-reference/benchmarks/latency) as\nmeasured by a standard suite of Sysbench tests.\n\nWe use these same Sysbench tests to benchmark DoltgreSQL and compare the results to PostgreSQL.\n\nHere are the benchmarks for DoltgreSQL version `0.50.0`. All figures are median latency in\nmilliseconds.\n\n\u003c!-- START_LATENCY_RESULTS_TABLE --\u003e\n\n| Read Tests                   | Postgres | Doltgres | Multiple |\n| ---                          | ---      | ---      | ---      |\n| covering_index_scan_postgres | 1.89     | 5.28     | 2.8      |\n| groupby_scan_postgres        | 5.28     | 46.63    | 8.8      |\n| index_join_postgres          | 1.96     | 10.09    | 5.1      |\n| index_join_scan_postgres     | 0.67     | 8.9      | 13.3     |\n| index_scan_postgres          | 17.95    | 130.13   | 7.2      |\n| oltp_point_select            | 0.14     | 0.52     | 3.7      |\n| oltp_read_only               | 2.48     | 12.75    | 5.1      |\n| select_random_points         | 0.21     | 1.12     | 5.3      |\n| select_random_ranges         | 0.41     | 1.39     | 3.4      |\n| table_scan_postgres          | 17.95    | 132.49   | 7.4      |\n| types_table_scan_postgres    | 43.39    | 292.6    | 6.7      |\n| reads_mean_multiplier        |          |          | 6.3      |\n\n\n| Write Tests                  | Postgres | Doltgres | Multiple |\n|------------------------------|----------|----------|----------|\n| oltp_delete_insert_postgres  | 2.22     | 6.79     | 3.1      |\n| oltp_insert                  | 1.1      | 3.68     | 3.3      |\n| oltp_read_write              | 4.25     | 20.37    | 4.8      |\n| oltp_update_index            | 1.12     | 3.55     | 3.2      |\n| oltp_update_non_index        | 1.12     | 3.43     | 3.1      |\n| oltp_write_only              | 1.73     | 7.43     | 4.3      |\n| types_delete_insert_postgres | 2.3      | 7.04     | 3.1      |\n| write_mean_multiplier        |          |          | 3.6      |\n\n| Overall Mean Multiple | 5.2 |\n| --------------------- | --- |\n\n\u003c!-- END_LATENCY_RESULTS_TABLE --\u003e\n\u003cbr/\u003e\n\n# Correctness\n\nDolt is [100% compatible](https://docs.dolthub.com/sql-reference/benchmarks/correctness) with MySQL\nbased on a standard suite of correctness tests called `sqllogictest`.\n\nWe use these same tests to measure the correctness of DoltgreSQL.\n\nHere are DoltgreSQL's sqllogictest results for version `0.50.0`. Tests that did not run could not\ncomplete due to a timeout earlier in the run.\n\n\u003c!-- START_CORRECTNESS_RESULTS_TABLE --\u003e\n\n| Results     | Count   |\n| --          | --      |\n| did not run | 91270   |\n| not ok      | 411415  |\n| ok          | 5188604 |\n| timeout     | 16      |\n| Total Tests | 5691305 |\n\n| Correctness Percentage | 91.16721 |\n| --                     | --       |\n\n\u003c!-- END_CORRECTNESS_RESULTS_TABLE --\u003e\n\u003cbr/\u003e\n\n# Architecture\n\nDoltgres emulates a Postgres server, including parsing Postgres SQL into an Abstract Syntax Tree (AST). This AST is\nconverted to a form that can be interpreted by the Dolt engine. Doltgres uses the same SQL engine and storage format as Dolt.\n\n[Dolt has a unique architecture](https://docs.dolthub.com/architecture/architecture) that allows for version control\nfeatures at OLTP database performance. Doltgres uses the same architecture.\n","funding_links":["https://github.com/sponsors/dolthub"],"categories":["HarmonyOS","Go","git","\u003ca name=\"Go\"\u003e\u003c/a\u003eGo"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolthub%2Fdoltgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolthub%2Fdoltgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolthub%2Fdoltgresql/lists"}