pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Wire protocol encoding for 'inet' type is defined unreliably 2+ messages / 2 participants [nested] [flat]
* Wire protocol encoding for 'inet' type is defined unreliably @ 2015-03-25 22:33 Duncan Smith <Duncan@xrtc.net> 0 siblings, 1 reply; 2+ messages in thread From: Duncan Smith @ 2015-03-25 22:33 UTC (permalink / raw) To: pgsql-bugs Hi, I noticed today that the network encoding of the 'inet' type uses values derived from the system header file <sys/socket.h> to tag whether the address is IPv4 or IPv6. In particular, <src/include/utils/inet.h> defines PGSQL_AF_INET to be AF_INET, which is 2 on my system. Wouldn't it be better to use a more constant constant for this purpose? -- Duncan Smith -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Wire protocol encoding for 'inet' type is defined unreliably @ 2015-03-26 15:31 Tom Lane <tgl@sss.pgh.pa.us> parent: Duncan Smith <Duncan@xrtc.net> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2015-03-26 15:31 UTC (permalink / raw) To: Duncan Smith <Duncan@xrtc.net>; +Cc: pgsql-bugs Duncan Smith <Duncan@xrtc.net> writes: > I noticed today that the network encoding of the 'inet' type uses values > derived from the system header file <sys/socket.h> to tag whether the > address is IPv4 or IPv6. > In particular, <src/include/utils/inet.h> defines PGSQL_AF_INET to be > AF_INET, which is 2 on my system. Wouldn't it be better to use a more > constant constant for this purpose? Yeah, in a green field that would have been the thing to do, but at this point it's years too late to change it. If there are any platforms where AF_INET is different from 2, changing those constants would break both on-disk storage and binary-format dumps for them. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2015-03-26 15:31 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-03-25 22:33 Wire protocol encoding for 'inet' type is defined unreliably Duncan Smith <Duncan@xrtc.net> 2015-03-26 15:31 ` 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