1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Get rid of obsolete parse_version helper function.

For getting the server's version in numeric form, use PQserverVersion().
It does the exact same parsing as dumputils.c's parse_version(), and has
been around in libpq for a long time. For the client's version, just use
the PG_VERSION_NUM constant.
This commit is contained in:
Heikki Linnakangas
2013-03-26 15:21:57 +02:00
parent ec143f9405
commit 901b89e37b
6 changed files with 8 additions and 59 deletions

View File

@ -456,29 +456,6 @@ appendByteaLiteral(PQExpBuffer buf, const unsigned char *str, size_t length,
}
/*
* Convert backend's version string into a number.
*/
int
parse_version(const char *versionString)
{
int cnt;
int vmaj,
vmin,
vrev;
cnt = sscanf(versionString, "%d.%d.%d", &vmaj, &vmin, &vrev);
if (cnt < 2)
return -1;
if (cnt == 2)
vrev = 0;
return (100 * vmaj + vmin) * 100 + vrev;
}
/*
* Deconstruct the text representation of a 1-dimensional Postgres array
* into individual items.