1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +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

@@ -4,7 +4,7 @@
# Makefile for utils/adt
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.12 1998/04/06 00:26:19 momjian Exp $
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.13 1998/04/29 12:38:01 scrappy Exp $
#
#-------------------------------------------------------------------------
@@ -22,7 +22,7 @@ OBJS = acl.o arrayfuncs.o arrayutils.o bool.o cash.o char.o chunk.o date.o \
misc.o nabstime.o name.o not_in.o numutils.o oid.o \
oidname.o oidint2.o oidint4.o oracle_compat.o regexp.o regproc.o \
selfuncs.o \
tid.o varchar.o varlena.o sets.o datetime.o like.o timestamp.o
tid.o varchar.o varlena.o sets.o datetime.o like.o timestamp.o version.o
all: SUBSYS.o

View 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;
}