Re: int8 sequences --- small implementation problem

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: int8 sequences --- small implementation problem
Дата
Msg-id 009201c124d6$ed27bbd0$48d210ac@jecw2k1
обсуждение исходный текст
Ответ на Re: Surviving transaction-ID wraparound, take 2  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-hackers
> typedef struct FormData_pg_sequence
> {
> NameData sequence_name;
> int32 last_value;
> int32 increment_by;
> int32 max_value;
> int32 min_value;
> int32 cache_value;
> int32 log_cnt;
> char is_cycled;
> char is_called;
> } FormData_pg_sequence;
>
> If I just change "int32" to "int64" here, all is well on machines where
> sizeof(int64) is 8.  But if there's no 64-bit C datatype, int64 is
> typedef'd as "long int", so sizeof(int64) is only 4.  Result: the struct
> declaration won't agree with the heaptuple layout --- since the tuple
> routines will believe that the datatype of these columns has size 8.
>
> What I need is a way to pad the struct declaration so that it leaves
> 8 bytes per int64 column, no matter what.  I thought of
>

What if you defined int64 as a union made up of one "long int" member and
one 8 byte char member, and then always refer to the "long int"?

-- Joe




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

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: To be 7.1.3 or not to be 7.1.3?
Следующее
От: Reinhard Mueller
Дата:
Сообщение: Re: [gnue-geas] Re: Proposal: OID wraparound: summary and proposal