Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rPock-00EMXU-LJ for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 18:57:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rPocj-006XaX-Dl for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 18:57:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rPocj-006XaP-3a for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2024 18:57:21 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rPocg-002AAX-KK for pgsql-general@postgresql.org; Tue, 16 Jan 2024 18:57:20 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-2108e106947so147884fac.3 for ; Tue, 16 Jan 2024 10:57:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705431437; x=1706036237; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wUZ0tBjYS2G0PsSyxK3eYyZo9dSqDaq5M9MgUnwIiKo=; b=QIGbC/C2eJWLr5G0ukwT8EWWJLnCOAcGQ3maBxgTbEilYYF+iKIIi1HIWv/5cDjvSt l897O/HOmNqD7YcNxbqZdb7d+HKgpqpD5q8VA7lDl7SV+kKCZ7qLya07N8/CHdb3aSTi tZN8h5ZYGp03wbkNCmL+cQGa+sYETsY1hnIZLGRRIj7sBrbbUYqy8Rdv2A4/GV1MEHey E1pDBfWfIXlFfLKBQa413In2ubGJw69HR9soDiLFCOP3Wf720d2FMsf3HAb3vphC+Mn5 zpM4Q50pc1H6WnwJkf3qKf39IP78qh1nvQjw8E0aj0JjsJcFYWGakBW61f8AmPPDFHJo tgiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705431437; x=1706036237; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wUZ0tBjYS2G0PsSyxK3eYyZo9dSqDaq5M9MgUnwIiKo=; b=ZQpgrowkaYDk93cOIxZS6z0lSq5ncCyw7/UB7s7wG//+In/6JsVeQsR8gT7MDX8O+V 6bNJ8iEUnZd/1ku/6PB6CrWt+G4vjYIFZ+mSgqtVhbcOgtetrfIYWlvjfm2AB9ou4RFK vze6cC5moMehXM/ajJUbUQdMoy/+EU6Ok0zPhsjz0gywJYZBlGHCJSivTxFHjKM9A93s jhiPEssWsZrWBhVENvtFuNLRhF2h6kfXTnYHKna/SyaeJYXgqAmyya2NyxGFI02zd/kf AOdPrNMm/kbUJukZH0Is3KhbrhWpKDuYbO5YVXu0hMJGF23DK6sgowyQIoen0CsOykQI bXZw== X-Gm-Message-State: AOJu0YxoKo5dXbmocSE8lGoLqj65mXaKxNIEqhMH7d9gB/HiKasrJxD0 S0Qm7o9MkYy9sLNG+Ef+6g== X-Google-Smtp-Source: AGHT+IHO5Y3p7pv43uxbPK1bSh9wNO8nujkmBNfb7DYd4lmIvsA1vC4j/GCFjKPZJKLhRbTlxWY49Q== X-Received: by 2002:a05:6870:a40e:b0:206:200:5b71 with SMTP id m14-20020a056870a40e00b0020602005b71mr7374314oal.30.1705431437005; Tue, 16 Jan 2024 10:57:17 -0800 (PST) Received: from [192.168.2.16] (070-113-014-216.res.spectrum.com. [70.113.14.216]) by smtp.gmail.com with ESMTPSA id qt17-20020a0568706e1100b002069f8f0340sm3095267oab.28.2024.01.16.10.57.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jan 2024 10:57:16 -0800 (PST) Message-ID: Date: Tue, 16 Jan 2024 12:57:14 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How to redirect output from PostgreSQL pg_recvlogical to a file or a pipe? Content-Language: en-US To: David Ventimiglia , Ron Johnson Cc: pgsql-general References: <3567b5db-19e4-48ff-ac6d-60a2439a1b8b@aklaver.com> From: Jim Nasby In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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