On Thu, May 23, 2019 at 10:21 AM Peter Eisentraut <peter.eisentr...@2ndquadrant.com> wrote: > Hmm, by that argument, we shouldn't ever use any integer type other than > int16, int32, and int64.
I think we basically shouldn't. I mean it's fine to use 'int' as a flags argument as part of an internal API, or as a loop counter private to a function or something. But if you are passing around values that involve on-disk compatibility or wire protocol compatibility, it's just a recipe for bugs. If the code has to sometimes cast a value to some other type, somebody may do it wrong. If there's a uniform rule that tuple counts are always int64, that's pretty easy to understand. In short, when a certain kind of value is widely-used, it should have a clearly-declared width. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company