Subject Re: [firebird-support] Problem restoring with gbak
Author Helen Borrie
At 09:06 AM 25/10/2005 +0000, you wrote:
>I've just been trying to test a backup/restore with gbak, and I'm
>getting this error message in the restore (to a new file):
>gbak: restoring privilege for user SRMAX
>gbak: ERROR: action cancelled by trigger (1) to preserve data
>gbak: ERROR: could not find column for GRANT
>gbak: Exiting before completion due to errors
>Can anyone explain possible causes of this?

Well, it encountered a GRANT statement like, e.g.


and it discovered that aField doesn't exist in aTable. A likely cause
could be that the column is actually defined as "aField" - quoted
identifiers and case-sensitive.

>I've had some niggles with privileges in this database before, with
>an unexpected lack of rights on particular fields.
>Examining the verbose output of gbak and opening the restored
>database with IBExpert suggests all the database structure and data
>is there, so I'm hoping security is the last stage of the restore.

It is.

Open the database with a tool that can show you the system tables and
inspect the privileges in RDB$USER_PRIVILEGES for SRMAX. Or just use a
query to get at the data you need to look at:

rdb$grantor, rdb$user,
rdb$field_name from rdb$user_privileges
where rdb$user = 'SRMAX'
and rdb$relation_name not starting with 'RDB$'
and rdb$field_name is not null