cdr_pgsql: Refactor magic number by definition for version
authorRodrigo Ramírez Norambuena <a@rodrigoramirez.com>
Sat, 9 Sep 2017 02:19:28 +0000 (23:19 -0300)
committerRodrigo Ramírez Norambuena <a@rodrigoramirez.com>
Sat, 9 Sep 2017 02:19:28 +0000 (23:19 -0300)
Change-Id: I43f25976aa3069793ddbe0086833965a6fb0a518

cdr/cdr_pgsql.c

index 33cc1b8..b482fe6 100644 (file)
@@ -59,6 +59,8 @@
 
 #define DATE_FORMAT "'%Y-%m-%d %T'"
 
+#define PGSQL_MIN_VERSION_SCHEMA 70300
+
 static const char name[] = "pgsql";
 static const char config[] = "cdr_pgsql.conf";
 
@@ -677,7 +679,7 @@ static int config_module(int reload)
                }
                version = PQserverVersion(conn);
 
-               if (version >= 70300) {
+               if (version >= PGSQL_MIN_VERSION_SCHEMA) {
                        char *schemaname, *tablename, *tmp_schemaname, *tmp_tablename;
                        if (strchr(table, '.')) {
                                tmp_schemaname = ast_strdupa(table);