diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py
index b3dc8397914d8f0dc198f41a7d45059ff2100a54..b351a9ebc3a6d3c069b76d46b42acf3b19ba53a4 100644
--- a/product/ZSQLCatalog/SQLCatalog.py
+++ b/product/ZSQLCatalog/SQLCatalog.py
@@ -1739,7 +1739,7 @@ class Catalog(Folder,
         LOG('SQLCatalog', 100, 'Malformed related key definition: %r. Ignored.' % (entire_definition, ))
         continue
       related_key_id = split_entire_definition[0].strip()
-      if related_key_id in column_set:
+      if related_key_id in column_set and related_key_id in column_map:
         LOG('SQLCatalog', 100, 'Related key %r has the same name as an existing column on tables %r' % (related_key_id, column_map[related_key_id]))
       column_set.add(related_key_id)
     return column_set