Mailing List Archive

quote_pgsql and PostgreSQL 9.1.2
After upgrading to pgsql 9.1.2 from 8.4, I'm getting:
test\_underscore
from
'${quote_pgsql:${lc:$sender_address_local_part}}'
where sender_address_local_part is
test_underscore
Quote from
9.21 More about MySQL, PostgreSQL, Oracle, and InterBase:
"The quote_pgsql expansion operator, in addition, escapes the percent and underscore characters."
Why do we take percent and underscore special?
Is this a bug?

Axel
---
PGP-Key:29E99DD6 ☀ +49 151 2300 9283 ☀ computing @ chaos claudius


--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
Re: quote_pgsql and PostgreSQL 9.1.2 [ In reply to ]
On Fri, 2012-01-06 at 22:39 +0100, Axel Rau wrote:
> "The quote_pgsql expansion operator, in addition, escapes the percent
> and underscore characters."
> Why do we take percent and underscore special?

They're SQL wildcard characters - see
http://www.w3schools.com/sql/sql_wildcards.asp for instance.

> Is this a bug?

No, it's a necessary feature.

Regards,

Adam


--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
Re: quote_pgsql and PostgreSQL 9.1.2 [ In reply to ]
Am 06.01.2012 um 22:56 schrieb Adam D. Barratt:

> On Fri, 2012-01-06 at 22:39 +0100, Axel Rau wrote:
>> "The quote_pgsql expansion operator, in addition, escapes the percent
>> and underscore characters."
>> Why do we take percent and underscore special?
>
> They're SQL wildcard characters - see
> http://www.w3schools.com/sql/sql_wildcards.asp for instance.
Only in a LIKE or ILIKE clause.
>
>> Is this a bug?
>
> No, it's a necessary feature.
Quote continuing: "This cannot be done
for MySQL because these escapes are not recognized in contexts where these
characters are not special."
Seems to me, pgsql behaviour has changed with 9.x into same direction.

Axel
---
PGP-Key:29E99DD6 ☀ +49 151 2300 9283 ☀ computing @ chaos claudius


--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##