Son Tran

14 commits

ST

Son Tran

@tbson

Software engineer loves to build things.

Commit activity

14 commits in the last 30 days

longest streak 2 dayscurrent 1

308 / 400 XP92 XP to maintainer

Today

I ran Bitwarden's database back through Schemity, and SQL Server stopped the script at line 983: "Constraint name '#Cols_pkey' not permitted." There is no table called #Cols. One of Bitwarden's 574 stored procedures creates it as a temporary table. Our import split the procedure…
Show thread

Fri, Oct 23

I rebuilt Invoice Ninja's database from the SQL Schemity wrote, and the copy accepted a company key "probe-key " right next to an existing "probe-key". The original refuses that. Its text columns use utf8mb4_unicode_ci, which ignores trailing spaces, so the two keys are…

Thu, Oct 22

I keep every diagram as a JSON file in Git. I have never reviewed a schema change by reading that diff. Most of its lines are positions, sizes and line paths. The one that matters, a new index or a CHECK, is buried among them. So when a pull request changes the schema, I paste…

Tue, Oct 20

I asked Postgres to turn a 0/1 integer flag into a boolean. It refused, and my USING clause was correct. The column still had DEFAULT 1. PostgreSQL converts the default on its own, without your USING expression, and an integer default has no way to become a boolean. Hence…
Show thread
A customer paid for Schemity and couldn't activate it. Their machine had internet, but Schemity's activation requests never reached our server. We still don't know why. They emailed us their device ID. We activated the license on our end and sent back a PowerShell snippet to set…
Name a Postgres unique constraint email_unique on two tables and the second fails: "relation already exists". Check names are per table; anything backed by an index is per schema. Constraint naming, tested on 18.3, on the Schemity blog.…
schemity.comPostgreSQL Constraint Naming Convention: Which Pattern to Use, and How to Find the Names That Drifted - SchemitySchemity's guide to naming Postgres constraints and indexes: the pattern to pick, the 63-byte cut that makes two names collide, and a query for stale names.
Constraints are per-table, indexes are per-schema. A UNIQUE constraint creates a matching index, so reusing the same name on a second table collides on the index → relation already exists. Fix: name constraints per table, e.g. customers_email_unique, users_email_unique.

Mon, Oct 19

Name a Postgres unique constraint email_unique on two tables and the second fails: "relation already exists". Check names are per table; anything backed by an index is per schema. Constraint naming, tested on 18.3, on the Schemity blog.…
schemity.comPostgreSQL Constraint Naming Convention: Which Pattern to Use, and How to Find the Names That Drifted - SchemitySchemity's guide to naming Postgres constraints and indexes: the pattern to pick, the 63-byte cut that makes two names collide, and a query for stale names.

That's @tbson's root commit.