Subject Re: [firebird-support] Re: Programmatically using GBAK
Author Helen Borrie
At 11:19 PM 28/03/2006, you wrote:
> > Not correct. The -c[reate_database] and
> > -r[eplace_database] switches are mutually exclusive.
>
>I have never had a problem with using them both together, starting
>with InterBase 4.0 up until today ;-) It does exactly what I want:
>delete the current database and overwrite it with the database from
>the backup file.

It would do the same with only the -R switch. The point you missed
is that your statement was wrong: it is just not true that you
require both switches. They *are* mutually exclusive. Both recreate
a database from a backup file; the difference is this:

switch -R deletes a database of the same name as the specified file
name for the restore, before creating a new database (or fails if the
old file is locked);

switch -C will fail if there is a database file already in the
location with the same name as that specified for the restore.

The other difference is of ownership. Only SYSDBA or the Owner may
perform a -r[eplace_databse] restore; whereas any user can perform a
-c[reate_database] restore.


> > However, NOBODY should use the -r switch unless
> > s/he really knows what s/he is doing.
>
>Nobody should use ANY switch unless s/he really knows what s/he is
>doing ;-)

And nobody should use use *both* switches even if s/he has been lucky
for all those years. ;-)

>Especially in development work, entirely replacing a database with one
>from a backup is quite common.

In the outback, letting tractors drive on their own is quite
common; but it's not advisable to let a driverless tractor loose in town.

./heLen