[asterisk-bugs] [JIRA] (ASTERISK-28571) cdr_pgsql: accesses obsolete (and finally removed) column

Asterisk Team (JIRA) noreply at issues.asterisk.org
Mon Oct 7 08:55:48 CDT 2019


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=248266#comment-248266 ] 

Asterisk Team commented on ASTERISK-28571:
------------------------------------------

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].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

> cdr_pgsql: accesses obsolete (and finally removed) column
> ---------------------------------------------------------
>
>                 Key: ASTERISK-28571
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28571
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/cdr_pgsql
>    Affects Versions: GIT, 16.6.0
>         Environment: PostgreSQL server version: 12.0
> affects all Asterisk versions (including git master branch)
>            Reporter: Christoph Moench-Tegeder
>            Severity: Minor
>
> In cdr/cdr_pgsql.c function config_module() discovers the configured cdr table's schema. The SQL statement in there accesses pg_catalog.pg_attrdef.adsrc - a column which has been obsolete sind PostgreSQL 8.0 (released January 2005) and finally removed in PostgreSQL 12 (released Oct 3rd 2019).
> Initialization of the cdr_pgsql module against a PostgreSQL 12 server fails with message
>   cdr_pgsql.c: Failed to query database columns: ERROR:  column d.adsrc does not exist
> and no CDRs will be logged.
> Fortunately, the same information which once was stored in adsrc is accessable via column adbin and function pg_catalog.pg_get_expr, which is the recommended way since PostgreSQL 8.0. I'll attach a patch.
> Using that patch, cdr_pgsql initializes fine again and I get my CDRs logged to the database as with older PostgreSQL versions.
> See:
> https://www.postgresql.org/docs/8.0/catalog-pg-attrdef.html
> https://www.postgresql.org/docs/12/catalog-pg-attrdef.html
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=fe5038236c6b99d48c2faa2247b5cec9703add2a
> https://www.postgresql.org/docs/11/functions-info.html#FUNCTIONS-INFO-CATALOG-TABLE
> On a side note, there's code supporting very old PostgreSQL releases in cdr_pgsql ("before version 7.3", which is end-of-life for over a decade) which I do not touch in this issue but should perhaps removed.
> See: https://www.postgresql.org/support/versioning/



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list