pgsql/create_tables.pgsql
changeset 595 86b967c0f1a1
parent 550 867d950ce7b7
child 596 607aa5c2acc4
equal deleted inserted replaced
594:cdbe200c0ecc 595:86b967c0f1a1
   351               FROM users, service_set, domain_data
   351               FROM users, service_set, domain_data
   352              WHERE users.gid = (SELECT gid
   352              WHERE users.gid = (SELECT gid
   353                                   FROM domain_name
   353                                   FROM domain_name
   354                                  WHERE domainname = the_domain)
   354                                  WHERE domainname = the_domain)
   355                AND local_part = localpart
   355                AND local_part = localpart
   356                AND service_set.ssid = users.ssid
       
   357                AND users.gid = domain_data.gid
   356                AND users.gid = domain_data.gid
   358                AND CASE WHEN
   357                AND CASE WHEN
   359                   users.ssid IS NOT NULL
   358                   users.ssid IS NOT NULL
   360                   THEN
   359                   THEN
   361                     service_set.ssid = users.ssid
   360                     service_set.ssid = users.ssid