Thread

Commits

  1. Fix incorrect print format in json.c

  2. Centralize json and jsonb handling of datetime types

  1. printing oid with %d

    Justin Pryzby <pryzby@telsasoft.com> — 2020-07-28T01:55:23Z

    +JsonEncodeDateTime(char *buf, Datum value, Oid typid)
    ...
    +                       elog(ERROR, "unknown jsonb value datetime type oid %d", typid);
    
    I think this should be %u.
    
    commit cc4feded0a31d2b732d4ea68613115cb720e624e
    Author: Andrew Dunstan <andrew@dunslane.net>
    Date:   Tue Jan 16 19:07:13 2018 -0500
    
        Centralize json and jsonb handling of datetime types
    
    
    
    
  2. Re: printing oid with %d

    Michael Paquier <michael@paquier.xyz> — 2020-07-28T07:59:48Z

    On Mon, Jul 27, 2020 at 08:55:23PM -0500, Justin Pryzby wrote:
    > +JsonEncodeDateTime(char *buf, Datum value, Oid typid)
    > ...
    > +                       elog(ERROR, "unknown jsonb value datetime type oid %d", typid);
    > 
    > I think this should be %u.
    
    Good catch.  Yep, Oids are unsigned.  We don't backpatch such things
    usually, do we?  Particularly, this one should not be triggerable
    normally because no code paths should call JsonEncodeDateTime() with
    an unsupported type Oid.
    --
    Michael
    
  3. Re: printing oid with %d

    Tom Lane <tgl@sss.pgh.pa.us> — 2020-07-28T14:35:54Z

    Michael Paquier <michael@paquier.xyz> writes:
    > Good catch.  Yep, Oids are unsigned.  We don't backpatch such things
    > usually, do we?  Particularly, this one should not be triggerable
    > normally because no code paths should call JsonEncodeDateTime() with
    > an unsupported type Oid.
    
    Yeah, given that it should be an unreachable case, there's likely
    no need to back-patch.
    
    			regards, tom lane
    
    
    
    
  4. Re: printing oid with %d

    Michael Paquier <michael@paquier.xyz> — 2020-07-29T05:58:15Z

    On Tue, Jul 28, 2020 at 10:35:54AM -0400, Tom Lane wrote:
    > Yeah, given that it should be an unreachable case, there's likely
    > no need to back-patch.
    
    Thanks.  Fixed on HEAD then.
    --
    Michael