Monday, November 27, 2017

Deleting Site Domains

Posted on 
  • Implemented gpdb_deleteSiteDomain
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).

But as we can also see a site may have multiple domains (e.g. Dallas has many).

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.

-- site_domain_map: Table to map multiple domains to sites
create table site_domain_map (
  id                number      (10)    not null,
  domain            varchar2    (256)   not null,
  ip_range_lower    varchar2    (15),
  ip_range_upper    varchar2    (15),
  foreign key (id) references sites (id)

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 "".

As if that is not enough a real problem come when one attempts to delete. Let's say somebody added a second "" Site Domain, notices the mistake and wants to delete the extra one.

Currently the code deletes site_domain_map entries using the following SQL statement:


This would delete both entries, not just one.

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 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!

No comments:

Post a Comment

Posted on  November 23, 2005 Continued to help several users with connecting to the new Controller Clearquest Database for Vinh...