Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifUfj-0005Fv-90 for pgsql-admin@arkaria.postgresql.org; Thu, 12 Dec 2019 20:02:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ifUfh-0008Ap-7G for pgsql-admin@arkaria.postgresql.org; Thu, 12 Dec 2019 20:02:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifUfg-0008Ac-4e for pgsql-admin@lists.postgresql.org; Thu, 12 Dec 2019 20:02:48 +0000 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ifUfd-00015G-4u for pgsql-admin@lists.postgresql.org; Thu, 12 Dec 2019 20:02:46 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.west.internal (Postfix) with ESMTP id 62DA56C1; Thu, 12 Dec 2019 15:02:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 12 Dec 2019 15:02:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=to:from:subject:message-id:date :mime-version:content-type:content-transfer-encoding; s=fm1; bh= QaJJENRjbGAofnzzNetcMRlz7pq883TJhUvFPcOpb7g=; b=c7rJVcJWrQ8ydI0X Lcti9ACEAL5hue99YiE7+A0tXDrE0hdtGQC+ssWWyUen2BoebxDD96g56XnHA+Tg K6KSXnklEMncVQgQ0W7/2jouV0KXkEoW0QJLaSQDjoj4Y8rU3MjVWTTjTq9xkjD0 DA7t9IVmjHYONQ6nx5UJJyV0HKNx1NgIWY0riQvRt9oacv792xJ7JKlGUDt2hDcT fz2wHIJawAupp4PNdziIEUB3Va36N+JqlYi9oQd6QwN0XiZVNzvFXmyX2/fNA7uM VIkQGTlFPIA/VkSZT6/ZYA5oaiJvfUFcC7Ggf1sWFucsTv9wH3IkXxLUnGhRyjFD 3F/O1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=QaJJEN RjbGAofnzzNetcMRlz7pq883TJhUvFPcOpb7g=; b=A40WHiHnX/O+QkqYskkIGO TTpc3b030lGziyPTmTkJjv+fBWeVtsULiUjI6vFZNyLEwe3nuq1OXXI7u9vw3orG /15kt4OEuixI2gNI33YMwshd/2nP7c75LIM83Iw/lHAD7lRjFrSTaPKg8grP7gts OGKmcq4i6DkdpFM25gTLUmkFeLgXkYSGA9TNxuzq2Xl5CqKxHaZ7sChaoAJbPTp/ /aQKiOkMi0GC4EfulQeB3RQRpEkgRQoPKsbr3dRcVSHfini0+ehyncsWjiekqtnI guhy8mz8TssslKXWA9lFqesSyggAVLTVa9TrZDYSPemqw3v+xLsKC2V2JE4xeZlg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeljedgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepvffhuffkffgfgggtgfesthekre dttdefjeenucfhrhhomhepfdfurdeuohgsfdcuoehssghosgesqhhurggurhgrthhumhdq sghrrggttggrshdrtghomheqnecukfhppeehtddrvddvgedrvddvledrvddvkeenucfrrg hrrghmpehmrghilhhfrhhomhepshgsohgssehquhgrughrrghtuhhmqdgsrhgrtggtrghs rdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [10.61.12.72] (unknown [50.224.229.228]) by mail.messagingengine.com (Postfix) with ESMTPA id 7CC07306017A; Thu, 12 Dec 2019 15:02:42 -0500 (EST) To: pgsql-admin@lists.postgresql.org From: "S.Bob" Subject: Parse / print all elements of a json data column - Message-ID: <1e83d780-ece1-9f27-05f8-5c6db7ce04a8@quadratum-braccas.com> Date: Thu, 12 Dec 2019 13:02:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk All; I've setup a logical replication slot in a 9.6 cluster. I have pulled data with a query like this: SELECT * FROM pg_logical_slot_get_changes('lr_cdc_slot', NULL, NULL, 'pretty-print', '1') I've even staged the returned 'data' column in a table like this: create table json_test as select data::jsonb from pg_logical_slot_get_changes('lr_cdc_slot', null, null,'include-timestamp','1'); I want to isolate the various "fields" and "values" of the output json string (i.e. the table name, the operation, the columns, etc) However I am not having much luck. Here's some of the queries that do work but none of them give me a full breakout of the fields: select jsonb_each(data) from json_test ;  (change,"[{""kind"": ""insert"", ""table"": ""lr_test_tab"", "" schema"": ""lr_test_schema"", ""columnnames"": [""id"", ""compan y_name"", ""status"", ""active_date""], ""columntypes"": [""inte ger"", ""character varying(100)"", ""character varying(10)"", "" timestamp with time zone""], ""columnvalues"": [1, ""Acme CO"", ""B+"", ""2017-12-12 10:14:39.899462-05""]}]")  (timestamp,"""2019-12-12 10:14:39.901252-05""") (2 rows) select jsonb_object_keys(data::jsonb) from json_test ;  jsonb_object_keys -------------------  change  timestamp (2 rows) How can I pull each field and it's value from this (i.e kind = insert, table = lr_test_tab, columnnames = ...)? Thanks in advance