From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: doekman@icloud.com
Subject: BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses
Date: Thu, 14 Jul 2022 14:49:05 +0000
Message-ID: <17550-277c0ecd43597da9@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17550
Logged by: Doeke Zanstra
Email address: doekman@icloud.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, doekman@icloud.com
Subject: Re: BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses
In-Reply-To: <17550-277c0ecd43597da9@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox