mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
This adds unary plus capability. No grammar changes, per Tom's request.
Marko Kreen
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
*
|
||||
* 1998 Jan Wieck
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.41 2001/05/03 19:00:36 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.42 2001/06/07 00:09:29 momjian Exp $
|
||||
*
|
||||
* ----------
|
||||
*/
|
||||
@ -405,6 +405,19 @@ numeric_uminus(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
numeric_uplus(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Numeric num = PG_GETARG_NUMERIC(0);
|
||||
Numeric res;
|
||||
|
||||
res = (Numeric) palloc(num->varlen);
|
||||
memcpy(res, num, num->varlen);
|
||||
|
||||
PG_RETURN_NUMERIC(res);
|
||||
}
|
||||
|
||||
|
||||
Datum
|
||||
numeric_sign(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
Reference in New Issue
Block a user