Re: Filter certain range of IP address.

From: Moreno Andreo <moreno(dot)andreo(at)evolu-s(dot)it>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Filter certain range of IP address.
Date: 2017-04-07 16:20:04
Message-ID: f119e6db-463d-9821-fad1-ed5e9a7b25cb@evolu-s.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Il 07/04/2017 17:56, Rick Otten ha
scritto:<br>
</div>
<blockquote
cite="mid:CAMAYy4K_SJPJgZ9trUmkJhjnyY7rac0JDCDzhdDYZbL0foW5Ag(at)mail(dot)gmail(dot)com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Apr 7, 2017 at 11:29 AM,
David G. Johnston <span dir="ltr">&lt;<a
moz-do-not-send="true"
href="mailto:david(dot)g(dot)johnston(at)gmail(dot)com" target="_blank">david(dot)g(dot)johnston(at)gmail(dot)com</a>&gt;</span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:arial,helvetica,sans-serif"><span
style="font-family:arial,sans-serif">On Fri, Apr 7,
2017 at 8:18 AM, Dinesh Chandra 12108 </span><span
dir="ltr" style="font-family:arial,sans-serif">&lt;<a
moz-do-not-send="true"
href="mailto:Dinesh(dot)Chandra(at)cyient(dot)com"
target="_blank">Dinesh(dot)Chandra(at)cyient(dot)com</a>&gt;</span><span
style="font-family:arial,sans-serif"> wrote:</span><br>
</div>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">Dear Vinny,<br>
<br>
Thanks for your valuable replay.<br>
<br>
but I need a select query, which select only that
record which starts from IP "172.23.110" only from
below table.<br>
<br>
xxx     172.23.110.175<br>
yyy     172.23.110.178<br>
zzz     172.23.110.177<br>
aaa     172.23.110.176<br>
bbb     172.23.111.180<br>
ccc     172.23.115.26<br>
</blockquote>
<div><br>
</div>
<div style="font-family:arial,helvetica,sans-serif">​SELECT
... WHERE substring(ip_addr::text, 1, 10) =
'172.23.110'</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div style="font-size:12.8px">or</div>
<div style="font-size:12.8px">   select ... where ip_addr
&lt;&lt; '172.23.110/32';</div>
</div>
</div>
</div>
</blockquote>
/32 is for one address only (fourth byte, which we want to exclude),
so we need to use /24 (as for CIDR notation), that would be equal to
a 255.255.255.0 subnet mask.<br>
<br>
My 2 cents<br>
Moreno<br>
<p><br>
</p>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 3.2 KB

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message vinny 2017-04-10 11:33:05 Re: Filter certain range of IP address.
Previous Message Dinesh Chandra 12108 2017-04-07 16:09:33 Re: Filter certain range of IP address.