pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses
4+ messages / 4 participants
[nested] [flat]

* BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses
@ 2022-07-14 14:49  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Bug reporting form @ 2022-07-14 14:49 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: doekman@icloud.com

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses
@ 2022-07-14 16:51  Francisco Olarte <folarte@peoplecall.com>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Francisco Olarte @ 2022-07-14 16:51 UTC (permalink / raw)
  To: doekman@icloud.com; pgsql-bugs@lists.postgresql.org

Doeke:
On Thu, 14 Jul 2022 at 17:04, PG Bug reporting form
<noreply@postgresql.org> wrote:
...

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

Asked and answered? I mean, you've already classified this as not a
bug but a wish, or a feature request.

Francisco Olarte.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses
@ 2022-07-14 18:02  David G. Johnston <david.g.johnston@gmail.com>
  parent: Francisco Olarte <folarte@peoplecall.com>
  0 siblings, 1 reply; 4+ messages in thread

From: David G. Johnston @ 2022-07-14 18:02 UTC (permalink / raw)
  To: Francisco Olarte <folarte@peoplecall.com>; +Cc: doekman@icloud.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>

On Thu, Jul 14, 2022 at 9:52 AM Francisco Olarte <folarte@peoplecall.com>
wrote:

> Doeke:
> On Thu, 14 Jul 2022 at 17:04, PG Bug reporting form
> <noreply@postgresql.org> wrote:
> ...
>
> > Anyways, the documentation about the inet-type could say it only accepts
> > normalized forms of addresses.
>
> Asked and answered? I mean, you've already classified this as not a
> bug but a wish, or a feature request.
>
>
I don't see it as unreasonable to claim the lack of documentation regarding
known alternative representations that could be accepted as input is a
bug.  The actual report isn't even asking for us to implement acceptance of
those formats, just make it clear when someone gets that error and checks
the docs that the error is valid.

David J.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses
@ 2022-07-14 18:24  Tom Lane <tgl@sss.pgh.pa.us>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2022-07-14 18:24 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Francisco Olarte <folarte@peoplecall.com>; doekman@icloud.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> I don't see it as unreasonable to claim the lack of documentation regarding
> known alternative representations that could be accepted as input is a
> bug.  The actual report isn't even asking for us to implement acceptance of
> those formats, just make it clear when someone gets that error and checks
> the docs that the error is valid.

Yeah.  I'm disinclined to loosen the input syntax rules, but the docs
could stand improvement I think.  Particularly since there are no
concrete examples in

https://www.postgresql.org/docs/current/datatype-net-types.html#DATATYPE-INET

but there are in the following section about CIDR --- and that type
*does* allow some forms of abbreviation.  It would not be unreasonable
to assume that INET does too.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2022-07-14 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 14:49 BUG #17550: inet type doesn't accept alternate notations of ipv4 addresses PG Bug reporting form <noreply@postgresql.org>
2022-07-14 16:51 ` Francisco Olarte <folarte@peoplecall.com>
2022-07-14 18:02   ` David G. Johnston <david.g.johnston@gmail.com>
2022-07-14 18:24     ` Tom Lane <tgl@sss.pgh.pa.us>

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