Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YVB14-0004Eh-K6 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Mar 2015 03:39:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YVB14-0005Xa-4v for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Mar 2015 03:39:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YVB13-0005XU-7C for pgsql-hackers@postgresql.org; Tue, 10 Mar 2015 03:39:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YVB0v-0006Po-9D for pgsql-hackers@postgresql.org; Tue, 10 Mar 2015 03:39:32 +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 t2A3dBsf014067; Mon, 9 Mar 2015 23:39:11 -0400 From: Tom Lane To: Alvaro Herrera cc: Heikki Linnakangas , PostgreSQL-development Subject: Re: BRIN page type identifier In-reply-to: <8620.1425944081@sss.pgh.pa.us> References: <546A16EF.9070005@vmware.com> <20150309223505.GT3291@alvh.no-ip.org> <8620.1425944081@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 09 Mar 2015 19:34:41 -0400" Date: Mon, 09 Mar 2015 23:39:11 -0400 Message-ID: <14066.1425958751@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 I wrote: > 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. On second thought, consider typedef struct BrinSpecialSpace { uint16 flags; uint16 vector[MAXALIGN(1) / sizeof(uint16) - 1]; } BrinSpecialSpace; This way, accesses to "flags" require no source code changes. You still need a macro to map "type" onto the last element of the vector, but there's probably about one reference to "type" in the source code so it shouldn't be too painful. 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