On Fri, Apr 3, 2015 at 1:17 PM, Stephen Frost <sfr...@snowman.net> wrote: >> but even I'm not willing to >> expend the amount of ink and emotional energy you have on whether a >> variable that holds +1, 0, or -1 ought to be declared as "int" or >> "int32". Does it matter? Yeah. Is it worth this much argument? No. > > My only comment will be on this very minor aspect (and I'm quite > agnostic as to what is decided, particularly as I haven't read the patch > at all), but, should we consider an enum (generically) for such cases? > If that's truly the extent of possible values, and anything else is an > error, then at least if I was writing DDL to support this, I'd use an > enum, maybe a domain, or a CHECK constraint (though I'd likely feel > better about the enum or domain approach).
It isn't the case that an enum can support it. Some comparators will return -5 rather than -1 (as with C-style comparators in general, sometimes comparisons can be implemented using subtraction and things like that). -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers