On Tue, May 20, 2014 at 4:17 PM, Pavel Stehule <pavel.steh...@gmail.com> wrote:
> table dump is downloadable from http://pgsql.cz/data/data.dump.gz

This looks like an over-zealous assertion, without any user-visible
consequences. Mea culpa.

Attached patch corrects the problem.  I also noticed in passing that
there is another obsolete comment -- formIterIsContainer() is former
jsonbIteratorNext() infrastructure, which the updated comment now
refers to directly.

Thanks
-- 
Peter Geoghegan
*** a/src/backend/utils/adt/jsonb_util.c
--- b/src/backend/utils/adt/jsonb_util.c
*************** static void uniqueifyJsonbObject(JsonbVa
*** 62,74 ****
   *
   * There isn't a JsonbToJsonbValue(), because generally we find it more
   * convenient to directly iterate through the Jsonb representation and only
!  * really convert nested scalar values.  formIterIsContainer() does this, so
!  * that clients of the iteration code don't have to directly deal with the
!  * binary representation (JsonbDeepContains() is a notable exception, although
!  * all exceptions are internal to this module).  In general, functions that
!  * accept a JsonbValue argument are concerned with the manipulation of scalar
!  * values, or simple containers of scalar values, where it would be
!  * inconvenient to deal with a great amount of other state.
   */
  Jsonb *
  JsonbValueToJsonb(JsonbValue *val)
--- 62,74 ----
   *
   * There isn't a JsonbToJsonbValue(), because generally we find it more
   * convenient to directly iterate through the Jsonb representation and only
!  * really convert nested scalar values.  JsonbIteratorNext() does this, so that
!  * clients of the iteration code don't have to directly deal with the binary
!  * representation (JsonbDeepContains() is a notable exception, although all
!  * exceptions are internal to this module).  In general, functions that accept
!  * a JsonbValue argument are concerned with the manipulation of scalar values,
!  * or simple containers of scalar values, where it would be inconvenient to
!  * deal with a great amount of other state.
   */
  Jsonb *
  JsonbValueToJsonb(JsonbValue *val)
*************** compareJsonbContainers(JsonbContainer *a
*** 198,212 ****
  			 *
  			 * If the two values were the same container type, then there'd
  			 * have been a chance to observe the variation in the number of
! 			 * elements/pairs (when processing WJB_BEGIN_OBJECT, say).  They
! 			 * can't be scalar types either, because then they'd have to be
! 			 * contained in containers already ruled unequal due to differing
! 			 * numbers of pairs/elements, or already directly ruled unequal
! 			 * with a call to the underlying type's comparator.
  			 */
  			Assert(va.type != vb.type);
! 			Assert(va.type == jbvArray || va.type == jbvObject);
! 			Assert(vb.type == jbvArray || vb.type == jbvObject);
  			/* Type-defined order */
  			res = (va.type > vb.type) ? 1 : -1;
  		}
--- 198,210 ----
  			 *
  			 * If the two values were the same container type, then there'd
  			 * have been a chance to observe the variation in the number of
! 			 * elements/pairs (when processing WJB_BEGIN_OBJECT, say).  They're
! 			 * either two heterogeneously-typed containers, or a container and
! 			 * some scalar type.
  			 */
  			Assert(va.type != vb.type);
! 			Assert(va.type != jbvBinary);
! 			Assert(vb.type != jbvBinary);
  			/* Type-defined order */
  			res = (va.type > vb.type) ? 1 : -1;
  		}
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to