In PostgreSQL i work with group permission in the connection. After connected, i execute "SET ROLE <USER_GROUP>". It's working perfect, the current user handles the objects in name of the group.
But... if i work with TUnitable or TUniquery with option "Unidirection=True" show an error that the user hasn´t permission to manipulate the object (table, schema, etc...). It's occurs because a new connection is created with the option Unidirection set as True.
How do I set the connection in this component or create a connection inheriting the configurations of another one?
Thanks in advance,
Eduardo Mendes Camar
PostgreSQL - Unidirection
Re: PostgreSQL - Unidirection
Hello, Eduardo!
If there is no active transaction, PgDAC opens an additional internal connection and starts transaction on this connection, which is not rewarded (execute "SET ROLE <USER_GROUP>) with new privileges.
But it has a solution. You can use the "Unidirectional=True" option to manipulate data.
Use the TPgDataSetOptions.CursorWithHold option to open the query in the FetchAll=False mode without any transaction.
When CursorWithHold is True, PgDAC uses the DECLARE CURSOR ... WITH HOLD statement to open the query. In this case no active transaction is required but this may take additional server resources.
P.S.: Or start a transaction yourself.
If there is no active transaction, PgDAC opens an additional internal connection and starts transaction on this connection, which is not rewarded (execute "SET ROLE <USER_GROUP>) with new privileges.
But it has a solution. You can use the "Unidirectional=True" option to manipulate data.
Use the TPgDataSetOptions.CursorWithHold option to open the query in the FetchAll=False mode without any transaction.
When CursorWithHold is True, PgDAC uses the DECLARE CURSOR ... WITH HOLD statement to open the query. In this case no active transaction is required but this may take additional server resources.
P.S.: Or start a transaction yourself.