Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
Need help with Inet type - Mailing list pgsql-general
From
Eric Lamer
Subject
Need help with Inet type
Date
September 10, 2013
21:29:19
Msg-id
OF89EC909B.4B35626C-ON85257BE2.005C122D-85257BE2.005C1A8A@intact.net
Whole thread
Raw
Responses
Re: Need help with Inet type
Re: Need help with Inet type
List
pgsql-general
Tree view
Hi,
I would like to know if there is a way to do what I need with Postgress.
I have a table with logs and a table with a list of subnets.
Right now I do the following query in my table:
Select * From logs Where src_ip << '10.0.0.0/24' OR src_ip << '10.1.0.0/24' OR src_ip << '172.168.1.0/28';
I would like to simplify that query and use a table instead as the source of the subnet I want to check.
I have a table that contain a list of subnet and zone name:
ZONE_a 10.0.0.0/24
ZONE_a 10.1.0.0/24
ZONE_a 172.16.1.0/28
ZONE_b 10.2.0.0/24
ZONE_b 10.3.0.0/24
I can do something like:
Select * From logs Where src_ip IN (Select ip from ip_table where zone = 'ZONE_a');
Of course that does not work since it does not work with Inet type and I cannot use << because I have more than 1 row return from the second select.
Is there a way to achive that?
Thanks.
_______________________
Eric Lamer
IT Security Specialist
INTACT Financial Corporation
(450) 778-9580 ext. 3744
pgsql-general
by date:
Previous
From:
"Mahlon E. Smith"
Date:
10 September 2013, 21:07:39
Subject:
Re: Streaming replication slave crash
Next
From:
David Johnston
Date:
10 September 2013, 21:30:35
Subject:
Re: invalid frontend message type 136
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies