Feature request: min/max for macaddr type

From: Herwin Weststrate <herwin(at)quarantainenet(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: Feature request: min/max for macaddr type
Date: 2018-03-09 14:41:15
Message-ID: 5f941094-8f6f-8bf3-5e48-3c72106d9ee2@quarantainenet.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andre Oliveira Freitas 2018-03-09 14:51:56 Re: Postgresql upgrade to 9.5.12/10.3 changes pg_dump format for cloning schemas
Previous Message David G. Johnston 2018-03-09 14:22:11 Re: Postgresql upgrade to 9.5.12/10.3 changes pg_dump format for cloning schemas