[postgis-tickets] [PostGIS] #3867: Can't load against PostgreSQL 11 head

PostGIS trac at osgeo.org
Thu Sep 28 13:00:14 PDT 2017


#3867: Can't load against PostgreSQL 11 head
----------------------+---------------------------
  Reporter:  robe     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  blocker  |  Milestone:  PostGIS 2.5.0
 Component:  postgis  |    Version:  trunk
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by robe):

 I think it was this commit that broke 'r code.

 https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=4bd1994650fddf49e717e35f1930d62208845974


 {{{
 Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more consistent.
 author  Tom Lane <tgl at sss.pgh.pa.us>
         Mon, 18 Sep 2017 15:21:23 -0400 (15:21 -0400)
 committer       Tom Lane <tgl at sss.pgh.pa.us>
         Mon, 18 Sep 2017 15:21:23 -0400 (15:21 -0400)
 By project convention, these names should include "P" when dealing with a
 pointer type; that is, if the result of a GETARG macro is of type FOO *,
 it should be called PG_GETARG_FOO_P not just PG_GETARG_FOO.  Some newer
 types such as JSONB and ranges had not followed the convention, and a
 number of contrib modules hadn't gotten that memo either.  Rename the
 offending macros to improve consistency.

 In passing, fix a few places that thought PG_DETOAST_DATUM() returns
 a Datum; it does not, it returns "struct varlena *".  Applying
 DatumGetPointer to that happens not to cause any bad effects today,
 but it's formally wrong.  Also, adjust an ltree macro that was designed
 without any thought for what pgindent would do with it.

 This is all cosmetic and shouldn't have any impact on generated code.

 Mark Dilger, some further tweaks by me

 Discussion: https://postgr.es/m/EA5676F4-766F-
 4F38-8348-ECC7DB427C6A at gmail.com



 }}}

 Looks like DatumGetJsonb, should now be called DatumGetJsonbP


 {{{
 index 24f4916..d639bbc 100644 (file)
 --- a/src/include/utils/jsonb.h
 +++ b/src/include/utils/jsonb.h
 @@ -65,10 +65,10 @@ typedef enum
  #define JGIN_MAXLENGTH 125     /* max length of text part before hashing
 */

  /* Convenience macros */
 -#define DatumGetJsonb(d)   ((Jsonb *) PG_DETOAST_DATUM(d))
 -#define JsonbGetDatum(p)   PointerGetDatum(p)
 -#define PG_GETARG_JSONB(x) DatumGetJsonb(PG_GETARG_DATUM(x))
 -#define PG_RETURN_JSONB(x) PG_RETURN_POINTER(x)
 +#define DatumGetJsonbP(d)  ((Jsonb *) PG_DETOAST_DATUM(d))
 +#define JsonbPGetDatum(p)  PointerGetDatum(p)
 +#define PG_GETARG_JSONB_P(x)   DatumGetJsonbP(PG_GETARG_DATUM(x))
 +#define PG_RETURN_JSONB_P(x)   PG_RETURN_POINTER(x)

  typedef struct JsonbPair JsonbPair;
 }}}

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3867#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list