Your message dated Mon, 8 Oct 2007 15:59:53 +0200
with message-id <[EMAIL PROTECTED]>
and subject line Bug#445440: postgresql-client-8.2: pg_restore doesn't seem
able to create a database
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: postgresql-client-8.2
Version: 8.2.4-2
Severity: normal
# pg_restore --cluster 8.2/bacula -U postgres -C -d bacula bacula.dump
pg_restore: [archiver (db)] connection to database "bacula" failed: FATAL:
database "bacula" does not exist
As far as I can tell this is supposed to work. I have a feeling I'm missing
something obvious, but my searches only turned up
http://archives.postgresql.org/pgsql-general/2006-11/msg01442.php.
Details:
1. create new cluster
# pg_createcluster -d /mnt/scratch/var/postgresql/8.2/bacula -l
/mnt/scratch/var/log/postgresql/postgresql-8.2-bacula.log 8.2 bacula
Creating new cluster (configuration: /etc/postgresql/8.2/bacula, data:
/mnt/scratch/var/postgresql/8.2/bacula)...
Moving configuration file
/mnt/scratch/var/postgresql/8.2/bacula/postgresql.conf to
/etc/postgresql/8.2/bacula...
Moving configuration file /mnt/scratch/var/postgresql/8.2/bacula/pg_hba.conf to
/etc/postgresql/8.2/bacula...
Moving configuration file /mnt/scratch/var/postgresql/8.2/bacula/pg_ident.conf
to /etc/postgresql/8.2/bacula...
Configuring postgresqdfl.conf to use port 5434...
It might be relevant that my initial creation attempt failed because the
directory for the log didn't exist (why does it create the directories for the
data but not the log?).
2. Dump schema only from old database
8.2/main has a database bacula. I dumped it with
# pg_dump --cluster 8.2/main -U postgres --format=c --schema-only bacula >
bacula.dump
3. Attempt to recreate the database bacula in the bacula cluster (see initial
command).
I enabled various users, including route, to authenticate as postgres or bacula
when using Unix Domain sockets.
I guess I'll try creating the database by hand.
Or perhaps I need to create a bacula user?
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (990, 'stable'), (50, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.18-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages postgresql-client-8.2 depends on:
ii libc6 2.6.1-1+b1 GNU C Library: Shared libraries
ii libpq5 8.2.4-2 PostgreSQL C client library
ii libreadline5 5.2-3 GNU readline and history libraries
ii libssl0.9.8 0.9.8e-9 SSL shared libraries
ii postgresql-client-commo 78 manager for multiple PostgreSQL cl
ii zlib1g 1:1.2.3.3.dfsg-5 compression library - runtime
postgresql-client-8.2 recommends no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
Am Freitag, 5. Oktober 2007 schrieb Ross Boylan:
> # pg_restore --cluster 8.2/bacula -U postgres -C -d bacula bacula.dump
> pg_restore: [archiver (db)] connection to database "bacula" failed: FATAL:
> database "bacula" does not exist
Quoth the man page:
-C
--create
Create the database before restoring into it. (When this option
is used, the database named with -d is used only to issue the initial
CREATE
DATABASE command. All data is restored into the database name
that appears in the archive.)
So you need to specify a different database with -d to give it place to
connect to in order to create your real database. ("postgres" could work.)
--- End Message ---