cluster() is not numeric-only, and the error already said so (#827 follow-up) - #832
Merged
OffgridwithJD merged 1 commit intoAug 29, 2026
Conversation
…ommandprompt#827 follow-up) COMMENT ON FUNCTION pgcolumnar.vacuum_sorted describes the alternative as "the numeric-only Z-order cluster()". That is wrong in both directions, and it is in the shipped v1.0-alpha2, in the full script and in the upgrade script, so \df+ prints it to a user today. cluster_type_supported() takes boolean, smallint, integer, bigint, real, double precision, date, timestamp and timestamptz. Several of those are not numeric. And numeric itself is absent: NUMERICOID appears nowhere in the file, so the one type the sentence names is precisely the one cluster() refuses. Measured rather than read, with a positive control so the deny arms are not vacuous: on a 20,000 row table, vacuum_sorted accepts numeric and text; cluster() accepts int, and rejects numeric with "column n of type numeric cannot be used as a clustering key" and text likewise. The extension already contradicted the sentence. A rejected column raises an errhint reading "Z-order clustering supports integer, date/time, boolean, and floating-point columns". A user who trips the gate is told the truth; a user who reads the catalog first is not. The comment now uses the errhint's wording, so the two agree and there is one description of this rule rather than two. The same sentence sat in src/columnar_vacuum.c as a code comment above pgcolumnar_vacuum_sorted. That is where the catalog string came from, so it is corrected too; leaving it would leave the input to the defect in place. The 1.0-alpha2 -> 1.0-alpha3 upgrade re-issues the comment, as set_options, expire, parallel_copy and sort_status already do in that script. That half is not optional. native_upgrade_converge hashes obj_description(p.oid,'pg_proc') for every function in the schema, so correcting only the full script makes a fresh install and an upgraded one disagree. Verified in that order: 8 of 8 on unmodified main; with only the full script corrected it FAILS on both the 1.0-alpha and 1.0-alpha2 paths; 8 of 8 again once the upgrade script carries it. The changelog entry that this branch used to carry has moved to the changelog branch. Both edited the same `### Fixed` section from different bases, so whichever merged first left the other conflicting, while GitHub reported both mergeable because it compares each against main rather than against the other. Nothing executes differently. Historical scripts and the alpha/alpha2 fixtures are faithful snapshots of what shipped and are left alone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KL9BxvtjERL34H1XV8BND2
OffgridwithJD
force-pushed
the
docs/827-cluster-is-not-numeric-only
branch
from
August 29, 2026 22:50
8414061 to
4cfa7bb
Compare
OffgridwithJD
pushed a commit
to OffgridwithJD/pgcolumnar
that referenced
this pull request
Aug 29, 2026
Seven defects were found and fixed for alpha3 and none of them reached CHANGELOG.md. Four of the seven are present in the shipped v1.0-alpha2, so a user deciding whether to upgrade could not learn about them from the one file written for that purpose. Each entry states plainly whether a released version is affected, because that is the part a reader acts on and it is not the same answer for all seven. Checked against the tag rather than assumed: affects v1.0-alpha2: commandprompt#838 index entries for live rows destroyed commandprompt#842 a backward fetch answered with forward rows commandprompt#844 an encoded NUL defeating the Iceberg traversal guard commandprompt#827 vacuum_sorted's comment calling cluster() numeric only, which \df+ prints this cycle only: commandprompt#834 Natts_options sized three stack arrays short commandprompt#836 the equality preimage at an infinity commandprompt#840 i128sum surviving a rescan For the second group the constants, the function and the field respectively do not exist at v1.0-alpha2, so no released version carries them. Saying so is useful rather than pedantic: an entry that does not distinguish the two invites a reader to go looking for a release that was never affected. The commandprompt#827 entry was previously carried by the branch behind commandprompt#832, which also changes the SQL scripts and a source comment. Both branches edited the same `### Fixed` section from different bases, so whichever merged first left the other conflicting, while GitHub reported both mergeable because it compares each against main and not against the other. The changelog now lives here alone and commandprompt#832 keeps only the code change. Each entry carries the measurement that established the defect, in the form the issue recorded it, so the entry can be checked rather than believed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KL9BxvtjERL34H1XV8BND2
Collaborator
Author
|
Force-pushed: rebased onto The reason is worth recording. This branch and the changelog branch both added to the So this branch is now the code change alone: the two SQL scripts and the source comment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation only. Nothing executes differently. Follow-up to the finding I left on
#827, which I had not filed.
Claiming this so it cannot collide with your bug sweep — it touches only the two
extension scripts, one code comment, and the CHANGELOG.
The defect
COMMENT ON FUNCTION pgcolumnar.vacuum_sortedcalls the alternative "thenumeric-only Z-order
cluster()". Wrong in both directions.cluster_type_supported()(src/columnar_vacuum.c) takesboolean,smallint,integer,bigint,real,double precision,date,timestampandtimestamptz. Several are not numeric. Andnumericitself is absent —NUMERICOIDappears nowhere in the file — so the one type the sentence names is precisely the one
cluster()refuses.The extension already contradicted it. A rejected column raises:
A user who trips the gate is told the truth. A user who reads the catalog first is
not. The comment now uses the errhint's own wording, so there is one description of
this rule instead of two that disagree.
This is user-facing:
COMMENT ON FUNCTIONlands inpg_descriptionand is what\df+prints — exactly where someone choosing betweenvacuum_sortedandcluster()looks.Measured, not read
A positive control is included so the deny arms are not vacuous. 20,000-row table,
PG 18:
vacuum_sorted('np','n')numericvacuum_sorted('np','t')textcluster('np','i')intcluster('np','n')numericcolumn "n" of type numeric cannot be used as a clustering keycluster('np','t')textThe error a user gets for
numericrefutes the word "numeric-only" on its own.Why the upgrade script is half the fix, and not optional
native_upgrade_convergehashesobj_description(p.oid,'pg_proc')for everyfunction in the schema. The
1.0-alpha2->1.0-alpha3script did not re-issue thiscomment, so correcting only the full script makes a fresh install and an upgraded one
disagree — and the suite says so. Run in this order:
native_upgrade_convergemain1.0-alphaand1.0-alpha2pathsThe middle row is the point: the gate catches the half-fix. Re-issuing in that script
is the established pattern —
set_options,expire,parallel_copyandsort_statusalready do it there. The upgrade copies the literal verbatim from thefull script, so the two cannot drift.
The third site
The same sentence sat in
src/columnar_vacuum.cabovepgcolumnar_vacuum_sorted.That is where the catalog string came from, so it is corrected too. Leaving it would
leave the input to the defect in place.
Left alone deliberately:
test/fixtures/pgcolumnar--1.0-alpha{,2}.sqlandpgcolumnar--1.0-alpha--1.0-alpha2.sqlare faithful snapshots of what shipped, andthe alpha2->alpha3 re-issue corrects the upgrade path anyway.
CHANGELOG.md:2422isa historical entry.
Gate
docs_stylenative_upgrade_convergeharness_selftestThose tallies are identical to
mainat808cd46measured on the same box today,which is how I know the change is inert.
The first gate run failed, and it is worth recording rather than quietly
re-running:
docs_stylereportedCHANGELOG.md carries no em or en dash: got [2] want [0]. Both dashes were mine, inthe entry above. The house rule is deliberate and documented in the suite. Fixed
before pushing, so this branch has never been red, but it would have been the first
thing CI told you.