BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: doekman(at)icloud(dot)com
Subject: BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses
Date: 2022-07-14 14:49:05
Message-ID: 17550-277c0ecd43597da9@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17550
Logged by: Doeke Zanstra
Email address: doekman(at)icloud(dot)com
PostgreSQL version: 13.7
Operating system: MacOS Monterey
Description:

When I use the following strings as value for inet-type fields, I get the
error "ERROR: invalid input syntax for type inet" for the first three
insert statements.

create table e (id serial primary key, ip_addr inet not null);
insert into e(ip_addr) values ('127.1'); -- short syntax for 127.0.0.1
insert into e(ip_addr) values ('3232281089'); -- integer version of
192.168.178.1
insert into e(ip_addr) values ('0xc0a8b201'); -- hex version of
192.168.178.1
insert into e(ip_addr) values ('192.168.178.1'); -- this one does work

The alternate syntax does work in Safari, and on command line utilities like
ping.
And if memory serves well, it worked in InternetExplorer 5.5 on Windows 2000
back in 2002.

Anyways, the documentation about the inet-type could say it only accepts
normalized forms of addresses.

The wikipedia has some info on this:

https://en.wikipedia.org/wiki/IPv4#Address_representations

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Johansen 2022-07-14 16:51:39 Re: Auto-vacuum timing out and preventing connections
Previous Message hubert depesz lubaczewski 2022-07-14 11:51:55 Excessive number of replication slots for 12->14 logical replication