pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
BUG #15999: jsonb_populate_record fails with array column 2+ messages / 2 participants [nested] [flat]
* BUG #15999: jsonb_populate_record fails with array column @ 2019-09-10 09:55 PG Bug reporting form <noreply@postgresql.org> 2019-09-10 14:38 ` Re: BUG #15999: jsonb_populate_record fails with array column Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 1 reply; 2+ messages in thread From: PG Bug reporting form @ 2019-09-10 09:55 UTC (permalink / raw) To: pgsql-bugs@lists.postgresql.org; +Cc: easteregg@verfriemelt.org The following bug has been logged on the website: Bug reference: 15999 Logged by: Richard Email address: easteregg@verfriemelt.org PostgreSQL version: 9.6.15 Operating system: Debian / Windows Description: given the following simplified table with one row inserted: > create table testa ( id serial, test text[] default '{"test","test2"}'::text[] ); > insert into testa values (default); when we try to populate a record of testa type we run into trouble with postgres in version 9.6.15 > select jsonb_populate_record(null::testa , to_jsonb(testa)) FROM testa; ERROR: 22P02: malformed array literal: "["test", "test2"]" DETAIL: "[" must introduce explicitly-specified array dimensions. LOCATION: array_in, arrayfuncs.c:269 with postgres 10 and higher we get the expected result: > select jsonb_populate_record(null::testa , to_jsonb(testa)) FROM testa; jsonb_populate_record ═════════════════════ (1,"{test,test2}") (1 row) whe the array column is null, and therefor no contained array in the jsonb representation, everything works fine under 9.6.15 > update testa set test = null; > select jsonb_populate_record(null::testa , to_jsonb(testa)) FROM testa; jsonb_populate_record ═════════════════════ (1,) (1 row) ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #15999: jsonb_populate_record fails with array column 2019-09-10 09:55 BUG #15999: jsonb_populate_record fails with array column PG Bug reporting form <noreply@postgresql.org> @ 2019-09-10 14:38 ` Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2019-09-10 14:38 UTC (permalink / raw) To: easteregg@verfriemelt.org; +Cc: pgsql-bugs@lists.postgresql.org PG Bug reporting form <noreply@postgresql.org> writes: > given the following simplified table with one row inserted: >> create table testa ( id serial, test text[] default > '{"test","test2"}'::text[] ); >> insert into testa values (default); > when we try to populate a record of testa type we run into trouble with > postgres in version 9.6.15 >> select jsonb_populate_record(null::testa , to_jsonb(testa)) FROM testa; > ERROR: 22P02: malformed array literal: "["test", "test2"]" > DETAIL: "[" must introduce explicitly-specified array dimensions. > LOCATION: array_in, arrayfuncs.c:269 Yeah, this is something we aren't going to risk changing pre-v10. cf35346e8 is what fixed it, but that was a pretty massive rewrite with bugs of its own, and IIRC it changed some other behaviors that were less obviously bugs than the case you're complaining of. regards, tom lane ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-09-10 14:38 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-09-10 09:55 BUG #15999: jsonb_populate_record fails with array column PG Bug reporting form <noreply@postgresql.org> 2019-09-10 14:38 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox