Re: Getting json-value as varchar - Mailing list pgsql-general

From David G. Johnston
Subject Re: Getting json-value as varchar
Date
Msg-id CAKFQuwabBpxQv7YSY5mpPy2E9tqaye=7AyJSRreAn9hhtcTS_Q@mail.gmail.com
Whole thread Raw
In response to Re: Getting json-value as varchar  (Andreas Joseph Krogh <andreas@visena.com>)
Responses Re: Getting json-value as varchar  (Andreas Joseph Krogh <andreas@visena.com>)
List pgsql-general
On Thursday, January 6, 2022, Andreas Joseph Krogh <andreas@visena.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.

pgsql-general by date:

Previous
From: Augusto Mossambani
Date:
Subject: pg_dump parameter
Next
From: Andreas Joseph Krogh
Date:
Subject: Sv: Recommended storage hardware