Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YV7CP-0003rp-MP for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2015 23:35:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YV7CP-0005yt-4x for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2015 23:35:01 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YV7CO-0005yn-1U for pgsql-hackers@postgresql.org; Mon, 09 Mar 2015 23:35:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YV7CK-0007oq-Ry for pgsql-hackers@postgresql.org; Mon, 09 Mar 2015 23:34:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t29NYfY0008621; Mon, 9 Mar 2015 19:34:41 -0400 From: Tom Lane To: Alvaro Herrera cc: Heikki Linnakangas , PostgreSQL-development Subject: Re: BRIN page type identifier In-reply-to: <20150309223505.GT3291@alvh.no-ip.org> References: <546A16EF.9070005@vmware.com> <20150309223505.GT3291@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Mon, 09 Mar 2015 19:35:05 -0300" Date: Mon, 09 Mar 2015 19:34:41 -0400 Message-ID: <8620.1425944081@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Alvaro Herrera writes: > I wonder if this is permissible and whether it will do the right thing > on 32-bit systems: > /* > * Special area of BRIN pages. > * > * We add some padding bytes to ensure that 'type' ends up in the last two > * bytes of the page, for consumption by pg_filedump and similar utilities. > * (Special space is MAXALIGN'ed). > */ > typedef struct BrinSpecialSpace > { > char padding[MAXALIGN(1) - 2 * sizeof(uint16)]; > uint16 flags; > uint16 type; > } BrinSpecialSpace; I should expect that to fail altogether on 32-bit machines, because the declared array size will be zero. You could try something like typedef struct BrinSpecialSpace { uint16 vector[MAXALIGN(1) / sizeof(uint16)]; } BrinSpecialSpace; and then some access macros to use the last and next-to-last elements of that array. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers