Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Question about "name" datatype


  • From: Greg Stark <gsstark(at)mit(dot)edu>
  • To: pgsql-hackers(at)postgresql(dot)org
  • Subject: Question about "name" datatype
  • Date: 26 May 2006 17:19:46 -0400
  • Message-id: <87u07co559(dot)fsf(at)stark(dot)xeocode(dot)com>

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 in pg_type.
 * Use a union to make sure the compiler agrees.  Note that NAMEDATALEN
 * must be a multiple of sizeof(int), else sizeof(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




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group