pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Keith Fiske <keith@omniti.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: Daniel O'Connor <darius@dons.net.au>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] BUG #9652: inet types don't support min/max
Date: Tue, 3 Jun 2014 15:46:45 -0400
Message-ID: <CAG1_KcATQQ7nUt2T555qO2EndpEDx-TN5LmXLCoTduipbX_9dQ@mail.gmail.com> (raw)
In-Reply-To: <20140603144824.GE1220@awork2.anarazel.de>
References: <20140321061735.28629.38477@wrigleys.postgresql.org>
	<CAJrrPGdeZpfTPR6EkGgM6A4bUG7BVVToXsMgqJ6rg7R1JRUPVg@mail.gmail.com>
	<CAG1_KcBcavTb2OUoGi1PrAVRs_x4r9afmBK9P0djJnB_3afy8w@mail.gmail.com>
	<CAJrrPGfLkPiET4KQQp7+JKhK6nuwHaiMyaoM4ozbUMaCNpOKpw@mail.gmail.com>
	<20140603095139.GK24145@awork2.anarazel.de>
	<12477.1401805486@sss.pgh.pa.us>
	<20140603142733.GD1220@awork2.anarazel.de>
	<12773.1401806273@sss.pgh.pa.us>
	<20140603144824.GE1220@awork2.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Tue, Jun 3, 2014 at 10:48 AM, Andres Freund <andres@2ndquadrant.com>
wrote:

> On 2014-06-03 10:37:53 -0400, Tom Lane wrote:
> > Andres Freund <andres@2ndquadrant.com> writes:
> > > On 2014-06-03 10:24:46 -0400, Tom Lane wrote:
> > >> Personally, I would wonder why the regression tests contain such a
> query
> > >> in the first place.  It seems like nothing but a major maintenance
> PITA.
> >
> > > I haven't added it, but it seems appropriate in that specific case. The
> > > number of leakproof functions should be fairly small and every addition
> > > should be carefully reviewed... I am e.g. not sure that it's a good
> idea
> > > to declare network_smaller/greater as leakproof - but it's hard to
> catch
> > > that on the basic of pg_proc.h alone.
> >
> > Meh.  I agree that new leakproof functions should be carefully reviewed,
> > but I have precisely zero faith that this regression test will contribute
> > to that.
>
> Well, I personally wouldn't have noticed that the OP's patch marked the
> new functions as leakproof without that test. At least not while looking
> at the patch. pg_proc.h is just too hard to read.
>
> > It hasn't even got a comment saying why changes here should
> > receive any scrutiny; moreover, it's not in a file where changes would be
> > likely to excite suspicion.  (Probably it should be in opr_sanity, if
> > we're going to have such a thing at all.)
>
> I don't object to moving it there.
>
> Greetings,
>
> Andres Freund
>
> --
>  Andres Freund                     http://www.2ndQuadrant.com/
>  PostgreSQL Development, 24x7 Support, Training & Services
>


Andres's changes on June 3rd to
https://github.com/postgres/postgres/commits/master/src/test/regress/expected/create_function_3.out
are causing patch v2 to fail for that regression test file.

postgres $ patch -p1 -i ../inet_agg_v2.patch
patching file src/backend/utils/adt/network.c
patching file src/include/catalog/pg_aggregate.h
patching file src/include/catalog/pg_proc.h
patching file src/include/utils/builtins.h
patching file src/test/regress/expected/create_function_3.out
Hunk #1 FAILED at 153.
1 out of 1 hunk FAILED -- saving rejects to file
src/test/regress/expected/create_function_3.out.rej
patching file src/test/regress/expected/inet.out
patching file src/test/regress/sql/inet.sql

Otherwise it applies without any issues to the latest HEAD. I built and
started a new instance, and I was able to test at least the basic min/max
functionality

keith=# create table test_inet (id serial, ipaddress inet);
CREATE TABLE
Time: 25.546 ms
keith=# insert into test_inet (ipaddress) values ('192.168.1.1');
INSERT 0 1
Time: 3.143 ms
keith=# insert into test_inet (ipaddress) values ('192.168.1.2');
INSERT 0 1
Time: 2.932 ms
keith=# insert into test_inet (ipaddress) values ('127.0.0.1');
INSERT 0 1
Time: 1.786 ms
keith=# select min(ipaddress) from test_inet;
    min
-----------
 127.0.0.1
(1 row)

Time: 3.371 ms
keith=# select max(ipaddress) from test_inet;
     max
-------------
 192.168.1.2
(1 row)

Time: 1.104 ms

--
Keith Fiske
Database Administrator
OmniTI Computer Consulting, Inc.
http://www.keithf4.com

view thread (30+ messages)  latest in thread

Message-ID: <CAG1_KcATQQ7nUt2T555qO2EndpEDx-TN5LmXLCoTduipbX_9dQ@mail.gmail.com>
Permalink:  ../CAG1_KcATQQ7nUt2T555qO2EndpEDx-TN5LmXLCoTduipbX_9dQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CAG1_KcATQQ7nUt2T555qO2EndpEDx-TN5LmXLCoTduipbX_9dQ@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: keith@omniti.com, andres@2ndquadrant.com, tgl@sss.pgh.pa.us, kommi.haribabu@gmail.com, darius@dons.net.au, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] BUG #9652: inet types don't support min/max
  In-Reply-To: <CAG1_KcATQQ7nUt2T555qO2EndpEDx-TN5LmXLCoTduipbX_9dQ@mail.gmail.com>
  References: <20140321061735.28629.38477@wrigleys.postgresql.org> <CAJrrPGdeZpfTPR6EkGgM6A4bUG7BVVToXsMgqJ6rg7R1JRUPVg@mail.gmail.com> <CAG1_KcBcavTb2OUoGi1PrAVRs_x4r9afmBK9P0djJnB_3afy8w@mail.gmail.com> <CAJrrPGfLkPiET4KQQp7+JKhK6nuwHaiMyaoM4ozbUMaCNpOKpw@mail.gmail.com> <20140603095139.GK24145@awork2.anarazel.de> <12477.1401805486@sss.pgh.pa.us> <20140603142733.GD1220@awork2.anarazel.de> <12773.1401806273@sss.pgh.pa.us> <20140603144824.GE1220@awork2.anarazel.de> <CAG1_KcATQQ7nUt2T555qO2EndpEDx-TN5LmXLCoTduipbX_9dQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox