Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000631.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: Deleting Site Domains</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000630.html" title="testcc.pl" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000632.html" title="Oracle limit clause" />
17
18    <!--
19 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
20          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
21          xmlns:dc="http://purl.org/dc/elements/1.1/">
22 <rdf:Description
23     rdf:about="http://defaria.com/blogs/Status/archives/000631.html"
24     trackback:ping="http://defaria.com/mt/mt-tb.cgi/20"
25     dc:title="Deleting Site Domains"
26     dc:identifier="http://defaria.com/blogs/Status/archives/000631.html"
27     dc:subject="Texas Instruments"
28     dc:description=" Implemented gpdb_deleteSiteDomain..."
29     dc:creator=""
30     dc:date="2007-04-13T21:44:25-06:00" />
31 </rdf:RDF>
32 -->
33
34
35    
36
37    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
38 </head>
39 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
40    <div id="container">
41       <div id="container-inner" class="pkg">
42
43          <div id="banner">
44             <div id="banner-inner" class="pkg">
45                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
46                <h2 id="banner-description">Searchable status reports and work log</h2>
47             </div>
48          </div>
49
50          <div id="pagebody">
51             <div id="pagebody-inner" class="pkg">
52                <div id="alpha">
53                   <div id="alpha-inner" class="pkg">
54
55                      <p class="content-nav">
56                         <a href="http://defaria.com/blogs/Status/archives/000630.html">&laquo; testcc.pl</a> |
57                         <a href="http://defaria.com/blogs/Status/">Main</a>
58                         | <a href="http://defaria.com/blogs/Status/archives/000632.html">Oracle limit clause &raquo;</a>
59                      </p>
60
61                      <a id="a000631"></a>
62                      <div class="entry" id="entry-631">
63                         <h3 class="entry-header">Deleting Site Domains</h3>
64                         <div class="entry-content">
65                            <div class="entry-body">
66                               <ul>
67   <li>Implemented gpdb_deleteSiteDomain</li>
68 </ul>
69                            </div>
70                            <div id="more" class="entry-more">
71                               <p>As we know, in GPDB there's very little in the realm of editing or validating of data. We've seen this with IP ranges where we let any old data in, including invalid IP ranges (let along the fact that the whole concept of IP ranges identifying sites is flawed to start with).</p>
72
73 <p>But as we can also see a site may have multiple domains (e.g. Dallas has many).</p>
74
75 <p>Site domains are implemented as their own table with the Site ID as the key and the "extended fields" of domain, IP range lower and upper being the data files.<p>
76
77 <div class=code><pre>
78 -- site_domain_map: Table to map multiple domains to sites
79 create table site_domain_map (
80   id                number      (10)    not null,
81   domain            varchar2    (256)   not null,
82   ip_range_lower    varchar2    (15),
83   ip_range_upper    varchar2    (15),
84   foreign key (id) references sites (id)
85 );
86 </pre></div>
87
88 <p>But nothing stops the user or worse yet, a script, from adding more than one site domain that is exactly identical! So we can have, for example, two site domains for Dallas that have the domain name of "dal.design.ti.com".</p>
89
90 <p>As if that is not enough a real problem come when one attempts to delete. Let's say somebody added a second "dal.design.ti.com" Site Domain, notices the mistake and wants to delete the extra one.</p>
91
92 <p>Currently the code deletes site_domain_map entries using the following SQL statement:</p>
93
94 <div class=code><pre>
95 DELETE FROM SITE_DOMAIN_MAP WHERE ID = 1000007 AND DOMAIN = 'dal.design.ti.com';
96 </pre></div>
97
98 <p>This would delete both dal.design.ti.com entries, not just one.</p>
99
100 <p>I think the answer is to implement some validation such that people cannot add a second Site Domain of the same Domain name. Of course, this leaves the question is it considered legal to have two dal.design.ti.com Site Domains with different IP ranges. Which brings up the idea of validating not only a single IP range, but that no IP ranges overlap!</p>
101
102                            </div>
103                         </div>
104                         <p class="entry-footer">
105                            <span class="post-footers">Posted by  on April 13, 2007  9:44 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000631.html">Permalink</a>
106                         </p>
107                      </div>
108
109                      
110                      <div class="trackbacks">
111                         <h3 id="trackback" class="trackbacks-header">TrackBack</h3>
112                         <div id="trackbacks-info">
113                            <p>TrackBack URL for this entry:<br />http://defaria.com/mt/mt-tb.cgi/20</p>
114                         </div>
115                         <div class="trackbacks-content">
116                            
117                         </div>
118                      </div>
119                      
120
121                      
122                   </div>
123                </div>
124             </div>
125          </div>
126       </div>
127    </div>
128 </body>
129 </html>