December 2026

A database for every pull request. Who gets to read it?

“Is anyone using staging?” is a question with a remarkably short shelf life. By the time the second engineer has typed “yes,” the first may already have changed the schema.

On this particular Tuesday, Maya needs staging to reproduce a customer login bug. Ben needs it to test a migration that adds a uniqueness constraint to “customers.email”. Maya would like the database to remain exactly as it was when the bug occurred. Ben’s entire contribution to the morning is to alter it. They have been allocated one database and two perfectly reasonable jobs.

A database branch for each pull request would settle the matter. Maya keeps her bug. Ben gets his migration. Neither has to send the workplace message “Any idea how much longer?” with its customary, desperately insincere smiley face.

Ben opens his pull request. His build fails. This is the best thing that will happen to him all morning.

The duplicate that staging never had

The migration sailed through CI on its first attempt. The test fixtures contain twelve customers, all with different email addresses. Most were created by the same engineer on the same afternoon. As populations go, they are unusually well administered.

Production has had a less sheltered upbringing. Years ago, an import assigned the same email address to two accounts. When Ben tries to add the constraint to a branch containing those records, PostgreSQL quite reasonably objects. A uniqueness constraint has limited scope for diplomacy about the number two.

This is the appeal of the database branching capability AWS introduced in preview for Aurora PostgreSQL. A branch gets its own compute and read/write endpoint. It initially shares storage pages with its parent and records subsequent changes separately. Ben can modify those two records on his branch and retry the migration. Maya can carry on investigating. The customer retains both accounts and whatever opinion of the login system prompted the original support ticket.

The branch has earned its keep. Ben now knows that deploying his migration would fail. He learned this before the release window, while coffee was available and everyone concerned was wearing daytime clothes.

There is one more detail worth following. What, exactly, did the failed build print?

Who ran the query?

First, consider the phrase “the pull request gets a database.” A pull request has many admirable qualities. An identity of its own is generally supplied by someone else.

Ben opened the PR. An AWS identity acting on behalf of the pipeline created the branch. A runner needed a network path to its endpoint. The migration then connected as a PostgreSQL role with permission to alter the table. If the test harness also issues a diagnostic query, the role it uses, its privileges, and any applicable masking policies determine what comes back. Aurora branches inherit the parent’s connectivity settings, database users, roles, and dynamic masking policies.

There is a small, revealing exercise here for anyone designing the pipeline. AWS documents a policy that uses a “branch-owner” tag to restrict access to the identity that owns a branch. Look at two builds opened by different engineers and ask which identity AWS sees in each. If both builds present the same owner identity, the distinction between Ben’s PR and Maya’s exists in the CI interface. The ownership check sees the same caller twice.

Now bring in Jo, the reviewer. Jo has no database credentials. She has never connected to an Aurora endpoint. What she does have is a red cross next to Ben’s proposed migration and a button marked Details. Clicking it is part of her job.

The email address acquires a readership

In Ben’s pipeline, somebody once made a helpful improvement to the test harness. When a uniqueness check fails, it prints the offending value. This saves the engineer from having to reproduce the failure locally. It was an especially convenient feature back when all twelve customers were fictional.

Jo clicks Details. There is the migration name, the constraint and, on the next line, the customer’s email address.

Ask the database administrator whether Jo can read “customers.email” and the answer is no. Ask Jo to read the address aloud, and the answer may be rather more specific. Both have understood their permissions correctly. They are looking at different copies.

This is the point I’d linger over in an architecture review. Once the value reaches standard output, the audience for that copy is whoever can read the job log. A review of database grants could be meticulous, accurate, and entirely silent about Jo. The CI permissions could also be perfectly appropriate. Reviewers need to see why builds fail. The odd design decision was giving them a customer’s address as part of the explanation.

What Ben actually needed to know

Ben needs the migration name, the affected constraint, and confirmation that the existing data contains a duplicate. That is enough to stop the release and arrange a controlled investigation. The person responsible for resolving the two accounts may eventually need their details. Everyone reviewing Ben’s SQL can make considerable progress without them.

There is also a useful distinction between finding this case and keeping it. Production-derived data revealed something the fixtures had missed. Now that the team knows about the old import, two synthetic accounts sharing “duplicate@example.test” can preserve the case indefinitely. The next engineer gets the benefit of the customer’s peculiar history without requiring the customer’s continued participation.

Before declaring the problem fixed, I’d run the migration once more with that synthetic address. Make it fail on purpose. Then sit in Jo’s chair, click Details, and answer two questions. Can she tell what broke? Can she find “duplicate@example.test” anywhere in the output? That little rehearsal tests both the quality of the diagnostic and the discretion of the machinery that delivers it.

Aurora gives every database branch a time-to-live and deletes it when that time expires. The build log keeps the retention period configured in CI. It is worth checking both while Tuesday’s pull request is still open.

In the original version of Ben’s pipeline, the branch was gone by Friday. The customer’s email address was still in Tuesday’s build.