1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

Functions on 'text' type updated to new fmgr style. 'text' is

now TOAST-able.
This commit is contained in:
Tom Lane
2000-07-06 05:48:31 +00:00
parent 40f64064ff
commit 8ecac94bb2
20 changed files with 756 additions and 693 deletions

View File

@ -1,29 +1,28 @@
/*-------------------------------------------------------------------------
*
* version.c
* Returns the version string
* Returns the PostgreSQL version string
*
* IDENTIFICATION
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/version.c,v 1.11 2000/07/03 23:09:54 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/version.c,v 1.12 2000/07/06 05:48:11 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "utils/builtins.h"
text *version(void);
text *
version(void)
Datum
pgsql_version(PG_FUNCTION_ARGS)
{
int n = strlen(PG_VERSION_STR) + VARHDRSZ;
text *ret = (text *) palloc(n);
int n = strlen(PG_VERSION_STR);
text *ret = (text *) palloc(n + VARHDRSZ);
VARATT_SIZEP(ret) = n;
memcpy(VARDATA(ret), PG_VERSION_STR, strlen(PG_VERSION_STR));
VARATT_SIZEP(ret) = n + VARHDRSZ;
memcpy(VARDATA(ret), PG_VERSION_STR, n);
return ret;
PG_RETURN_TEXT_P(ret);
}