Re: data type for ip addresses
Posted in 2009
Hi, thanks for your bustling discussion. PostgreSQL offers data types for storing IPv4, IPv6, and MAC network addresses. These types offer input error checking and several specialized operators and functions. It would be great to have greater-than, less-than, between, and other comparison functions. Holger de Wall Carsten Haese schrieb: > Holger de Wall wrote: >> Hi, >> >> how can I create a data type that can store ip addresses (ipv4 and ipv6)? >> We use IDS 10.00 UC6 and 11.50 UC3. > > As plenty of responses have already pointed out, any sufficiently long > character field can *store* ipv4 and ipv6 addresses. > > However, the question is, beyond the mere storage and retrieval of such > animals, do you have any needs that you haven't mentioned? For example, > do you expect the field to reject invalid values? Do you expect to be > able to order results in this field in a particular way? Are you > expecting to perform comparisons on the values in this field? > > If the answer to any of those questions is Yes, a character field is > probably not the right choice for you. (The follow-up question of "What > *is* the right choice, then?" can only be answered depending on what > your actual expectations are.) > > HTH, > > -- > Carsten Haese > http://informixdb.sourceforge.net > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list > >