Only allow returning string types or bytea from json_serialize

Andrew Dunstan <andrew@dunslane.net>

Commit: 3c633f32b9c712cc0b4c8d946f0eeae04a3ff51a
Author: Andrew Dunstan <andrew@dunslane.net>
Date: 2022-07-07T21:40:02Z
Releases: 16.0
Only allow returning string types or bytea from json_serialize

These are documented to be the allowed types for the RETURNING clause,
but the restriction was not being enforced, which caused a segfault if
another type was specified. Add some testing for this.

Per report from a.kozhemyakin

Backpatch to release 15.

Files