Repository navigation
Branching and Synchronisation
KingresDB is released for PostgreSQL 18 and 19 from one source. This page explains the two product branches, how a change reaches the second one, how the project follows upstream PostgreSQL, and the register of changes to upstream files. The authorities are releases.md, upstream-sync.md and core-patches.md.
| Branch | PostgreSQL | What it is |
|---|---|---|
kingres-18 |
18 | Upstream tag REL_18_x (today REL_18_7), the core patches, and the KingresDB directories. Development happens here; it is the default branch |
kingres-19 |
19 | Upstream tag REL_19_x (today REL_19_0, PostgreSQL 19.0, merged on 2026-11-22), the same core patches, and the same KingresDB directories. It follows kingres-18 by sync commits and is never edited by hand inside those directories |
The KingresDB directories are contrib/kingres_* and kingres/. At every release they are byte for byte the same on both branches: git diff kingres-18 kingres-19 -- 'contrib/kingres_*' kingres prints nothing. kingres-18 is based on an upstream tag, not on the moving REL_18_STABLE tip, so every build is on a released upstream state. Feature branches are short-lived, start from kingres-18 and are merged through review.
- The change is made and committed on
kingres-18, and only when the suites of every extension it touches pass on both majors (kingres/dev/ext-majors.sh, see Testing Strategy). - A sync commit on
kingres-19takes the KingresDB directories fromkingres-18as they are at a named commit:git checkout <commit of kingres-18> -- 'contrib/kingres_*' kingres, with the messagesync from kingres-18 at <short hash>. Nothing is edited by hand onkingres-19inside those directories. A file that exists onkingres-19and no longer onkingres-18must be removed in the same commit: the checkout does not delete it, sogit rm -rthe paths first and then do the checkout. The diff command above must then print nothing beforekingres-19is pushed. - A core patch that changes is applied to
kingres-19as its own commit, with the register entry updated onkingres-18first.
kingres-19 is never rebased and never force-pushed by a sync.
Contributors branch from kingres-18 and never edit kingres-19 by hand (Contributing).
upstream-sync.md records the policy as [Recommendation] (the first release, 0.1.0, has been made; kingres-18 is on REL_18_7; kingres-19 merged REL_19_0 on 2026-11-22):
- Remote
upstreamis the PostgreSQL repository; mirror branches (proposed namesmirror/REL_18_STABLEandmirror/REL_19_STABLE) are fast-forward only and carry no KingresDB commits. - A new minor release is taken by rebasing:
git rebase --onto <new-tag> <old-tag> kingres-18. Upstream is never merged into the product branch. Each conflict is recorded in the work log with the core patch ID, because conflicts are the measure of whether the thin-fork policy works. - Before a rebase the register is reviewed: patches that upstream now provides are dropped and the rest are re-tested.
- After a rebase: a clean build with assertions; the upstream test suite (failures that also occur on the unmodified tag are reported upstream, not fixed locally); the extension regress and TAP suites with both build systems; the cluster tests;
pgindent --check; the Go and web suites if the interface changed; loading every extension to confirm thePG_MODULE_MAGICABI check; and a check that line endings stay LF. - A new major follows ADR 0023: work on the newest
REL_19_*tag in a scratch tree first; each interface difference goes into the extension'ssrc/pg_compat.h, not into the code that uses it; the core-patch series is applied in register order. A new major costs a new section in eachpg_compat.hand a test run on all majors, not a second code base. - Open items the document names: the hosting platform's branch protection, how long each major is maintained, the exact checks, and the numbering of KingresDB versions relative to PostgreSQL's. A cluster runs one major; moving a cluster between majors is not designed.
Rebasing rewrites commits; the policy says to announce each rebase in the work log and to force-push kingres-18 only for a rebase onto a new upstream tag, done by a maintainer. The history of both branches was rewritten once, on 2026-11-16, by decision of the project owner, to remove a machine-local path that two scripts carried in early commits. Commit ids noted before that date no longer exist; a clone made earlier must be made again. This is not a precedent: no branch is rewritten in ordinary work and nothing is rewritten after the first release is tagged. Any later rewrite needs the owner's explicit say-so. Pushing kingres-19 needs credentials that may write workflow files whenever the upstream workflow file changes, which happens when the branch moves to a new upstream tag.
Tags are for releases only. The first release, 0.1.0, was published on 2026-11-28 with the tags kingres-0.1.0-pg18 and kingres-0.1.0-pg19; no other tag exists, and upstream PostgreSQL tags are never pushed to the project repository. Release tags are kingres-<version>-pg18 and kingres-<version>-pg19 (Release Process).
GitHub Actions is off for the repository by decision of the project owner and no workflow of the project is published. PostgreSQL 19's own upstream workflow file (.github/workflows/pg-ci.yml) is part of the kingres-19 tree unchanged and does not run. Every check runs on a developer's machine and its result goes in the work log.
Core patches are changes to files that exist upstream, outside contrib/kingres_*. They are the most expensive code in the project because each is carried through every rebase.
Rules:
- Write an extension first; a core patch is allowed only when an extension cannot do the job, and the reason is recorded.
- One patch is one small commit (or a short ordered series) that does one thing.
- Each patch has the next free ID
KP-NNNN, never reused; the commit subject starts with the ID. - The register row is added in the same commit; a change to an upstream file without a row is rejected.
- Prefer adding a hook that could be offered upstream over embedding KingresDB logic in core.
- Every code patch has a regression or TAP test that fails without it.
- Upstream status is kept current (
local only,proposed,accepted in,rejected,obsolete since).
The register has four entries today:
| ID | File | Purpose |
|---|---|---|
| KP-0001 | meson.build |
Defines kingres_version and appends (KingresDB <version>) to the long version string; every PostgreSQL version symbol is unchanged |
| KP-0002 | README.md |
A short KingresDB section above the PostgreSQL README |
| KP-0003 | contrib/meson.build |
One subdir line per KingresDB extension |
| KP-0004 | LICENSE |
The text of the AGPL-3.0, the licence of KingresDB's own code |
KingresDB builds with meson only; the autoconf files are left as upstream ships them. Commit message format: KP-NNNN: summary, then Why, What, Tests and Upstream lines.
KingresDB's own code is licensed under AGPL-3.0-only. PostgreSQL code keeps the PostgreSQL License. Copyright of the project's own code: RooyeKhat Media Co. KingresDB is derived from PostgreSQL and is not endorsed by the PostgreSQL project. Repository | Licence | COPYRIGHT
KingresDB
1. Product
- Product Overview and Features
- Status and Roadmap
- User Guide
- Administrator Guide
- REST API Reference
- Web Console
- Command Line Client
- Extensions
- Limitations and Known Issues
- Release Notes
Features in detail
- Sharding
- Sharding Query Pushdown
- Sharding Table Lifecycle
- High Availability
- Ledger
- Ledger Signing and Publication
- Ledger Anchoring
- The Verifier
- Analytics Extensions
Administration
- Cluster Setup
- Servers Databases and Roles
- Rebalancing
- Configuration
- Memory and Warm-up
- Control Plane and REST API
- Upgrades
2. Architecture (arc42)
- Architecture
- Architecture Introduction and Goals
- Architecture Constraints
- Architecture System Context
- Architecture Containers
- Architecture Components
- Architecture Runtime Views Sharding
- Architecture Runtime Views Availability and Ledger
- Architecture Deployment
- Architecture Crosscutting Concepts
- Security Model
- Architecture Decisions
- Architecture Quality Requirements
- Architecture Risks and Technical Debt
- Enterprise Architecture
3. Data architecture
- Data Architecture
- Data Model Sharding
- Data Model Ledger
- Data Model System Database
- Data Model Analytics
- Data Lifecycle
- Backup Restore and PITR
- Data Security
- Data Quality and Integrity
4. Development
- Building from Source
- Development and Testing
- Repository Layout
- Coding Standards
- Branching and Synchronisation
- Testing Strategy
- Review Process
- Release Process
- Contributing
5. Operations