On 16-Feb-2020, at 16:40, Andrew Dunstan wrote:
On 2/16/20 7:25 PM, Bryn Llewellyn wrote:
>
> B.t.w., you earlier said “The double quotes [around “dog”] serve a specific
> purpose, to allow values containing commas to be treated as a single value
> (see syntax details for the exact rules) in
On 2/16/20 7:25 PM, Bryn Llewellyn wrote:
>
> B.t.w., you earlier said “The double quotes [around “dog”] serve a specific
> purpose, to allow values containing commas to be treated as a single value
> (see syntax details for the exact rules) in the resulting array of text
> values.” But this
Andrew Dunstan wrote:
Bryn Llewellyn wrote:
>
> Andrew replied
>
> The function above has many deficiencies, including lack of error
> checking and use of 'execute' which will significantly affect
> performance. Still, if it works for you, that's your affair.
>
> These functions were written t
On 2/16/20 1:40 PM, Bryn Llewellyn wrote:
>
> Andrew replied
>
> The function above has many deficiencies, including lack of error
> checking and use of 'execute' which will significantly affect
> performance. Still, if it works for you, that's your affair.
>
> These functions were written to acc
Bryn Llewellyn wrote:
> ...I wrote my own wrapper for jsonb_build_array()
> and jsonb_build_object():
>
> create function my_jsonb_build(
> kind in varchar,
> variadic_elements in varchar)
> returns jsonb
> immutable
> language plpgsql
> as $body$
> declare
> stmt varchar :=
> cas
On 2/15/20 12:06 AM, Bryn Llewellyn wrote:
> Thank you both, Vik, and David, for bing so quick to respond. All is
> clear now. It seems to me that the price (giving up the ability to say
> explicitly what primitive JSON values you want) is too great to pay
> for the benefit (being able to build t
Thank you both, Vik, and David, for bing so quick to respond. All is clear now.
It seems to me that the price (giving up the ability to say explicitly what
primitive JSON values you want) is too great to pay for the benefit (being able
to build the semantic equivalent of a variadic list of actua
On Friday, February 14, 2020, Bryn Llewellyn wrote:
>
>
> select jsonb_pretty(jsonb_object(
> '{a, 17, b, "dog", c, true}'::varchar[]
> ))
>
> In other words, do the double quotes around "dog" have no effect? That
> would be a bad thing—and it would limit the usefulness of the
> jsonb_object() f
On Friday, February 14, 2020, Bryn Llewellyn wrote:
>
> The doc (“Builds a JSON object out of a text array.”) is simply too terse
> to inform an answer to this question.
>
It does presume knowledge but it precisely defines the outcome:
PostgreSQL arrays are typed and all members are of the same
On 15/02/2020 04:07, Bryn Llewellyn wrote:
> This:
>
> select jsonb_pretty(jsonb_build_object(
> 'a'::varchar, 1.7::numeric,
> 'b'::varchar, 'dog'::varchar,
> 'c'::varchar, true::boolean
> ))
>
> allows me to express what I want. That’s a good thing. Are you saying that
> this:
>
> select j
This:
select jsonb_pretty(jsonb_build_object(
'a'::varchar, 1.7::numeric,
'b'::varchar, 'dog'::varchar,
'c'::varchar, true::boolean
))
allows me to express what I want. That’s a good thing. Are you saying that this:
select jsonb_pretty(jsonb_object(
'{a, 17, b, "dog", c, true}'::varchar[]
On 15/02/2020 03:21, Bryn Llewellyn wrote:
> Now execute this supposed functional equivalent:
>
> select jsonb_pretty(jsonb_object(
> '{a, 17, b, "dog", c, true}'::varchar[]
> ))
>
> It is meant to be a nice alternative when you want to build an object (rather
> than an array) because the sy
12 matches
Mail list logo