From 51a1741cfb9f812e798681d3edf5866e413f155b Mon Sep 17 00:00:00 2001 From: Marc G. Fournier Date: Wed, 29 Apr 1998 12:41:29 +0000 Subject: From: Jeroen van Vianen 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) --- src/utils/version.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/utils') diff --git a/src/utils/version.c b/src/utils/version.c index 193668b68c3..aef5de8b48a 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) -- cgit v1.2.3