mirror of
https://github.com/postgres/postgres.git
synced 2025-09-17 22:22:26 +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:
28
src/backend/utils/adt/version.c
Normal file
28
src/backend/utils/adt/version.c
Normal file
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user