Skip to content

CODE_STYLE.md: prefer %TYPE over a hardcoded type for column mirrors - #9

Merged
jnasbyupgrade merged 2 commits into
Postgres-Extensions:mainfrom
jnasbyupgrade:prefer-type-reference
Aug 10, 2026
Merged

CODE_STYLE.md: prefer %TYPE over a hardcoded type for column mirrors#9
jnasbyupgrade merged 2 commits into
Postgres-Extensions:mainfrom
jnasbyupgrade:prefer-type-reference

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Documents preferring table.column%TYPE over a hardcoded type when a parameter/variable/column mirrors an existing column.
  • Notes not to "clean up" an existing %TYPE reference by replacing it with the literal type it currently resolves to.

Why

An agent working on Postgres-Extensions/test_factory#18 replaced an intentional %TYPE reference with a hardcoded type mid-PR. It was reverted in a later commit on that same PR. Documenting the convention here so other agents/engineers don't repeat it.

(NOTICE-noise handling from %TYPE/CREATE EXTENSION lives separately in Postgres-Extensions/ai#11 — assumed to merge before this one.)

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7a2008dd-9bdb-41c9-9880-a81c21cb2e66

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

An agent working on test_factory#18 replaced an intentional
tbl.col%TYPE reference with a hardcoded type, treating the resulting
"type reference ... converted to text" NOTICE as a bug rather than
expected behavior. Document the convention so it isn't repeated.
The client_min_messages behavior this NOTICE detail was explaining now
has its own section (see Postgres-Extensions#11); keep this section
focused on the %TYPE convention itself.
@jnasbyupgrade
jnasbyupgrade force-pushed the prefer-type-reference branch from 8a46d0b to 143a08a Compare August 10, 2026 23:15
@jnasbyupgrade
jnasbyupgrade merged commit fb66026 into Postgres-Extensions:main Aug 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant