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 1ssfPL-009ybB-1W for pgsql-general@arkaria.postgresql.org; Mon, 23 Sep 2024 09:31:03 +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 1ssfPK-0059kL-DV for pgsql-general@arkaria.postgresql.org; Mon, 23 Sep 2024 09:31:02 +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 1ssfPK-0059ii-2B for pgsql-general@lists.postgresql.org; Mon, 23 Sep 2024 09:31:02 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ssfPG-000dzq-Cx for pgsql-general@postgresql.org; Mon, 23 Sep 2024 09:31:01 +0000 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3e03981dad2so2897913b6e.1 for ; Mon, 23 Sep 2024 02:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727083858; x=1727688658; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Ue5HxAEw36VeQs3ZSvXzngEEsaMIOKejR+dvMzGv5WY=; b=XHWhzh1jlE4QmNCIsbdAioxE3YUXbDTGuHmyypD/wLbZJnJ0nz5IMJ5cApDOLHqKy3 x0bLmaRlhI4mkP/awqZ0PjqhIdUgsB4V6OloCK+tSuQDHxXB03OwHg0kB0bLV1KyI5mF 9sJZuL7PGuzJMuNuxH0IwF17kOFnyd4zxjZktAmWpYxypg6xmZPv+I3ArQvBWp726VDW sPaptPkij764TFYX6ibcMIdDHDmfkir8Qh4gNm1sFfpX3KoV3fWlsIhBenZuWZcRyuzP qm2HaJIke4548juaRLKbAae+pc/x8elb6jv3Wjd73n+rTcM8cw8NEpw4qZYPf6EAy8FM z2gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727083858; x=1727688658; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ue5HxAEw36VeQs3ZSvXzngEEsaMIOKejR+dvMzGv5WY=; b=a1Y0EShXqL/GLdyOdbmJUQv3dUgBJwFaEXtRvG9HkL6ftFwFF0nwWFe8wKVZsntWYI 8UKHZYdzikUXOFlEBmXmUoC6t9FgRHRPMsZnW8OSQ+YThNXClaWuP7rbwOQZfp5YKA3j sRgTUkITNPDQLXER4Ys/ej2rhrSX7aP4eUOVG8hGgTi18zAlSeEm2sS8V4dAnY/jD+nq 1cacTYJyZcdZNVZUvd4otJuXGODWwSVdQUHDkWTEZVx4X4+r2x0fzFLLUTmIy+SSD2YX ZL1PBsdeJYydzUehZnvmgjmPww4w4XAhYqOK5c2b9Cf96g1ElnZNneOK0H11VrGp3sOt 5t/A== X-Gm-Message-State: AOJu0YzvpRBTh5JTglHGDKZCnocA73D8tbLilxJ+W7QonJlLpkJVvhm1 QPrxKW5bbJ6OzyzaqSdVlfJqKahkNv4bWc2ZRTHjo5uuj48l3TwtVdpOpBKRCOYAfyzqxg5lHP+ 0cx4bhHEyXh21j/cGDnJIxiLo6uwOzg== X-Google-Smtp-Source: AGHT+IEGv09RpUsUYhuXUv6zBpZwFM/YnGxtC3z4I0RuOnqWJpoLKOC/XJNAx7lRUeaTeBh+eSRq0rh/CPhG3FimcRk= X-Received: by 2002:a05:6808:1820:b0:3e0:468f:7c5b with SMTP id 5614622812f47-3e26a82552fmr6471776b6e.17.1727083858134; Mon, 23 Sep 2024 02:30:58 -0700 (PDT) MIME-Version: 1.0 From: Dominique Devienne Date: Mon, 23 Sep 2024 11:30:46 +0200 Message-ID: Subject: Customize psql prompt to show current_role To: pgsql-general@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi. I've successfully customized my psql PROMPT1, using %n for session_user, but I'd like to see current_role as well. And I can't seem to find a way. I didn't find a direct \x for it. I didn't find a %'X' variable for it. I didn't find a command to %`X` either. (and X = `select current_role` does not work). Surely there's a way, no? Thanks, --DD