Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nLYVI-0008Eh-Lc for pgsql-sql@arkaria.postgresql.org; Sat, 19 Feb 2022 22:47:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nLYVH-0006nP-BK for pgsql-sql@arkaria.postgresql.org; Sat, 19 Feb 2022 22:46:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nLYVH-0006n9-0j for pgsql-sql@lists.postgresql.org; Sat, 19 Feb 2022 22:46:59 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nLYVC-00031r-HU for pgsql-sql@lists.postgresql.org; Sat, 19 Feb 2022 22:46:57 +0000 Received: by mail-pg1-x52d.google.com with SMTP id 139so10988320pge.1 for ; Sat, 19 Feb 2022 14:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=KnxtXjL5u6LdyhAx80bS0nbwUNBoshRiCEZhApseKC8=; b=Hh/VAvSdW13q4tuU4/CDy6yfJ1EJajmLh8yF9Xk48FL7e93ii/n53U0Y/X1p82iZUP HbYlWZqkUWWeq1zKD9Br0Xw85mc2JidG+mxEHZXjxDJLHMlR7W+CIPKVnh7QEL6mXjqs dt9AYo6dwq78BtZVc2KvHFzNR987RYN/+Au7zbGYfpwFzbURF2nrV3oVGkBlqBmVBv5r u3zZkwuoooW9kcI73VeqTF/yEKl4XWmChLYdgHjFWhbq/DNTBB/QJ3uvLIuAVTWq+WOO V8aU6Ih2EBgWoLQJ1TQywvMRoUSc6Vuw+0jba+XVLEtv8HmfW03bM3lBE9MHTSP9hvXA da2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=KnxtXjL5u6LdyhAx80bS0nbwUNBoshRiCEZhApseKC8=; b=sjeljTr25t3p/C7ZgkGlOymk2Fez+vx6cdtw1GApgsrWe4NgHzZR1WVCt3gGPm/aLR mdlHvFzyI0OjCRfamKikSo8vo+E91ZDqdFiDyRs/XEwGZtKJzxJ2MHq8r3f8d2st4sRu N+a7LUwt5Pbit+4fhYbIVEA1tZ3eqLGv3xoE2i04qohYytyyD2CmyWv0DsEOy1CCduOi gTSN2gi4Re1zRnyuI0x2Klv683g3CasNzTrbUKyMWXfYaQjEyurYKAkzemUqSUR7nLoi /S1VXxfmFl6FMM/+tJjKgLacFSdtxBnDM+qklyjdolfDD5LxCCUyj2T3ufSNcU7mohJR j6eQ== X-Gm-Message-State: AOAM531ekaEl5sTgnWm8eSMyB+uM0+ADO+kzl/Qbu1PTsupV74/skKXC b9TF57nzFAgtknJfca9A9h6WKzzNmtU= X-Google-Smtp-Source: ABdhPJzBSV11H7pWM7dcDhJLw35Z7iFT15VqjM5MB0Dz4VsGZVRwcOT2+E9jcnoxEEZWSQRTPr2FpA== X-Received: by 2002:a63:e705:0:b0:365:964b:90d with SMTP id b5-20020a63e705000000b00365964b090dmr11221642pgi.224.1645310813072; Sat, 19 Feb 2022 14:46:53 -0800 (PST) Received: from [10.128.71.194] ([155.98.131.2]) by smtp.gmail.com with ESMTPSA id z2-20020a17090acb0200b001b9bc3e7380sm2974556pjt.31.2022.02.19.14.46.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 14:46:52 -0800 (PST) Content-Type: multipart/alternative; boundary="------------muv27KEtUBFbSI9MFWLp6ks0" Message-ID: <93873f95-ae08-b1b9-cfe7-5fd1be777dc6@gmail.com> Date: Sat, 19 Feb 2022 15:46:51 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: Turn a json column into a table Content-Language: en-CA To: pgsql-sql@lists.postgresql.org References: From: Rob Sargent In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------muv27KEtUBFbSI9MFWLp6ks0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/19/22 15:40, Shaozhong SHI wrote: > > > On Tue, 15 Feb 2022 at 08:37, Karsten Hilbert > wrote: > > Hi Ion, > > > there seems to be an example in the archives > > > https://www.postgresql.org/message-id/20180526150323.GB28324%40momjian.us > > Many thanks !   I shall indeed go Read The Fine Manual now. > > In case I might have further questions I would like to come back, > post my work and understanding, and ask for specific guidance on > the aspects I can't fully solve myself. > > Thanks again, > Karsten > > In the JSON column, one key can be seen present as other keys.  But, > when use json_object_keys, it did not turn up at all. > > Is there a way to cast json column as text, and extract values from text? > Nothing in https://www.postgresql.org/docs/14/functions-json.html helps? --------------muv27KEtUBFbSI9MFWLp6ks0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2/19/22 15:40, Shaozhong SHI wrote:


On Tue, 15 Feb 2022 at 08:37, Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:
Hi Ion,

> there seems to be an example in the archives
> https://www.postgresql.org/message-id/20180526150323.GB28324%40momjian.us

Many thanks !   I shall indeed go Read The Fine Manual now.

In case I might have further questions I would like to come back,
post my work and understanding, and ask for specific guidance on
the aspects I can't fully solve myself.

Thanks again,
Karsten
 
In the JSON column, one key can be seen present as other keys.  But, when use json_object_keys, it did not turn up at all.

Is there a way to cast json column as text, and extract values from text?


Nothing in https://www.postgresql.org/docs/14/functions-json.html helps?

--------------muv27KEtUBFbSI9MFWLp6ks0--