summaryrefslogtreecommitdiff
path: root/contrib/pg_trgm
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-03-04 10:34:25 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-03-04 10:34:25 -0500
commit3ed2005ff595d349276e5b2edeca1a8100b08c87 (patch)
tree361ca1ffdc3e816c98d45a0357c92d25ba71d760 /contrib/pg_trgm
parent0ad6f848eef267489d4aee7306c16f96454b7a64 (diff)
downloadpostgresql-3ed2005ff595d349276e5b2edeca1a8100b08c87.tar.gz
Introduce macros for typalign and typstorage constants.
Our usual practice for "poor man's enum" catalog columns is to define macros for the possible values and use those, not literal constants, in C code. But for some reason lost in the mists of time, this was never done for typalign/attalign or typstorage/attstorage. It's never too late to make it better though, so let's do that. The reason I got interested in this right now is the need to duplicate some uses of the TYPSTORAGE constants in an upcoming ALTER TYPE patch. But in general, this sort of change aids greppability and readability, so it's a good idea even without any specific motivation. I may have missed a few places that could be converted, and it's even more likely that pending patches will re-introduce some hard-coded references. But that's not fatal --- there's no expectation that we'd actually change any of these values. We can clean up stragglers over time. Discussion: https://postgr.es/m/16457.1583189537@sss.pgh.pa.us
Diffstat (limited to 'contrib/pg_trgm')
-rw-r--r--contrib/pg_trgm/trgm_op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/pg_trgm/trgm_op.c b/contrib/pg_trgm/trgm_op.c
index 0670095c20..fb38135f7a 100644
--- a/contrib/pg_trgm/trgm_op.c
+++ b/contrib/pg_trgm/trgm_op.c
@@ -980,7 +980,7 @@ show_trgm(PG_FUNCTION_ARGS)
TEXTOID,
-1,
false,
- 'i');
+ TYPALIGN_INT);
for (i = 0; i < ARRNELEM(trg); i++)
pfree(DatumGetPointer(d[i]));