Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euLHZ-00044E-Je for pgsql-general@arkaria.postgresql.org; Fri, 09 Mar 2018 16:54:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1euLHY-00044q-4F for pgsql-general@arkaria.postgresql.org; Fri, 09 Mar 2018 16:54:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euLHX-0003zF-OY for pgsql-general@lists.postgresql.org; Fri, 09 Mar 2018 16:54:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euLHU-0008PI-C1 for pgsql-general@postgresql.org; Fri, 09 Mar 2018 16:54:10 +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 w29Gs62l026877; Fri, 9 Mar 2018 11:54:06 -0500 From: Tom Lane To: Herwin Weststrate cc: pgsql-general@postgresql.org Subject: Re: Feature request: min/max for macaddr type In-reply-to: <5f941094-8f6f-8bf3-5e48-3c72106d9ee2@quarantainenet.nl> References: <5f941094-8f6f-8bf3-5e48-3c72106d9ee2@quarantainenet.nl> Comments: In-reply-to Herwin Weststrate message dated "Fri, 09 Mar 2018 15:41:15 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26875.1520614446.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 09 Mar 2018 11:54:06 -0500 Message-ID: <26876.1520614446@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Herwin Weststrate writes: > ... I tried > adding some functions for macaddr_smaller/macaddr_larger to implement > the min/max. The code for it was very trivial, but then I got completely > lost in pg_proc.h/pg_aggregate.h. I fail to find the documentation for > this files as well, is there any reference I could use to finish my work= ? Well, you'd need two pg_proc entries for macaddr_smaller/macaddr_larger, and two more for the min and max aggregates, and then two pg_aggregate entries as well. Looking at the existing entries related to some other datatype (inet, perhaps) ought to let you move forward. However, if you're thinking of submitting a patch ... it's too late for any more feature submissions for v11, and I expect that by the time v12 opens, the bootstrap data representation will have changed, cf the discussion at https://www.postgresql.org/message-id/flat/CAJVSVGWO48JbbwXkJz_yBFyGYW-M9Y= WxnPdxJBUosDC9ou_F0Q@mail.gmail.com So, while you'll still need the same six new catalog entries, what you actually have to write is going to look completely different. You might want to stick this project on the back burner for a month or so, until that dust settles. regards, tom lane