create_tables.pgsql
changeset 15 1607f7b2dba9
parent 13 1d9bf63a86f7
child 20 55146c78b3fb
equal deleted inserted replaced
14:ebc9b864bc9a 15:1607f7b2dba9
    88       FROM users
    88       FROM users
    89            LEFT JOIN domains USING (gid);
    89            LEFT JOIN domains USING (gid);
    90 
    90 
    91 CREATE OR REPLACE VIEW dovecot_user AS
    91 CREATE OR REPLACE VIEW dovecot_user AS
    92     SELECT local_part || '@' || domains.domainname AS userid,
    92     SELECT local_part || '@' || domains.domainname AS userid,
    93            domains.domaindir || '/' || uid AS home, uid, gid
    93            uid, gid, domains.domaindir || '/' || uid AS home,
       
    94            '~/' || maillocation.maillocation AS mail
    94       FROM users
    95       FROM users
    95            LEFT JOIN domains USING (gid);
    96            LEFT JOIN domains USING (gid)
       
    97            LEFT JOIN maillocation USING (mid);
    96 
    98 
    97 CREATE OR REPLACE VIEW postfix_gid AS
    99 CREATE OR REPLACE VIEW postfix_gid AS
    98     SELECT gid, domainname
   100     SELECT gid, domainname
    99       FROM domains;
   101       FROM domains;
   100 
   102