Feature request: min/max for macaddr type - Mailing list pgsql-general

From Herwin Weststrate
Subject Feature request: min/max for macaddr type
Date
Msg-id 5f941094-8f6f-8bf3-5e48-3c72106d9ee2@quarantainenet.nl
Whole thread Raw
Responses Re: Feature request: min/max for macaddr type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
My use case: I was writing some tests where I just needed some inets and
macaddrs in a database table with certain properties. I tried to use the
following queries:

INSERT INTO inet_table (inet, ..) VALUES ((SELECT max(inet) + 1 FROM
inet_table), ...);
INSERT INTO macaddr_table (macaddr, ...) VALUES ((SELECT max(macaddr) +
1 FROM macaddr_table), ...);

This works fine for the inet type, but the macaddr failed this. 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?

-- 
Herwin Weststrate



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Postgresql upgrade to 9.5.12/10.3 changes pg_dump format forcloning schemas
Next
From: Andre Oliveira Freitas
Date:
Subject: Re: Postgresql upgrade to 9.5.12/10.3 changes pg_dump format forcloning schemas