Re: How to redirect output from PostgreSQL pg_recvlogical to a file or a pipe?

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: David Ventimiglia <davidaventimiglia(at)hasura(dot)io>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to redirect output from PostgreSQL pg_recvlogical to a file or a pipe?
Date: 2024-01-12 19:50:24
Message-ID: CA+bJJbz_+dZ7cX363T3x+L3H80fNwxcoWCskbMbWY=1zFZyb5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David:

On Fri, 12 Jan 2024 at 20:35, David Ventimiglia
<davidaventimiglia(at)hasura(dot)io> wrote:
> pg_recvlogical -d postgres --slot test --start -f - >> sample.jsonl
>
> Lest there be any confusion, I already created the slot in an earlier step. Moreover, I can verify that if I omit the output redirection >> sample then it does work, insofar as it emits the expected change events when I perform DML in another terminal window. When I include the redirection (or alternatively, set up a pipeline), then nothing happens.

Have you tested the command as printed ( with -f - ) but without redirection?

Have you ruled out the usual suspect, stdout is line buffered when
going to a tty, full buffered when not ? ( by killing pg_revlogical
and/or insuring a long enough output is generated )

Francisco Olarte.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message NAVSYSTEMS LTD 2024-01-12 22:04:25 Re: Support for arm64 windows is absent - Would be nice to have!
Previous Message Adrian Klaver 2024-01-12 19:48:42 Re: How to redirect output from PostgreSQL pg_recvlogical to a file or a pipe?