Skip to content

Deterministically shorten table and column names to 63 characters - #82

Merged
brycekbargar merged 8 commits into
library-data-platform:release-v5.0.0from
Five-Colleges-Incorporated:postgres-naming
Nov 11, 2026
Merged

brycekbargar merged 8 commits into
library-data-platform:release-v5.0.0from
Five-Colleges-Incorporated:postgres-naming

Conversation

@brycekbargar

Copy link
Copy Markdown
Collaborator

#79 was reported by the University of Bamberg. Their table prefixing scheme leads to a number of arbitrarily truncated identifiers, including some that cause collisions.

The approach taken here was to to try to

  1. Preserve backwards compatibility
  2. Preserve the human ability to interpret table names

To these ends only the intermediate portions of a table name, not the source or the array property are shortened. This is only applied to tables over the 63 character limit. The "full" table name is now being written to the catalog__t table for reference. Columns are less likely to be truncated but Five Colleges has a couple in Course Reserves. Only the final property name is preserved for Columns, the rest of the intermediate values or shortened incrementally to get to 63 characters. There is no record of the "full" name for columns.

While this PR actually does clean up one of the bigger code issues in the transformation code it introduces some tighter coupling to the behavior/semantics of postgres. This will have to be revisited when Oracle support is added.

@brycekbargar
brycekbargar merged commit 4c7e335 into library-data-platform:release-v5.0.0 Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant