Colin Manning wrote:
Hi All,

I have been running dbmail 1.2.10 (pg 7.3.4-11) for a while now, but the
machine I am running on is getting flaky, so I want to upgrade the
hardware. I thought I'd update to dbmail 2.0.4 (pg 7.3.4-11) at the same
time.

I dumped the database with :
pg_dump -f dbmail.all -C dbmail

then load with pgsql -U dbmail < dbmail.all

When I run the migrate script I get:

I get the following output:
dbmail=# \i migrate_from_1.x_to_2.0.pgsql
BEGIN
psql:migrate_from_1.x_to_2.0.pgsql:28: ERROR:  Relation
'auto_notification_seq' already exists
psql:migrate_from_1.x_to_2.0.pgsql:33: ERROR:  current transaction is
aborted, queries ignored until end of transaction block
psql:migrate_from_1.x_to_2.0.pgsql:35: ERROR:  current transaction is
aborted, queries ignored until end of transaction block
psql:migrate_from_1.x_to_2.0.pgsql:40: ERROR:  current transaction is
aborted, queries ignored until end of transaction block

Which is OK. Those CREATE statements are isolated in a separate transaction. Nothing lost if that one fails.

COMMIT
BEGIN
DROP INDEX
DROP INDEX
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
CREATE INDEX
CREATE INDEX
DROP INDEX
psql:migrate_from_1.x_to_2.0.pgsql:61: NOTICE:  constraint $1 on table
mailboxes depends on index users_id_idx
psql:migrate_from_1.x_to_2.0.pgsql:61: ERROR:  Cannot drop index
users_id_idx because other objects depend on it
        Use DROP ... CASCADE to drop the dependent objects too
psql:migrate_from_1.x_to_2.0.pgsql:62: ERROR:  current transaction is
aborted, queries ignored until end of transaction block
psql:migrate_from_1.x_to_2.0.pgsql:63: ERROR:  current transaction is
aborted, queries ignored until end of transaction block
psql:migrate_from_1.x_to_2.0.pgsql:64: ERROR:  current transaction is
aborted, queries ignored until end of transaction block

So your 1.2 tables were not quite standard. In that case all bets are of regarding the migration script. I'm guessing you may have experimented with the auto_notify or auto_reply feature some time in the past, and may have created an foreign key constraint from either of those on the user_id_idx index.

try diffing you 1.2 schema with the stock 1.2 schema:

createdb db1_stock
psql db1_stock < dbmail-1.2.11/sql/postgresql/create_tables.pgsql
pg_dump -s dbmail > /tmp/dbmail.sql
pg_dump -s db1_stock > /tmp/db1_stock.sql
diff -u /tmp/dbmail.sql /tmp/db1_stock.sql

etc....



--
  ________________________________________________________________
  Paul Stevens                                  mailto:[EMAIL PROTECTED]
  NET FACILITIES GROUP                     PGP: finger [EMAIL PROTECTED]
  The Netherlands________________________________http://www.nfg.nl

Reply via email to