Question about "name" datatype - Mailing list pgsql-hackers

From Greg Stark
Subject Question about "name" datatype
Date
Msg-id 87u07co559.fsf@stark.xeocode.com
Whole thread Raw
Responses Re: Question about "name" datatype
List 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 by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Compression and on-disk sorting
Next
From: Peter Eisentraut
Date:
Subject: Re: Updatable views/with check option parsing