Subject Re: [firebird-support] gbak -c with existing database
Author Helen Borrie
At 12:07 AM 8/04/2006, you wrote:
>At 11:58 PM 7/04/2006, you wrote:
> >Hi all,
> >
> >using FB 1.5.x, gbak -c with an existing database file and a user
> >which isn't the database's owner works : the database is replaced by the
> >backup and the owner has changed ! IMHO it's an odd behaviour, I
> >expected gbak would raise an error like 'file already exists...' or
> >'bad database owner...' or something else. I made another test, just
> >replacing -c by -r and then it raised an error "[...] cannot restore
> >over current database[...]" which is logical.
> >
> >Is it an intended behaviour, and I have misunderstoud something, or a
> >bug in FB ?

Looks like a bug - though it only seems to affect a restore done
locally, i.e. without the service manager. Here's my scroll, with
comments. (isc_user and isc_password are set here):

C:\Program Files\Firebird\Firebird_1_5\bin>gbak
l:\data\examples\employee.fdb l:\data\examples\employee.fbk

C:\Program Files\Firebird\Firebird_1_5\bin>gbak -r
l:\data\examples\employee.fbk L:\data\examples\employee.fdb
(as expected)

C:\Program Files\Firebird\Firebird_1_5\bin>gbak -c
l:\data\examples\employee.fbk L:\data\examples\employee.fdb
gbak: ERROR: database L:\data\examples\employee.fdb already
exists. To replace it, use the -R switch
gbak: Exiting before completion due to errors
(as expected)

C:\Program Files\Firebird\Firebird_1_5\bin>gbak -c
l:\data\examples\employee.fbk L:\data\examples\employee.fdb -user
helen -password helen
(***Not as expected****)

C:\Program Files\Firebird\Firebird_1_5\bin>gbak -c -se
localhost:service_mgr l:\
data\examples\employee.fbk L:\data\examples\employee.fdb -user helen
-password helen
gbak: ERROR: database L:\data\examples\employee.fdb already
exists. To replace it, use the -R switch
gbak: Exiting before completion due to errors
(as expected)
C:\Program Files\Firebird\Firebird_1_5\bin>

Thanks for the report - it has been passed on.

./heLen