[Home]

Summary:ASTERISK-27283: Realtime config fail with PostgreSQL version before 9.1
Reporter:Rodrigo Ramirez Norambuena (roramirez)Labels:
Date Opened:2017-09-20 21:16:23Date Closed:2017-09-22 05:34:04
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Resources/res_config_pgsql
Versions:Frequency of
Occurrence
Related
Issues:
is related toASTERISK-26057 res_config_sqlite3 uses incorrect query - unnecessary escape
Environment:Linux PostgreSQL 8.4.21 on i486-pc-linux-gnu, compiled by GCC gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 32-bit Attachments:
Description:When is used a previous version of PostgreSQL than 9.1 the realtime fail because the is need double backslash to use ESCAPE


Log

Using `queue show`

{code}
[Sep 19 08:48:19] DEBUG[15708]: res_config_pgsql.c:227 pgsql_exec: PostgreSQL query attempt 1
[Sep 19 08:48:19] ERROR[15708]: res_config_pgsql.c:165 _pgsql_exec: PostgreSQL RealTime: Failed to query 'queues@asterisk'.
[Sep 19 08:48:19] ERROR[15708]: res_config_pgsql.c:166 _pgsql_exec: PostgreSQL RealTime: Query Failed: SELECT * FROM queues WHERE name LIKE '%' ESCAPE '\' ORDER BY name
[Sep 19 08:48:19] ERROR[15708]: res_config_pgsql.c:167 _pgsql_exec: PostgreSQL RealTime: Query Failed because: ERROR:  unterminated quoted string at or near «'\' ORDER BY name»
LINE 1: SELECT * FROM queues WHERE name LIKE '%' ESCAPE '\' ORDER BY...
                                                       ^
(PGRES_FATAL_ERROR)
[Sep 19 08:48:19] DEBUG[15708]: res_config_pgsql.c:227 pgsql_exec: PostgreSQL query attempt 1
[Sep 19 08:48:19] DEBUG[15708]: res_config_pgsql.c:183 _pgsql_exec: PostgreSQL query successful: SELECT * FROM queues WHERE name = 'queue_test'
[Sep 19 08:48:19] DEBUG[15708]: res_config_pgsql.c:481 realtime_pgsql: PostgreSQL RealTime: Result=0x939dbe0 Query: SELECT * FROM queues WHERE name = 'queue_test'
[Sep 19 08:48:19] DEBUG[15708]: res_config_pgsql.c:489 realtime_pgsql: PostgreSQL RealTime: Found 1 rows.
[Sep 19 08:48:19] DEBUG[15708]: res_config_pgsql.c:227 pgsql_exec: PostgreSQL query attempt 1
[Sep 19 08:48:19] ERROR[15708]: res_config_pgsql.c:165 _pgsql_exec: PostgreSQL RealTime: Failed to query 'queue_members@asterisk'.
[Sep 19 08:48:19] ERROR[15708]: res_config_pgsql.c:166 _pgsql_exec: PostgreSQL RealTime: Query Failed: SELECT * FROM queue_members WHERE interface LIKE '%' ESCAPE '\' AND queue_name = 'queue_test' ORDER BY interface
[Sep 19 08:48:19] ERROR[15708]: res_config_pgsql.c:167 _pgsql_exec: PostgreSQL RealTime: Query Failed because: ERROR: syntax error at or near «queue_test»
LINE 1: ...E interface LIKE '%' ESCAPE '\' AND queue_name = 'queue_test' ORDE...
                                                            ^
(PGRES_FATAL_ERROR)
{code}



Comments:By: Asterisk Team (asteriskteam) 2017-09-20 21:16:24.660-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Friendly Automation (friendly-automation) 2017-09-22 05:34:05.757-0500

Change 6558 merged by Jenkins2:
res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1

[https://gerrit.asterisk.org/6558|https://gerrit.asterisk.org/6558]

By: Friendly Automation (friendly-automation) 2017-09-22 05:44:59.793-0500

Change 6552 merged by Joshua Colp:
res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1

[https://gerrit.asterisk.org/6552|https://gerrit.asterisk.org/6552]

By: Friendly Automation (friendly-automation) 2017-09-22 05:51:29.037-0500

Change 6559 merged by Joshua Colp:
res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1

[https://gerrit.asterisk.org/6559|https://gerrit.asterisk.org/6559]

By: Friendly Automation (friendly-automation) 2017-09-22 05:51:43.509-0500

Change 6560 merged by Joshua Colp:
res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1

[https://gerrit.asterisk.org/6560|https://gerrit.asterisk.org/6560]

By: Friendly Automation (friendly-automation) 2017-09-25 08:13:38.777-0500

Change 6563 merged by Joshua Colp:
res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1

[https://gerrit.asterisk.org/6563|https://gerrit.asterisk.org/6563]