1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

From: Jeroen van Vianen <jeroenv@design.nl>

Attached patch will add a version() function to Postges, e.g.

template1=> select version();
version
------------------------------------------------------------
PostgreSQL 6.3.2 on i586-pc-linux-gnu, compiled by gcc 2.8.1
(1 row)
This commit is contained in:
Marc G. Fournier
1998-04-29 12:41:29 +00:00
parent bab9818c4b
commit 51a1741cfb
11 changed files with 422 additions and 325 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.8 1997/09/08 02:41:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.9 1998/04/29 12:41:29 scrappy Exp $
*
* NOTES
* XXX eventually, should be able to handle version identifiers
@ -88,12 +88,12 @@ ValidatePgVersion(const char *path, char **reason_p)
}
else
{
if (version[2] != '0' + PG_VERSION ||
version[0] != '0' + PG_RELEASE)
if (version[2] != PG_VERSION[0] ||
version[0] != PG_RELEASE[0])
{
*reason_p = malloc(200);
sprintf(*reason_p,
"Version number in file '%s' should be %d.%d, "
"Version number in file '%s' should be %s.%s, "
"not %c.%c.",
full_path,
PG_RELEASE, PG_VERSION, version[0], version[2]);
@ -135,9 +135,9 @@ SetPgVersion(const char *path, char **reason_p)
{
int rc; /* return code from some function we call */
version[0] = '0' + PG_RELEASE;
version[0] = PG_RELEASE[0];
version[1] = '.';
version[2] = '0' + PG_VERSION;
version[2] = PG_VERSION[0];
version[3] = '\n';
rc = write(fd, version, 4);
if (rc != 4)