mirror of
https://github.com/postgres/postgres.git
synced 2025-05-29 00:03:09 -04:00
29 lines
615 B
C
29 lines
615 B
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* version.c
|
|
* Returns the PostgreSQL version string
|
|
*
|
|
* IDENTIFICATION
|
|
*
|
|
* $PostgreSQL: pgsql/src/backend/utils/adt/version.c,v 1.13 2003/11/29 19:52:00 pgsql Exp $
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
|
|
#include "postgres.h"
|
|
|
|
#include "utils/builtins.h"
|
|
|
|
|
|
Datum
|
|
pgsql_version(PG_FUNCTION_ARGS)
|
|
{
|
|
int n = strlen(PG_VERSION_STR);
|
|
text *ret = (text *) palloc(n + VARHDRSZ);
|
|
|
|
VARATT_SIZEP(ret) = n + VARHDRSZ;
|
|
memcpy(VARDATA(ret), PG_VERSION_STR, n);
|
|
|
|
PG_RETURN_TEXT_P(ret);
|
|
}
|