Re: Addition to: Trouble with initdb when the #define NAMEDATALEN = 51

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: "G(dot) Anthony Reina" <reina(at)nsi(dot)edu>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Addition to: Trouble with initdb when the #define NAMEDATALEN = 51
Date: 2001-05-12 16:35:32
Message-ID: 9785.989685332@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my> writes:
> At 12:35 AM 5/12/01 -0400, Tom Lane wrote:
>> BTW, 51 is a gratuitously wasteful setting --- given alignment
>> considerations, any value that's not a multiple of 4 is pointless.
>> (It should work ... but it's pointless.)

> Would n^2-1 or n*8 -1 be better than n^2 or n*8?

No. There is a pad byte involved, but it's included in NAMEDATALEN
(ie, if you set it to 64, you really get names up to 63 characters).
You want NAMEDATALEN itself to be a round number, since if it's not
the following byte(s) will just be wasted for alignment padding anyway.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Olivier PRENANT 2001-05-12 16:36:59 Re: Bug or feature?
Previous Message mlw 2001-05-12 15:19:43 SET variables