From: Ц <pfunk@mail.ru>
To: pgsql-general@lists.postgresql.org
Subject: Invalid name syntax on to_regrole(session_user)
Date: Tue, 14 Apr 2020 15:47:59 +0300
Message-ID: <1586868479.588975920@f425.i.mail.ru> (raw)
In-Reply-To: <158686573592.9421.7178775688662332959@malur.postgresql.org>
References: <158686573592.9421.7178775688662332959@malur.postgresql.org>
Hello!
I store pg_roles.oid::int as numeric representation of database role.
Now I need to get this number for session user.
I used to_regrole(session_user) function.
Everything works fine till I allow roles with dots in role`s name.
create role "dot.net"
set session authorization 'dot.net';
select to_regrole(session_user); ERROR: invalid name syntax
Is it expected behavior that session_user produces non quoted output and I should use quote_ident anywhere in code session_user?
Is there other way (without extra type conversions) for getting oid of session_user?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pfunk@mail.ru
Subject: Re: Invalid name syntax on to_regrole(session_user)
In-Reply-To: <1586868479.588975920@f425.i.mail.ru>
References: <158686573592.9421.7178775688662332959@malur.postgresql.org> <1586868479.588975920@f425.i.mail.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox