Re: Getting json-value as varchar

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Andreas Joseph Krogh <andreas(at)visena(dot)com>
Cc: Thomas Markus <t(dot)markus(at)proventis(dot)net>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Getting json-value as varchar
Date: 2022-01-06 13:13:40
Message-ID: CAKFQuwabBpxQv7YSY5mpPy2E9tqaye=7AyJSRreAn9hhtcTS_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, January 6, 2022, Andreas Joseph Krogh <andreas(at)visena(dot)com>
wrote:

>
>
> I think you misread my message. What I want is for the subscript-version:
>
> ('{"key":"value"}'::jsonb)['key']
>
> to return:
>
> ┌──────────┐
> │ ?column? │
> ├──────────┤
> │ value │
> └──────────┘
>
> instead of
>
> ┌─────────┐
> │ jsonb │
> ├─────────┤
> │ "value" │
> └─────────
>
>
A given syntax/operator can only return one thing so what you want is
fundamentally not possible.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Joseph Krogh 2022-01-06 13:17:36 Sv: Recommended storage hardware
Previous Message Augusto Mossambani 2022-01-06 12:57:06 pg_dump parameter