Question about "name" datatype

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Question about "name" datatype
Дата
Msg-id 87u07co559.fsf@stark.xeocode.com
обсуждение исходный текст
Ответы Re: Question about "name" datatype  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
In c.h There is the following comment:

/** We want NameData to have length NAMEDATALEN and int alignment,* because that's how the data type 'name' is defined
inpg_type.* Use a union to make sure the compiler agrees.  Note that NAMEDATALEN* must be a multiple of sizeof(int),
elsesizeof(NameData) will probably* not come out equal to NAMEDATALEN.*/
 


And indeed in pg_type the typalign column says "i" for this data type. My
question is just, why? What would be the problem with an alignment of 1 for
"name"?

-- 
greg



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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Compression and on-disk sorting
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Updatable views/with check option parsing