OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: trouble using SQL like command in mysql query for map access

From: Wietse Venema (wietseporcupine.org)
Date: Sat Aug 09 2008 - 18:15:17 CDT


Arnaud JAYET:
[ Charset ISO-8859-15 unsupported, converting... ]
> Hello,
>
> i set up a transport map with mysql backend but when i try use the SQL
> like command in the WHERE clause i've got an db_common_parse error :
>
> postmap -q 'arnauddomain.tld' mysql:/etc/postfix/mysql_transport.cf
>
> postmap: fatal: db_common_parse: /etc/postfix/mysql_transpor.cf: Invalid
> query template: SELECT transport FROM users WHERE mail='%s' AND l3id
> like 'P\%'
>
> the query used in mysql_transport.cf :
> query = SELECT transport FROM users WHERE mail='%s' AND l3id like 'P%'
>
>
> Does postfix confuse the % character of the like command with the % for
> a variable subsitution (%s) so like command can't be used in the SQL
> query or is there a tip to avoid this ?

man mysql_table.