Yeah I'm not sure why you're looping using pointer math, the iterators are there to provide that service. Another function to check out 'jsonb_each', other than the set returning function parts, it does what it looks like your are trying to do.
-Michel
On Mon, Mar 18, 2019 at 4:12 PM Andrew Gierth <andrew@xxxxxxxxxxxxxxxxxxxx> wrote:
>>>>> "T" == T L <tinlyx@xxxxxxxxx> writes:
T> Below is my test. It prints a strange character instead of "a"; and
T> says that the value isn't numeric.
Yeah, there's plenty else wrong with your code.
Did you look at how JsonbToCStringWorker does it? that looks like the
best example I can find on a quick scan.
--
Andrew (irc:RhodiumToad)