Re: json_populate_recordset

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: json_populate_recordset
Date: 2018-06-07 16:56:11
Message-ID: CAFj8pRAeXRoomwTJYvKfsNbre_H+GUbrhq2z4AsSTCjDRO=OYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2018-06-07 18:51 GMT+02:00 Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>:

> From here:
>
> https://www.postgresql.org/docs/10/static/functions-json.html
>
> select * from json_populate_record(null::myrowtype, '{"a": 1, "b": ["2",
> "a b"], "c": {"d": 4, "e": "a b c"}}')
>
> What is the null::myrowtype doing?
>

this function uses polymorphic parameters - its some like

create or replace function fx(in anyelement, json) returns anyelement ..

output polymorphic value requires minimally one input polymorphic value for
type specification. Postgres has not possibility to pass only datatype - so
pattern null:type is used instead.

Regards

Pavel

>
>
> Thanks,
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean Claude 2018-06-07 18:16:19 Service pgpool
Previous Message Adrian Klaver 2018-06-07 16:51:20 json_populate_recordset