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 1u1mZF-007zyh-9p for pgsql-general@arkaria.postgresql.org; Mon, 07 Apr 2025 13:31:13 +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 1u1mZD-00GTSp-Mz for pgsql-general@arkaria.postgresql.org; Mon, 07 Apr 2025 13:31:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u1mZD-00GTSh-BG for pgsql-general@lists.postgresql.org; Mon, 07 Apr 2025 13:31:11 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u1mZB-003TfI-2T for pgsql-general@lists.postgresql.org; Mon, 07 Apr 2025 13:31:10 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-ac6ed4ab410so709480666b.1 for ; Mon, 07 Apr 2025 06:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1744032668; x=1744637468; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=+xClcToCPvH6qEL+qhp0dIShO+xqEC2HdpgkC4HzuME=; b=f5nLhRBuzfwDJxYrx+3q7o3EypKCzNKBLXC9GN5FPi1is+sgPF9+kBxQNFFGpCHmEt r/P8+ikwtnf0T8tk8WzqteehKl0BnXyJ3psPHTmv6yH2leCPj0nB7ooKUObj790bkquF +u6cftRM6fSRwdb4peG7RTFcIzRPuqmZfGl7VSGJ/iSgkbuO/NlIt4kLj6mLDhOxspGN X5EK7XZAijHuBO1KekiJwg5YC2qNR9HEYW6vZ+pk/QZjKWnM/+UVtudedLFbcizbm2j2 VstYVYS7JiwIuRtnOlXurlEqTYfFtin7tFKmHcnVHblWcb2yu5AbXDnYT0vg5Ye1QyEi 8VTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744032668; x=1744637468; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+xClcToCPvH6qEL+qhp0dIShO+xqEC2HdpgkC4HzuME=; b=T2HaCdDbqQ9yyGTe6l1EliXLtfhftjPFw1/lOkS0i8JPYsltHu/aCP3CRYQjqpEyzF PfhhTaicqARGLL5+G7CXm5xDz71V9HnxOV+vAsm7bbSuE3Y0NVh0BCe1F6B0/qXN6HHV wQzExxuyjTu2uSm91ZIuz48tB4hxoW7KtZ41GX2diP9fFVCP77p3WzuQvV0o9Knu3IRS GlixRtijLqxQwp0MUwPAupAo6g4JUXwVdS8kAg4Pumww53V3zjN9jyeLwdPHsPZ4HvMR BGbZQSTjA7uktAgXrOaoxthW5BYsnfD/B2jI7DxEH5vjqGSQM7oJOuY6WbYNRE/xIUwr FG8Q== X-Gm-Message-State: AOJu0YzeoHaKPtovf35+MxWimrnWXrMvd4TCcLOhsOB2XWdyiz9mJlHF oS+0OuJiGb4EbM9RWWJT7P3YFWBmgv16VzqmNr0i9z6h3VMrYQRV5/ovONvNg2wv1VnSuCo/05U 0f4A= X-Gm-Gg: ASbGnctH75ciAidfLajakZGtxSBpxXLKPX0w8LwAQnIw5D3/tWB/WUsHJDNDt1QYIUh 0wsXmk5Pr7bLm/6jzh0k3ISB0iLSNn0EFvLc+TKZ1/h/SHsZAKHcTXMOVqbcwObO92FE8uQBr/I V+F02y8uyoL/oGsMcqmTjU/f044W3iqiC4ZHVP1k3Cm0uOs/r6y+TGD3vap8ZaFBfDk8Fa+ycL0 D00EUrnLVfO8aERdXkqXmj+6Qv/wgN+YWQmc0benuoc9n4sIoYsFCzXcQWnMQSqX4uZVa5W0tU/ lRcvhjk0ZxZObi5tneMEAuVQTbjgnTwV+S/JzOAQAat6XNkWL+akfZeD+7zDNc58ZQ== X-Google-Smtp-Source: AGHT+IHm9etD4x/vfJgAgsKC8gZ2TlM8LVK2rFpRV5yAWO7zpRA62663yDbqrgIhgu1aWwAGjd6ibg== X-Received: by 2002:a17:907:6e88:b0:ac6:fe8c:e7bb with SMTP id a640c23a62f3a-ac7d1c66170mr1277805866b.55.1744032668096; Mon, 07 Apr 2025 06:31:08 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:9a63:6e75:d921:166e:9c61]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac7c01c10dcsm743801166b.180.2025.04.07.06.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 06:31:07 -0700 (PDT) Message-ID: Subject: Re: find replication slots that "belong" to a publication From: Laurenz Albe To: Willy-Bas Loos , Justin Cc: pgsql-general Date: Mon, 07 Apr 2025 15:31:06 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2025-04-07 at 12:16 +0200, Willy-Bas Loos wrote: > My question is not so much about "can i drop a certain replication slot",= =C2=A0 > more about "does this publication still have any replication slots?". > Or, if you will: "what's the publication for this replication slot?". >=20 > I've double checked the views that you suggested, and I found that I can = relate > the WAL sender processes to replication slots through pg_replication_slot= s.active_pid . > I've also looked into replication origins. >=20 > But I can't find a link to the publication. And that's what I need to kno= w. I don't think that there is a connection between a publication and a replication slot. That connection is only made when a subscriber connects and runs the START_REPLICATION command [1] and specifies the "pgoutput" plugin with the "publication_names" option [2]. I don't think you can see that information reflected in a system view on the primary. You'd have to query "pg_subscription" on the standby. Yours, Laurenz Albe [1]: https://www.postgresql.org/docs/current/protocol-replication.html#PRO= TOCOL-REPLICATION-START-REPLICATION-SLOT-LOGICAL [2]: https://www.postgresql.org/docs/current/protocol-logical-replication.= html#PROTOCOL-LOGICAL-REPLICATION-PARAMS