<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>INET &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/inet/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 08 Dec 2016 17:56:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>PostgreSQL: Network Address Type &#8211; INET to IP Addresses (IPv4, IPv6)</title>
		<link>https://www.dbrnd.com/2016/12/postgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 07 Dec 2016 17:56:05 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[INET]]></category>
		<category><![CDATA[INET Data type]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[mac address]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4004</guid>

					<description><![CDATA[PostgreSQL provides Network Address related data types for storing information like IP Addresses, Mac Addresses. If you are planning to store the IP Address in PostgreSQL Database, you should declare the INET data type for that column. Internally, It checks the format of data so you cannot insert invalid format of data. The input format [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address%2F&amp;linkname=PostgreSQL%3A%20Network%20Address%20Type%20%E2%80%93%20INET%20to%20IP%20Addresses%20%28IPv4%2C%20IPv6%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address%2F&amp;linkname=PostgreSQL%3A%20Network%20Address%20Type%20%E2%80%93%20INET%20to%20IP%20Addresses%20%28IPv4%2C%20IPv6%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address%2F&amp;linkname=PostgreSQL%3A%20Network%20Address%20Type%20%E2%80%93%20INET%20to%20IP%20Addresses%20%28IPv4%2C%20IPv6%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address%2F&amp;linkname=PostgreSQL%3A%20Network%20Address%20Type%20%E2%80%93%20INET%20to%20IP%20Addresses%20%28IPv4%2C%20IPv6%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address%2F&amp;linkname=PostgreSQL%3A%20Network%20Address%20Type%20%E2%80%93%20INET%20to%20IP%20Addresses%20%28IPv4%2C%20IPv6%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address%2F&amp;linkname=PostgreSQL%3A%20Network%20Address%20Type%20%E2%80%93%20INET%20to%20IP%20Addresses%20%28IPv4%2C%20IPv6%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address%2F&#038;title=PostgreSQL%3A%20Network%20Address%20Type%20%E2%80%93%20INET%20to%20IP%20Addresses%20%28IPv4%2C%20IPv6%29" data-a2a-url="https://www.dbrnd.com/2016/12/postgresql-network-address-type-inet-to-ip-addresses-ipv4-ipv6-mac-address/" data-a2a-title="PostgreSQL: Network Address Type – INET to IP Addresses (IPv4, IPv6)"></a></p><p>PostgreSQL provides Network Address related data types for storing information like IP Addresses, Mac Addresses. </p>
<blockquote><p>If you are planning to store the IP Address in PostgreSQL Database, you should declare the INET data type for that column.<br />
Internally, It checks the format of data so you cannot insert invalid format of data. </p></blockquote>
<blockquote><p>The input format for this type is address/y where address is an IPv4 or IPv6 address and y is the number of bits in the netmask.<br />
If the /y portion is missing, the netmask is 32 for IPv4 and 128 for IPv6, so the value represents just a single host.</p></blockquote>
<p><strong>Small Demonstration:</strong><br />
<strong>Create a sample table:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_TestNetworkDataType
(
	ID INT
	,MyIPAddress INET
	,MyMACAddress MACADDR
);</pre> </p>
<p><strong>Insert few sample Network related records:</strong></p>
<pre class="crayon-plain-tag">INSERT INTO tbl_TestNetworkDataType
VALUES 
(1,'10.0.2.8/16','08008b:010803')
,(2,'192.168.1.0/24','08:00:2b:01:02:03')
,(3,'150.155.124.0/32','0800.2b01.0203')
,(4,'08.26/16','08002b:010203');</pre> </p>
<p><strong>Check the inserted data:</strong></p>
<pre class="crayon-plain-tag">SELECT *FROM tbl_TestNetworkDataType;

 id |  myipaddress   |   mymacaddress
----+----------------+-------------------
  1 | 10.0.2.8/16    | 08:00:8b:01:08:03
  2 | 192.168.1.0/24 | 08:00:2b:01:02:03
  3 | 150.155.124.0  | 08:00:2b:01:02:03
  4 | 8.26.0.0/16    | 08:00:2b:01:02:03</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
