pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <jim.nasby@gmail.com>
To: David Ventimiglia <davidaventimiglia@hasura.io>
To: Ron Johnson <ronljohnsonjr@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to redirect output from PostgreSQL pg_recvlogical to a file or a pipe?
Date: Tue, 16 Jan 2024 12:57:14 -0600
Message-ID: <b9da20e6-f279-4c04-897a-c4e5ed716740@gmail.com> (raw)
In-Reply-To: <CADE7j6i4WGCyHgh94YTbGCZCVqY7W997useAyY-C+TXZYmKQrQ@mail.gmail.com>
References: <CADE7j6jz3qEinUfeALyBVdoyMWxE3okxUjKH0Dw8A+JjEzZJ_Q@mail.gmail.com>
	<CAHbZ42z7mPB+JoCA4=yM9boZD9CWM-SyHZmUorW_rEoQTxv9BQ@mail.gmail.com>
	<CADE7j6gP9tR3y_RbanUNx8RNK2Qro_XD_iLSsN4pCM9FQ8DHJg@mail.gmail.com>
	<3567b5db-19e4-48ff-ac6d-60a2439a1b8b@aklaver.com>
	<CADE7j6jSELMGv=05HrBmL-Z5GJ+GeX05E5yb4aZO4=mQmX7NVg@mail.gmail.com>
	<CANzqJaCs_pOkXB62FziBvKUwoaXWJBm5-N_sDBiX-nFmrSUO_g@mail.gmail.com>
	<CADE7j6i4WGCyHgh94YTbGCZCVqY7W997useAyY-C+TXZYmKQrQ@mail.gmail.com>

On 1/13/24 3:34 PM, David Ventimiglia wrote:
> The business problem I'm trying to solve is:
> 
> "How do I capture logical decoding events with the wal2json output 
> encoder, filter them with jq, and pipe them to psql, using pg_recvlogical?"

I think the missing piece here is that you can't simply pipe JSON into 
psql and expect anything useful to happen. Are you using jq to turn the 
JSON into actual SQL statements? What does some of your jq output look like?
-- 
Jim Nasby, Data Architect, Austin TX






view thread (17+ messages)  latest in thread

Message-ID: <b9da20e6-f279-4c04-897a-c4e5ed716740@gmail.com>
Permalink:  ../b9da20e6-f279-4c04-897a-c4e5ed716740@gmail.com/
Also on:    postgresql.org/message-id/b9da20e6-f279-4c04-897a-c4e5ed716740@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: jim.nasby@gmail.com, davidaventimiglia@hasura.io, ronljohnsonjr@gmail.com
  Subject: Re: How to redirect output from PostgreSQL pg_recvlogical to a file or a pipe?
  In-Reply-To: <b9da20e6-f279-4c04-897a-c4e5ed716740@gmail.com>
  References: <CADE7j6jz3qEinUfeALyBVdoyMWxE3okxUjKH0Dw8A+JjEzZJ_Q@mail.gmail.com> <CAHbZ42z7mPB+JoCA4=yM9boZD9CWM-SyHZmUorW_rEoQTxv9BQ@mail.gmail.com> <CADE7j6gP9tR3y_RbanUNx8RNK2Qro_XD_iLSsN4pCM9FQ8DHJg@mail.gmail.com> <3567b5db-19e4-48ff-ac6d-60a2439a1b8b@aklaver.com> <CADE7j6jSELMGv=05HrBmL-Z5GJ+GeX05E5yb4aZO4=mQmX7NVg@mail.gmail.com> <CANzqJaCs_pOkXB62FziBvKUwoaXWJBm5-N_sDBiX-nFmrSUO_g@mail.gmail.com> <CADE7j6i4WGCyHgh94YTbGCZCVqY7W997useAyY-C+TXZYmKQrQ@mail.gmail.com> <b9da20e6-f279-4c04-897a-c4e5ed716740@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox