Re: Column reordering in pg_dump

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Column reordering in pg_dump
Дата
Msg-id 20081125224007.GB27273@svana.org
обсуждение исходный текст
Ответ на Re: Column reordering in pg_dump  (Decibel! <decibel@decibel.org>)
Ответы Re: Column reordering in pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Robert Haas"
Дата:
Сообщение: Re: [Fwd: error compiling postgresql with fedora mingw]
Следующее
От: Tom Lane
Дата:
Сообщение: mingw doesn't like PGOPTIONS?