I suggest one more standard date/time operator, to divide one interval
by another with numeric (or float, for example) result.
I.e. something like that:
database=# SELECT '5400 seconds'::interval / '1 hour'::interval;
?column?
--
1.5
(1 row)
Ilya A. Kovalenko
next_ip;
where, peer_ranges is:
CREATE TABLE peer_ranges
( group_id bigint NOT NULL REFERENCES peer_groups (id),
first inet NOT NULL UNIQUE,
next inet NOT NULL UNIQUE,
last inet NOT NULL UNIQUE
);
Thank you,
Ilya A. Kovalenko (mailto:[EMAIL PROTECTED
(inet, integer, int2)RETURNS inet
FUNCTION replace_dword(inet, integer, int4)RETURNS inet
FUNCTION replace_qword(inet, integer, int8)RETURNS inet
(not established with signed 'int%')
/disclaimer
Ilya A. Kovalenko
---(end of broadcast
GS I see a use case for of generating addresses based on a sequence or some
GS primary key from the database.
GS Something like
GS CREATE SEQUENCE hosts_ip_seq MAXVALUE 65536;
GS ALTER TABLE hosts ALTER ip SET DEFAULT '10.0.0.0/16'::inet +
nextval(hosts_ip_seq')
hmm, not quite good idea -
);
}
}
// Return result
VARATT_SIZEP(dst) = VARHDRSZ
+ ((char *) ip_addr(dst) - (char *) VARDATA(dst))
+ ip_addrsize(dst);
PG_RETURN_INET_P(dst);
}
-
Thank you
Ilya A. Kovalenko (mailto:[EMAIL PROTECTED
oops
- FUNCTION inet_inc(int, int8) RETURNS inet
+ FUNCTION inet_inc(inet, int8) RETURNS inet
---(end of broadcast)---
TIP 8: explain analyze is your friend