On Tue, Nov 25, 2008 at 03:10:30PM -0600, Decibel! wrote:
> IIRC the community did come to a consensus on allowing for a  
> different logical ordering from physical ordering, it was an issue of  
> actually doing the work. If this is an itch you want to scratch, you  
> might look into fixing that problem instead.

Err, as I recall it was decided that the chance for confusion was too
high.

http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg85548.html

However, it seems to me we could have "reasonably bulletproof or
machine-checkable way to keep the two kinds of column numbers
distinct", like so:

typedef struct { short log; } logical_pos;
typedef struct { short phys; } physical_pos;

This doesn't change the size of the objects, but the compiler will
prevent them from being assigned interchangably.

It does mean you need to use macros to access them, even if it's in a
loop. Fortunatly, we don't need to do too much arithmetic on them.

If the size of the object doesn't matter, you can do thing like typedef
a pointer to a one byte struct. Then most standard arithmetic
operations will still work (IIRC the Linux kernel uses this trick a
lot).

Have a nice day,
-- 
Martijn van Oosterhout   <[EMAIL PROTECTED]>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

Attachment: signature.asc
Description: Digital signature

Reply via email to