Network Address Types
Learn about network addresses and their types.
We'll cover the following...
Types for network addresses
PostgreSQL includes support for cidr
, inet
, and macaddr
data types. Again, those types are bundled with indexing support and advanced functions, and operator support.
The PostgreSQL documentation chapters entitled Network Address Types and Network Address Functions and Operators cover network address types.
Accessing data
Web server logs are a classic source of data to process, where we find network address types, and the website Honeynet has some free projects for us to play with. This time, we’re using the Scan 34 entry.
> Note: It’s an old project on Honeynet, which is not available now, but we’ve added the required files to the playground in the lesson.
Here’s how to load the sample dataset, once cleaned, into a proper CSV file:
begin;drop table if exists access_log;create table access_log(ip inet,ts timestamptz,request text,status integer);\copy access_log from '/usercode/access.csv' with csv delimiter ';'commit;
The script used to cleanse ...