Postgres conflict - ERROR: permission denied for relation dbvisittest

When you hit error conflict, Dbvrep console will provide you an exact error message from destination database server. Dbvisit Replicate doesn't translate these messages. Sometimes, it's easier to understand the message. Sometimes, it's harder. It depends mainly on user's knowledge and experience. 


Problem Details

Problem Statement

Conflict on the newly added table to DBVisit Replication

Applicable Error Code

Error: ERROR: permission denied for relation dbvisittest

Affected Versions

2.9.00+


Description

The error - 'ERROR: permission denied for relation dbvisittest' - is completely different than the similar one you can meet on Oracle Server - 'ORA-00942: table or view does not exist' or 'ORA-01950: no privileges on tablespace 'USERS''. Alright, it's different just on first look. 

In the error message is mentioned permission issue. In the conflict, you can see you're unable to insert a record into the table. You can skip scenarios of a non-existent table on the target database. In that case error message is: 'ERROR: relation "msi.dbvisittest" does not exist at character 13'

Since you haven't privilege on the table it's obvious you create a table with another user. Connect with the particular user or superuser (dbviist_admin or postgres) and grant privileges to right user - the one you're using for dbvisit replicate (you can find out by executing: 'show parameter APPLY.APPLY_USER' in dbvrep console)

Solution

In my case, it was simple to fix. 

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema TO login;

 

If it won't help you grant usage on the SCHEMA to your user.

GRANT USAGE ON SCHEMA schema TO login;