Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 51a1741

Browse files
committed
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)
1 parent bab9818 commit 51a1741

File tree

11 files changed

+422
-325
lines changed

11 files changed

+422
-325
lines changed

src/backend/storage/buffer/Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for storage/buffer
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.7 1998/04/06 00:24:58 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.8 1998/04/29 12:37:51 scrappy Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -24,7 +24,11 @@ depend dep:
2424
$(CC) -MM $(CFLAGS) *.c >depend
2525

2626
clean:
27-
rm -f SUBSYS.o $(OBJS)
27+
rm -f SUBSYS.o $(OBJS) tas_test
28+
29+
tas_test: s_lock.c
30+
$(CC) $(CFLAGS) -DTAS_TEST=1 -g s_lock.c -o tas_test
31+
./tas_test
2832

2933
ifeq (depend,$(wildcard depend))
3034
include depend

src/backend/utils/adt/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for utils/adt
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.12 1998/04/06 00:26:19 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.13 1998/04/29 12:38:01 scrappy Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -22,7 +22,7 @@ OBJS = acl.o arrayfuncs.o arrayutils.o bool.o cash.o char.o chunk.o date.o \
2222
misc.o nabstime.o name.o not_in.o numutils.o oid.o \
2323
oidname.o oidint2.o oidint4.o oracle_compat.o regexp.o regproc.o \
2424
selfuncs.o \
25-
tid.o varchar.o varlena.o sets.o datetime.o like.o timestamp.o
25+
tid.o varchar.o varlena.o sets.o datetime.o like.o timestamp.o version.o
2626

2727
all: SUBSYS.o
2828

src/backend/utils/adt/version.c

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* version.c--
4+
* Returns the version string
5+
*
6+
* IDENTIFICATION
7+
*
8+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/version.c,v 1.1 1998/04/29 12:38:05 scrappy Exp $
9+
*
10+
*-------------------------------------------------------------------------
11+
*/
12+
13+
#include "postgres.h"
14+
#include "version.h"
15+
16+
17+
text* version(void);
18+
19+
text* version(void)
20+
{
21+
int n = strlen(PG_VERSION_STR) + VARHDRSZ;
22+
text *ret = (text *) palloc(n);
23+
24+
VARSIZE(ret) = n;
25+
strcpy(VARDATA(ret), PG_VERSION_STR);
26+
27+
return ret;
28+
}

0 commit comments

Comments
 (0)