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 1tOjZh-008O02-Rr for pgsql-general@arkaria.postgresql.org; Fri, 20 Dec 2024 20:26:18 +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 1tOjZh-00GQqo-6B for pgsql-general@arkaria.postgresql.org; Fri, 20 Dec 2024 20:26:16 +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 1tOjZg-00GQqa-Q5 for pgsql-general@lists.postgresql.org; Fri, 20 Dec 2024 20:26:16 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tOjZb-000oHL-2k for pgsql-general@postgresql.org; Fri, 20 Dec 2024 20:26:15 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-2689e7a941fso712915fac.3 for ; Fri, 20 Dec 2024 12:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734726369; x=1735331169; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=cVn5c3Au3EC/gTQd3TLEpCPH+xc51fTiahOTSn9zOI0=; b=MD8gYCSltjadW3wKUVeF+jJW0BELBEQP5w8hR7w6gzz/hUZ3H6jjYpZuYjZXt+rDHy II53y+H07URQyKFjwCpw32cj8oKH8L04Z+KgcUqC8al2IH5iJXgI701X2bYNbYTifBOu rdb93pOh3IkW1Fab5OuvDqrwCS7OpoKCDr0NpGxLpqXBd+3C1wknNxCVMfI/FBf0LuVl D1IRNH3kPILu8oqMx8WsK/41hV3k7fEzoI9VbRzD4hP12ZcH6YeLLxxI9jTviVCunGy5 6/M2UCscdCFYXkED8Y8WfQ40zBIB5i1V8oezHbEhDT5dEm+6Fn3gBg/JmdLR70RIv5dH 66QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734726369; x=1735331169; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cVn5c3Au3EC/gTQd3TLEpCPH+xc51fTiahOTSn9zOI0=; b=wPQPnfW6H0v4COb55mJoCcv7vWaqrgslV5jt0CbYDF0t2GOxQ/EMAAe2cxuIK3CSz7 iWAXKGT+awuflC9d3eYseuPnxZqoPmIRVUu3yZ5RYnrxyworRMfVtKYep1ebYgc2Fbwn tTKM/SO9Y7CZGY7QEVSo6rdq3vX/pZfeDRas2HUzLMboh7EzAHk8vWy5yFG1/7LF3iLj 2UvyKqIFIMMtqC+FCS7h2l/bcJeNfLeTljQ1WUSBa7myN7FAfxysvqUCkXr6uML//76q kruX5hpTuEOQGwF4e8kK0xFgpYT1Bpc7akzfnZigCSC4x6tJ2FV2hrBlCNtOCOSxLr6X XPmQ== X-Gm-Message-State: AOJu0YwwYPmgU+V3zX0sMBQXfzjsLmPOB6jrqWMDC/Jv+A09RMpxCeif ySBb5W1on5nSZti6gwZxdwzvMnOh8BomO4qbFo6sZSx4AiNJqiXyqjMFotphoq3bxTML+Q3t8WB 8GFWwEMzjFM7GgsPQIbBMOycWbE8Ei8Q5 X-Gm-Gg: ASbGncuKEyr4uXugxf4zhj1KYCmY6ivgbNhOlfefL62AP30flMhx1fDjfcmyJgd5ATu kZTk6CgZ7dh6RirrEDE1qN+d0NHTxH8dNGI2jXp4= X-Google-Smtp-Source: AGHT+IEEQ9Fz3mkVW/CurVDr1L9UyFdEGxKQDkZniqB8+w9LWHM1Y3n3NS+ODUhKq5jUoYwUCPGH5Dqhj+FFUvtRh3Y= X-Received: by 2002:a05:6870:fe8b:b0:29e:7d35:2319 with SMTP id 586e51a60fabf-2a7fafda7fcmr2090647fac.4.1734726368716; Fri, 20 Dec 2024 12:26:08 -0800 (PST) MIME-Version: 1.0 References: <0558ddd4d71641bdb41fa49b2425f73c@safrangroup.com> <07ab2d83-ffe5-4bec-9626-22a68f732579@aklaver.com> <273a88dc-4134-47d5-bc19-30ff5f97926c@aklaver.com> <498dfb34-4dd7-4f48-8188-355e1488d7e6@aklaver.com> <1061066336.5835157.1733316137292@mail.yahoo.com> <1918413683.2239751.1733944364448@mail.yahoo.com> <037a8338-3434-47d4-aaad-ef186d4d3250@aklaver.com> <101139100.4053671.1734383960480@mail.yahoo.com> <1875422740.4095620.1734388259706@mail.yahoo.com> <1528119631.4096246.1734390318281@mail.yahoo.com> <2033286177.1733661.1734651404850@mail.yahoo.com> <8833d8c7-3713-4d6f-9eab-35270e769564@aklaver.com> <1392047062.5689697.1734710997053@mail.yahoo.com> <783439164.5695290.1734713539262@mail.yahoo.com> <928427177.4710979.1734722745840@mail.yahoo.com> In-Reply-To: <928427177.4710979.1734722745840@mail.yahoo.com> From: Ron Johnson Date: Fri, 20 Dec 2024 15:25:57 -0500 Message-ID: Subject: Re: any tips to have restricted inbound and getting connected with postgresql dB To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000fd709b0629b97417" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fd709b0629b97417 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 20, 2024 at 2:25=E2=80=AFPM Y_Bharani_mbsv = wrote: > Team > I have the need to have postgresql db running in multiuser mode and do my > needed tasks for few mins. > > How to restrict all the application layer , not to get connected with the > postgres db , > during my specific time window > 1. Create a pg_hba_maintmode.conf with only the relevant hosts in it. 2. Copy pg_hba.conf to pg_hba_multi.conf. 3. Copy pg_hba_maintmode.conf to pg_hba.conf. 4. pg_ctl reload. 5. Use pg_stat_activity and pg_cancel_backend() to kill the application connections. 6. Do your work. 7. Copy pg_hba_multi.conf to pg_hba.conf. 8. pg_ctl reload Or... just shut down the user application. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000fd709b0629b97417 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable --000000000000fd709b0629b97417--