#126 sql queries not pgsql compliant

closed-accepted
nobody
None
5
2009-03-23
2009-03-19
Munroe Sollog
No

pgsql_virtual_alias_domain_maps.cf
pgsql_virtual_mailbox_maps.cf

These files contain the "CONCAT" function that make psql unahppy. I updated each query to this:

pgsql_virtual_alias_domain_maps.cf

query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = '%u' || '@' || alias_domain.target_domain AND alias.active = 1

pgsql_virtual_mailbox_maps.cf

query = SELECT domain || '/' || maildir FROM mailbox WHERE username='%s' AND active = '1'

That seemed to fix the problem, but I would hope some one else could check my work.

Discussion

  • GingerDog
    GingerDog
    2009-03-23

    Use of || is fine (in my book) within PostgreSQL. Unfortunately it appears MySQL sometimes treats || as OR instead of what the SQL spec says (non-strict mode perhaps?)

    I've updated POSTFIX-CONF.txt in DOCUMENTS/ to tell people what to do. See changeset 600.

     
  • GingerDog
    GingerDog
    2009-03-23

    • status: open --> closed-accepted