Re: column ordering, was Re: [PATCHES] Enums patch v2 - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: column ordering, was Re: [PATCHES] Enums patch v2
Date
Msg-id 20061220201712.GG12639@svana.org
Whole thread Raw
In response to Re: column ordering, was Re: [PATCHES] Enums patch v2  (Stephen Frost <sfrost@snowman.net>)
Responses Re: column ordering, was Re: [PATCHES] Enums patch v2
List pgsql-hackers
On Wed, Dec 20, 2006 at 09:15:05AM -0500, Stephen Frost wrote:
> > It doesn't really address the question of how you know which one to
> > use at any particular line of code; or even more to the point, what
> > mechanism will warn you if you use the wrong one.
>
> That'd be the point of doing the typing, you then declare functions as
> accepting the type and then if someone passes the wrong type to a
> function the compiler will complain.  Inside of a particular function it
> would hopefully be easier to keep it clear.  I'd think that most
> functions would deal with one type or the other (which would be declared
> in the arguments or in the local variables) and that functions which
> have to deal with both would be able to keep them straight.

I'm not sure how much you can do with typing. Things like heap_getattr
are macros, and thus untyped. Most places use attr as an index to an
array, which also can't be type checked.

If you switched everything over to inline functions you might get it to
work, but that's about it.

IMHO the best solution is to offset the logical numbers by some
constant...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: "Jim Nasby"
Date:
Subject: Re: Interface for pg_autovacuum
Next
From: Lukas Kahwe Smith
Date:
Subject: Re: Release 8.2.0 done, 8.3 development starts