diff options
author | Marc G. Fournier | 1998-04-29 12:41:29 +0000 |
---|---|---|
committer | Marc G. Fournier | 1998-04-29 12:41:29 +0000 |
commit | 51a1741cfb9f812e798681d3edf5866e413f155b (patch) | |
tree | 034dacbe407d11c81e521b87a9a41f7bcca373f6 /src/utils | |
parent | bab9818c4ba9a636ab1d638c3cf096f90cd66351 (diff) |
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)
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/version.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/version.c b/src/utils/version.c index 193668b68c..aef5de8b48 100644 --- a/src/utils/version.c +++ b/src/utils/version.c @@ -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) |