Retrieving the role in a logical replication plugin

Started by Christophe Pettusabout 11 years ago2 messagesgeneral
Jump to latest
#1Christophe Pettus
xof@thebuild.com

I'm working on a 9.4 logical replication plugin, mostly for my own edification, and have run into a limit of my knowledge: How can I retrieve the role (either oid or textual name) associated with the operations my callbacks are receiving? Apologies if it is staring me in the face and I've missed it...
--
-- Christophe Pettus
xof@thebuild.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Michael Paquier
michael@paquier.xyz
In reply to: Christophe Pettus (#1)
Re: Retrieving the role in a logical replication plugin

On Fri, Jan 23, 2015 at 4:20 PM, Christophe Pettus <xof@thebuild.com> wrote:

I'm working on a 9.4 logical replication plugin, mostly for my own edification, and have run into a limit of my knowledge: How can I retrieve the role (either oid or textual name) associated with the operations my callbacks are receiving? Apologies if it is staring me in the face and I've missed it...

I think that you are looking for GetUserNameFromId(GetUserId()) from
miscadmin.h.
Regards,
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general