New function - hostmask - Mailing list pgsql-patches

From greg
Subject New function - hostmask
Date
Msg-id 004401c2d32e$04a39160$683f5ec0@aarnetgw
Whole thread Raw
List pgsql-patches
Hi,

Have (by necessity) copied and altered the existing 'netmask' function
in postgresql to perform 'hostmask' style duties.

A diff against v7.3.2 is attached.

The patch affects three files:

  postgresql-7.3.2/doc/src/sgml/func.sgml - Updated list of network
functions with a simple example
  postgresql-7.3.2/src/backend/utils/adt/network.c - The bulk of the new
'hostmask' routine.
  postgresql-7.3.2/src/include/catalog/pg_proc.h - Addition of function
'hostmask' into pg_proc

Note that I arbitrarily chose 2311 as the OID (in pg_proc) as it was
unused (although not guaranteed to be the lowest unused value).

Would appreciate any feedback on this (first submission to postgresql
and all),

Cheers,

   -Greg

--


begin 666 postgres-hostmask.diff
M9&EF9B M<B M=2!P;W-T9W)E<W%L+3<N,RXR+6]R:6<O9&]C+W-R8R]S9VUL
M+V9U;F,N<V=M;"!P;W-T9W)E<W%L+3<N,RXR+V1O8R]S<F,O<V=M;"]F=6YC
M+G-G;6P*+2TM('!O<W1G<F5S<6PM-RXS+C(M;W)I9R]D;V,O<W)C+W-G;6PO
M9G5N8RYS9VUL"51H=2!*86X@,C,@,3(Z,C,Z,30@,C P,PHK*RL@<&]S=&=R
M97-Q;"TW+C,N,B]D;V,O<W)C+W-G;6PO9G5N8RYS9VUL"51H=2!&96(@,3,@
M,3<Z-3,Z,38@,C P,PI 0" M-#DY-"PV("LT.3DT+#$S($! "B )/&5N=')Y
M/CQL:71E<F%L/C(U-2XR-34N,C4U+C \+VQI=&5R86P^/"]E;G1R>3X*(" @
M(" @(" \+W)O=SX*(" @(" @(" \<F]W/@HK"3QE;G1R>3X\9G5N8W1I;VX^
M:&]S=&UA<VL\+V9U;F-T:6]N/B@\='EP93YI;F5T/"]T>7!E/BD\+V5N=')Y
M/@HK"3QE;G1R>3X\='EP93YI;F5T/"]T>7!E/CPO96YT<GD^"BL)/&5N=')Y
M/F-O;G-T<G5C="!H;W-T;6%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*" @
M8VED<@D)"0E01TY34"!01U5)1" Q,B!F(&8@="!F(&D@,2 V-3 @(C(U(B @
M=&5X=%]C:61R("T@7VYU;&Q?("DI.PI/;FQY(&EN('!O<W1G<F5S<6PM-RXS
G+C(O<W)C+VEN8VQU9&4O8V%T86QO9SH@<&=?<')O8RYH+F]R:6<*
`
end


pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: targetlist functions part 1 (was [HACKERS] targetlist
Next
From: Oliver Elphick
Date:
Subject: createuser - allow user cancel or kill to work