Hello,

we use a value -1 as two values: a) unknown typmod, b) unknown
location. Can we substitute it by some better identifier?

Maybe: UnknownTmod, UnknownLoc ... UnspecTmd, UnspecLoc???

Regards
Pavel Stehule

Search Discussions

  • Tom Lane at Nov 5, 2009 at 10:59 pm

    Pavel Stehule writes:
    we use a value -1 as two values: a) unknown typmod, b) unknown
    location. Can we substitute it by some better identifier?
    Maybe: UnknownTmod, UnknownLoc ... UnspecTmd, UnspecLoc???
    Doesn't really seem worth the trouble, especially since the checks
    for "unspecified" are coded as negative/nonnegative rather than
    simple equality.

    regards, tom lane
  • Pavel Stehule at Nov 6, 2009 at 5:18 am

    2009/11/5 Tom Lane <[email protected]>:
    Pavel Stehule <[email protected]> writes:
    we use a value -1 as two values: a) unknown typmod, b) unknown
    location. Can we substitute it by some better identifier?
    Maybe: UnknownTmod, UnknownLoc ... UnspecTmd, UnspecLoc???
    Doesn't really seem worth the trouble, especially since the checks
    for "unspecified" are coded as negative/nonnegative rather than
    simple equality.
    I worked on enhancing an area where typmod is used, and I had a small
    problem - because it wasn't simply clean, where -1 is typmod or
    location.

    This should be an idea for enhancing and increasing code quality. -1
    is probably last wide used magic constant in pg.

    Pavel

    regards, tom lane

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedNov 5, '09 at 10:17p
activeNov 6, '09 at 5:18a
posts3
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Pavel Stehule: 2 posts Tom Lane: 1 post

People

Translate

site design / logo © 2023 Grokbase