For postgresql 'drush sql-dump --structure-tables' will generate 2 invocations of pg_dump; but only the first one get the --clean option set. The result is that the structure-tables will not be updated and lot of error noise is shown when you try to apply the dump. Patch applied to fix this problem.

Comments

moshe weitzman’s picture

Assigned: Unassigned » greg.1.anderson
gaas’s picture

Version: 7.x-4.5 » 7.x-5.8
StatusFileSize
new911 bytes

Updated the patch so that it applies against the current 7.x-5.x branch.

steinmb’s picture

Status: Active » Reviewed & tested by the community

Ah, this patch fixed that issue for me also. Looks to me like a safe one liner, RTBC.

moshe weitzman’s picture

Version: 7.x-5.8 » 8.x-6.x-dev

@Greg - does this one liner look ok?

Should go into 8.x-6.x first

greg.1.anderson’s picture

I'm okay with committing this, as it looks more correct with the consistent use of --clean than without.

However, I get the same set of errors from psql with and without this patch:

ERROR:  relation "TABLE" already exists
ERROR:  multiple primary keys for table "TABLE" are not allowed
ERROR:  relation "TABLE" already exists

Where TABLE is some table specified by --structure-tables.

If you just want to go ahead and commit this based on #3, I'm fine with that.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 6. This needs more testing before backporting to 5 as per Greg's last comment.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.