mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Cleanup around json_to_record/json_to_recordset
Set function parameter names and defaults. Add jsonb versions (which the code already provided for so the actual new code is trivial). Add jsonb regression tests and docs. Bump catalog version (which I apparently forgot to do when jsonb was committed).
This commit is contained in:
@ -2014,6 +2014,12 @@ jsonb_populate_record(PG_FUNCTION_ARGS)
|
||||
return populate_record_worker(fcinfo, true);
|
||||
}
|
||||
|
||||
Datum
|
||||
jsonb_to_record(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return populate_record_worker(fcinfo, false);
|
||||
}
|
||||
|
||||
Datum
|
||||
json_populate_record(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -2449,6 +2455,24 @@ jsonb_populate_recordset(PG_FUNCTION_ARGS)
|
||||
return populate_recordset_worker(fcinfo, true);
|
||||
}
|
||||
|
||||
Datum
|
||||
jsonb_to_recordset(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return populate_recordset_worker(fcinfo, false);
|
||||
}
|
||||
|
||||
Datum
|
||||
json_populate_recordset(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return populate_recordset_worker(fcinfo, true);
|
||||
}
|
||||
|
||||
Datum
|
||||
json_to_recordset(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return populate_recordset_worker(fcinfo, false);
|
||||
}
|
||||
|
||||
static void
|
||||
make_row_from_rec_and_jsonb(Jsonb * element, PopulateRecordsetState *state)
|
||||
{
|
||||
@ -2571,18 +2595,6 @@ make_row_from_rec_and_jsonb(Jsonb * element, PopulateRecordsetState *state)
|
||||
tuplestore_puttuple(state->tuple_store, rettuple);
|
||||
}
|
||||
|
||||
Datum
|
||||
json_populate_recordset(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return populate_recordset_worker(fcinfo, true);
|
||||
}
|
||||
|
||||
Datum
|
||||
json_to_recordset(PG_FUNCTION_ARGS)
|
||||
{
|
||||
return populate_recordset_worker(fcinfo, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* common worker for json_populate_recordset() and json_to_recordset()
|
||||
*/
|
||||
|
Reference in New Issue
Block a user