Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mEHfz-0008Ty-6l for pgsql-general@arkaria.postgresql.org; Thu, 12 Aug 2021 20:51:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mEHfw-0008GM-Kl for pgsql-general@arkaria.postgresql.org; Thu, 12 Aug 2021 20:51:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mEHfw-0008GE-Bz for pgsql-general@lists.postgresql.org; Thu, 12 Aug 2021 20:51:40 +0000 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mEHft-0000Hs-Pk for pgsql-general@lists.postgresql.org; Thu, 12 Aug 2021 20:51:40 +0000 Received: by mail-qv1-xf2c.google.com with SMTP id dk2so3982996qvb.3 for ; Thu, 12 Aug 2021 13:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=+M77J0siD0Upy6pTCX0mhFyVl51hZFhId4+8kHICJDU=; b=ZhV0nKBP5yM8WpebvoTvvp8Ytr8XPEiA2gmkcaVulewrW4GYbiDGvrDLkwfcsUXc1Y DFQe1ggLm7esvDkXjvjKpy6A4BwxvSD0KxpxPObM85XgJ7myU5Knd40BPQeszEbb/fwV ta7YevEtHroxTuThBApGY764tfe/l1UVZYV32ioIOieqxRlcqCPNEZOu4sjDM+skyaNl c1aKyR+Knm6+ARQBJaH60kY9W+C7LigUK9SXhQJjEFAx43HE5qYFSoLKoQ2UWt8yJDbX fD/z9xMDycU1mpvWgScsF+rjcOkuouRRJWKckkwKzJUsXLrxr332T9IduoZU8cjtcnLs WvEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=+M77J0siD0Upy6pTCX0mhFyVl51hZFhId4+8kHICJDU=; b=aZVtflf4oPOaqvhx/Xnbv16ewLPnzLgA6HGFhfO3N0Xhogl5SFIYM1XpaHQP8vXdzL CLp+mCKHz1footKIH6icvmJDwNVWHySdSFQjWsuCh/sZMrRA97nUxXd8CMxAtuLEzrFA m8wjIsdFH8jAPpgHLBnhLyNyO8vpHc8WRs7NsX22aluptkxN9MgdKcxdrGV1hzdWX/Lx a50DO7WHwFlQPPMaeTN6WBW0T+95VMf5aWMw9IZQarQ046ObHvAAAyWhZyGm0NpM9dfj iZghUxgXdWtKTwNE+6algVid2RW5ccxFLaKrKBVNLuwxkqY0h1SIqmwRwShR4fnz/RsV W8ew== X-Gm-Message-State: AOAM532ICZ7dseTf9ktaMSaYdsnG4i4vquXTdr3kRoQGUkYkC/mYQuwi aYgiqYw5hXXD8iUl/i5tubHNlcuxCC6G1Q== X-Google-Smtp-Source: ABdhPJy3BgKfIltnep7YZ8zCZVQDHHFxF0BzTcFbA/P0aTBol2099V+arPR5X1zwogghHS7+OcH9zA== X-Received: by 2002:a0c:c490:: with SMTP id u16mr6048466qvi.26.1628801494277; Thu, 12 Aug 2021 13:51:34 -0700 (PDT) Received: from [192.168.2.100] (pool-100-8-54-81.nwrknj.fios.verizon.net. [100.8.54.81]) by smtp.gmail.com with ESMTPSA id x25sm1992133qkj.31.2021.08.12.13.51.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 13:51:33 -0700 (PDT) Subject: Re: log_statement GUC parameter To: Tom Lane , Adrian Klaver Cc: pgsql-general References: <510207d8-8895-c3cb-e0a1-55135e4ce4f7@gmail.com> <4105997.1628800636@sss.pgh.pa.us> From: Mladen Gogala Message-ID: <4534f313-b374-2dc4-d0a4-5d301981a089@gmail.com> Date: Thu, 12 Aug 2021 16:51:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <4105997.1628800636@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thank you Tom! It turns out that the Oracle way of doing things (SECURITY DEFINER) was the wrong way here. Thanks a bunch. On 8/12/21 4:37 PM, Tom Lane wrote: > ctually, for that specific requirement, there's an easier way: > > ALTER USER target_user SET log_statement = 'all'; > > While the target_user can't do that for himself, a superuser > can. -- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com