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: "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:29:12
Message-ID: CAKFQuwaRcrLBOMEb7ZNmW9_GCGARODRRtN3oOPMYLCex5MnT5g@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:

>
> Apparently I'm after a solution which either casts this to varchar or a
> function that takes JSONB as argument and outputs the first field-value as
> varchar.
>
>

You can try casting the value though IIRC it doesn’t actually work
(limitation of the feature). The fact is that the ‘ - - > ‘ operator gives
you the needed output.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Joseph Krogh 2022-01-06 13:33:31 Re: Getting json-value as varchar
Previous Message Thomas Markus 2022-01-06 13:25:16 Re: Getting json-value as varchar