missing PG_RETURN_UINT16

Started by Manuel Kniepover 11 years ago4 messages
#1Manuel Kniep
m.kniep@web.de
1 attachment(s)

Hi,

I’m missing the PG_RETURN_UINT16 macro in fmgr.h
Since we already have the PG_GETARG_UINT16 macro
I guess it makes sense to to have it.

here is the trivial patch for it.

Attachments:

add_pg_return_uint16_macro.patchapplication/octet-stream; name=add_pg_return_uint16_macro.patchDownload
>From 4bc0a5a4ab010c1c57b98794d9c7917166d89ad5 Mon Sep 17 00:00:00 2001
From: Manuel Kniep <m.kniep@web.de>
Date: Mon, 4 Aug 2014 17:15:14 +0200
Subject: [PATCH] Add missing PG_RETURN_UINT16 macro

As we already have the PG_GETARG_UINT16 macro for uint16 data types
it makes sense to also have the PG_RETURN_UINT16 in place.
---
 src/include/fmgr.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index a901770..8c123fb 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -298,6 +298,7 @@ extern struct varlena *pg_detoast_datum_packed(struct varlena * datum);
 #define PG_RETURN_INT32(x)	 return Int32GetDatum(x)
 #define PG_RETURN_UINT32(x)  return UInt32GetDatum(x)
 #define PG_RETURN_INT16(x)	 return Int16GetDatum(x)
+#define PG_RETURN_UINT16(x)	 return UInt16GetDatum(x)
 #define PG_RETURN_CHAR(x)	 return CharGetDatum(x)
 #define PG_RETURN_BOOL(x)	 return BoolGetDatum(x)
 #define PG_RETURN_OID(x)	 return ObjectIdGetDatum(x)
-- 
1.8.5.2 (Apple Git-48)

#2Robert Haas
robertmhaas@gmail.com
In reply to: Manuel Kniep (#1)
Re: missing PG_RETURN_UINT16

On Mon, Aug 4, 2014 at 11:35 AM, Manuel Kniep <m.kniep@web.de> wrote:

I’m missing the PG_RETURN_UINT16 macro in fmgr.h
Since we already have the PG_GETARG_UINT16 macro
I guess it makes sense to to have it.

here is the trivial patch for it.

I see no reason not to add this. Anyone else want to object?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Fujii Masao
masao.fujii@gmail.com
In reply to: Robert Haas (#2)
Re: missing PG_RETURN_UINT16

On Wed, Aug 6, 2014 at 4:47 AM, Robert Haas <robertmhaas@gmail.com> wrote:

On Mon, Aug 4, 2014 at 11:35 AM, Manuel Kniep <m.kniep@web.de> wrote:

I’m missing the PG_RETURN_UINT16 macro in fmgr.h
Since we already have the PG_GETARG_UINT16 macro
I guess it makes sense to to have it.

here is the trivial patch for it.

I see no reason not to add this. Anyone else want to object?

+1 to add that.

What about backpatch to 9.4? This is very simple change and there seems to
be no reason to wait for it until 9.5.

Regards,

--
Fujii Masao

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Robert Haas
robertmhaas@gmail.com
In reply to: Fujii Masao (#3)
Re: missing PG_RETURN_UINT16

On Wed, Aug 6, 2014 at 2:36 AM, Fujii Masao <masao.fujii@gmail.com> wrote:

On Wed, Aug 6, 2014 at 4:47 AM, Robert Haas <robertmhaas@gmail.com> wrote:

On Mon, Aug 4, 2014 at 11:35 AM, Manuel Kniep <m.kniep@web.de> wrote:

I’m missing the PG_RETURN_UINT16 macro in fmgr.h
Since we already have the PG_GETARG_UINT16 macro
I guess it makes sense to to have it.

here is the trivial patch for it.

I see no reason not to add this. Anyone else want to object?

+1 to add that.

What about backpatch to 9.4? This is very simple change and there seems to
be no reason to wait for it until 9.5.

Well, that's true. But on the other hand, if someone is wanting to
write code that will compile with multiple PostgreSQL versions,
they're probably going to add an #ifdef for this anyway, so I don't
see much of a reason to think that will help very many people in
practice.

I've committed this, but just to master.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers