Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit feacabd

Browse files
committed
[PBCKP-308] Changed check_server_version function for postgresql version for 1c.
1 parent ba6b240 commit feacabd

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/backup.c

+14-3
Original file line numberDiff line numberDiff line change
@@ -946,10 +946,21 @@ check_server_version(PGconn *conn, PGNodeInfo *nodeInfo)
946946
*/
947947
#ifdef PGPRO_VERSION
948948
if (!res)
949+
{
949950
/* It seems we connected to PostgreSQL (not Postgres Pro) */
950-
elog(ERROR, "%s was built with Postgres Pro %s %s, "
951-
"but connection is made with PostgreSQL %s",
952-
PROGRAM_NAME, PG_MAJORVERSION, PGPRO_EDITION, nodeInfo->server_version_str);
951+
if(strcmp(PGPRO_EDITION, "1C") != 0)
952+
{
953+
elog(ERROR, "%s was built with Postgres Pro %s %s, "
954+
"but connection is made with PostgreSQL %s",
955+
PROGRAM_NAME, PG_MAJORVERSION, PGPRO_EDITION, nodeInfo->server_version_str);
956+
}
957+
/* We have PostgresPro for 1C and connect to PostgreSQL or PostgresPro for 1C
958+
* Check the major version
959+
*/
960+
if (strcmp(nodeInfo->server_version_str, PG_MAJORVERSION) != 0)
961+
elog(ERROR, "%s was built with PostgrePro %s %s, but connection is made with %s",
962+
PROGRAM_NAME, PG_MAJORVERSION, PGPRO_EDITION, nodeInfo->server_version_str);
963+
}
953964
else
954965
{
955966
if (strcmp(nodeInfo->server_version_str, PG_MAJORVERSION) != 0 &&

0 commit comments

Comments
 (0)