mirror of https://github.com/postgres/postgres
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)REL6_4
parent
bab9818c4b
commit
51a1741cfb
@ -0,0 +1,28 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* version.c-- |
||||
* Returns the version string |
||||
* |
||||
* IDENTIFICATION |
||||
* |
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/version.c,v 1.1 1998/04/29 12:38:05 scrappy Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#include "postgres.h" |
||||
#include "version.h" |
||||
|
||||
|
||||
text* version(void); |
||||
|
||||
text* version(void) |
||||
{ |
||||
int n = strlen(PG_VERSION_STR) + VARHDRSZ; |
||||
text *ret = (text *) palloc(n); |
||||
|
||||
VARSIZE(ret) = n; |
||||
strcpy(VARDATA(ret), PG_VERSION_STR); |
||||
|
||||
return ret; |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -1,24 +0,0 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* version.h-- |
||||
* this file contains the interface to version.c. |
||||
* Also some parameters. |
||||
* |
||||
* $Id: version.h,v 1.8 1998/04/26 04:08:29 momjian Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
#ifndef VERSION_H |
||||
#define VERSION_H |
||||
|
||||
void |
||||
ValidatePgVersion(const char *path, char **reason_p); |
||||
|
||||
void |
||||
SetPgVersion(const char *path, char **reason_p); |
||||
|
||||
#define PG_RELEASE 6 |
||||
#define PG_VERSION 4 |
||||
#define PG_VERFILE "PG_VERSION" |
||||
|
||||
#endif |
||||
@ -0,0 +1,25 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* version.h.in-- |
||||
* this file contains the interface to version.c. |
||||
* Also some parameters. |
||||
* |
||||
* $Header: /cvsroot/pgsql/src/include/Attic/version.h.in,v 1.1 1998/04/29 12:39:21 scrappy Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
#ifndef VERSION_H |
||||
#define VERSION_H |
||||
|
||||
void ValidatePgVersion(const char *path, char **reason_p); |
||||
void SetPgVersion(const char *path, char **reason_p); |
||||
|
||||
#define PG_RELEASE "6" |
||||
#define PG_VERSION "3" |
||||
#define PG_SUBVERSION "2" |
||||
|
||||
#define PG_VERFILE "PG_VERSION" |
||||
|
||||
#define PG_VERSION_STR "PostgreSQL " ## PG_RELEASE ## "." ## PG_VERSION ## "." ## PG_SUBVERSION ## " on @host@, compiled by @CC@ @CC_VERSION@" |
||||
|
||||
#endif |
||||
Loading…
Reference in new issue