Re: Addition to: Trouble with initdb when the #define NAMEDATALEN = 51 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Addition to: Trouble with initdb when the #define NAMEDATALEN = 51
Date
Msg-id 9785.989685332@sss.pgh.pa.us
Whole thread Raw
In response to Re: Addition to: Trouble with initdb when the #define NAMEDATALEN = 51  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-hackers
Lincoln Yeoh <lyeoh@pop.jaring.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


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Re: Addition to: Trouble with initdb when the #define NAMEDATALEN = 51
Next
From: Olivier PRENANT
Date:
Subject: Re: Bug or feature?