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 1sMRyl-002Tl9-AO for pgsql-general@arkaria.postgresql.org; Wed, 26 Jun 2024 12:42:27 +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 1sMRyj-004DDq-Er for pgsql-general@arkaria.postgresql.org; Wed, 26 Jun 2024 12:42:25 +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 1sMRyj-004DDh-4B for pgsql-general@lists.postgresql.org; Wed, 26 Jun 2024 12:42:25 +0000 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sMRyh-003eSR-Ay for pgsql-general@lists.postgresql.org; Wed, 26 Jun 2024 12:42:24 +0000 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-5c2237d7aadso295828eaf.2 for ; Wed, 26 Jun 2024 05:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719405741; x=1720010541; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CM3egntO8jD2ZfHjgWbOyLZCKqDMX7Yt0Om58ZDDnfA=; b=EBYObrtY4waSqHcFnZRMNroKuLB5VQ4SE3nx/d3ITt2w/ha2NJmXgm1MCnGmcjL+Cg 86gookQT+8HotHlv4NU3Ce7Uss4LwDFdlpeh3FxhMNWXt56Z9Vr77aISNkIM00l7NyN8 Ao6p3WaVF1/ag++VYeiz+ks1UUDk+sQ4i/wTK0XHpjMXIwAbe8N72g5P93HF5TsYeduh wwMZQYeHAjM4imizJATxHSHMbavKfAhwVPIKgq0NB8nb9Lm/dcCPLlWGbWVZIa5pLCeH 8iejMYidvaaiiOK38mgqxVsC7MnwcWLhmCYehpaSYrmIZ6vn4Mp7Yz/KrrIgzjP1EJ+M fOwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719405741; x=1720010541; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CM3egntO8jD2ZfHjgWbOyLZCKqDMX7Yt0Om58ZDDnfA=; b=ZmDd7WKKLsI/0u7ot8nBQKkfJ0R8T4/RxHJjCoDC3SgGsI5KMhqvk6hHwkMA8qWiTe VbFEXQfVyA9NWQMUad2NtRFZo0zOIopB+hrK/XPtNWYiBYyjgHzZ5n/d+sr3naYJVGsS 01HMXkFfVh241oW7T72rp9Mb/EaJZX51nxs/075k9AncCtVIDOo3kpZmZ+VcExyRimKl 7Lm9biiLl+FRRr8HudFuOY43MWiJPcWkH7bmpiEOw8qnm+muxMIVLUxMsfxY6SORyMbX sQ9ixaYGmWj6faaQP/RXOWATxJJi2gvJUF7qAEOxUseeDqgZUynYvFlq60fEqGL3S+mR +egw== X-Gm-Message-State: AOJu0YwgA5X1tP03QysMSnARcpAwyee7KZbhOPWgNghDs8XUzpPPLw8N ObdemoBahg1B2VQNOJQVyA0hcydKTgxpmCxNHxlwd4Gefx4a2R057cZfNw9B2VlSp8gWokSva73 w1pQKKb2M2h3dB3aVRLGBj4cWoBQQqg== X-Google-Smtp-Source: AGHT+IGsrqUsYd/dggDnUd1PNk5ybbGqOTo62/mat4IMwAj0rh8pOD2aydY0BiZ8OwNhXrHoUEHnJyUtYDVYw2Sh5OQ= X-Received: by 2002:a4a:7646:0:b0:5c2:1baf:7fff with SMTP id 006d021491bc7-5c21baf810dmr3693927eaf.9.1719405741360; Wed, 26 Jun 2024 05:42:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:7f0f:0:b0:539:aa10:6c7 with HTTP; Wed, 26 Jun 2024 05:42:21 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Wed, 26 Jun 2024 05:42:21 -0700 Message-ID: Subject: Re: current_role of caller of a DEFINER function To: Dominique Devienne Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000704ee8061bca58b3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000704ee8061bca58b3 Content-Type: text/plain; charset="UTF-8" On Wednesday, June 26, 2024, Dominique Devienne wrote: > Only session_user > is representative of the caller, and reliable (modulo SUPERUSER and > SET AUTHORIZATION, but that's a different story and kinda normal) > Why can you not use session_user then? David J. --000000000000704ee8061bca58b3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, June 26, 2024, Dominique Devienne <ddevienne@gmail.com> wrote:
Only session_user
is representative of the caller, and reliable (modulo SUPERUSER and
SET AUTHORIZATION, but that's a different story and kinda normal)

Why can you not use session_user then?

David J.
=C2=A0
--000000000000704ee8061bca58b3--