私はpostgresql 8.3データベースを使用しています。以下のクエリで間違いがどこにあるかを把握しようとしています。プライベート アドレスである source_ips と destination_ips のみを選択するクエリを設計しようとしています。
何らかの理由で、以下のクエリで取得されたアドレスの 1 つは、プライベート アドレスではないアドレス 208.117.252.39 です。
パブリック IP アドレスも選択する以下のクエリのロジックに何か問題がありますか?
select source_ip, destination_ip
from ip_table
where
(
inet '10/8' >> source_ip
or inet '192.168/16' >> source_ip
or source_ip >= inet '172.16/16' and source_ip < inet '172.32/16'
)
and inet '10/8' >> destination_ip
or inet '192.168/16' >> destination_ip