I l @ ve RuBoard |
PostgreSQL is unique among many SQL systems in that it includes built-in data types for network addresses. CIDR , INET , and MACADDR all represent specific aspects of network addresses. These data types can be particularly useful when using PostgreSQL as a back-end database to a web application. Storing network values in these data types is preferential due to the included functions in PostgreSQL that act on network-specific data types. CIDRDescriptionHolds dotted -quad data for an IP address and the number of bits in the netmask . This data type is named for the Classless Internet Domain Routing (CIDR) convention. Inputsx.x.x.x/y x.x.x. x ”Valid IP address. y ”Bits in the netmask. Storage Size12 bytes Example Data192.168.0.1/24 128.1 (128.1.0.0/16 assumed) 10 (10.0.0.0/8 assumed) NotesIf the bits from the netmask are omitted, the netmask bits are assumed by using the class of the dotted-quad (for example, 255.0.0.0 assumes 8, 255.255.0.0 assumes 16, 255.255.255.0 assumes 24, and so on). However, the assumption will be large enough to handle all the entries in the expressed octets. IPv6 is not yet supported. INETDescriptionHolds dotted-quad data for an IP address and an optional netmask. Inputsx.x.x.x/y x.x.x. x ”Valid IP address. y ”If given, a netmask; otherwise , a host is assumed. Storage Size12 bytes Example Data192.168.0.1 (192.168.0.1/32 is assumed) NotesThe difference between this and CIDR is that an INET can refer to a single host, whereas CIDR refers to an IP network. MACADDRDescriptionHolds a MAC address, which is an ethernet hardware address. InputsSeveral different formats are supported, such as the following xxxxxx:xxxxxx xxxxxx-xxxxxx xxxx.xxxx.xxxx xx-xx-xx-xx-xx-xx xx:xx:xx:xx:xx: xx (the default) Storage Size6 bytes Example DataBoth of these refer to the same MAC address: 08-00-2d-01-32-22 08002d:013222 NotesThe directory $SOURCE/ contrib /mac includes tools to identify the manufacturers of specific network cards from a given MAC address. (This directory is specific to Version 7.1 only.) |
I l @ ve RuBoard |