Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.7
-
None
Description
[avisbits@bitmag-devel01 postgres]$ psql -d checksum1checksums -f checksumDB3to4Migration.sql
UPDATE 1
DROP INDEX
ALTER TABLE
UPDATE 32487
ALTER TABLE
psql:checksumDB3to4Migration.sql:31: ERROR: syntax error at or near "RENAME"
LINE 1: RENAME COLUMN checksums.calculationdate2 TO calculationdate;
^
psql:checksumDB3to4Migration.sql:32: ERROR: relation "audittrail" does not exist
psql:checksumDB3to4Migration.sql:34: ERROR: column "calculationdate" does not exist
The problem consists of two parts:
1) The SQL statement to rename the 'calculationdate2' column to calculationdate uses SQL syntax for Derby which postgres does not understand.
2) The SQL statements attempt to alter a column not present in the table. It's a statement which probably is a leftover from another migration script which were the base for this migration script.
For failed migrations the following SQL is needed:
[code]
ALTER TABLE checksums RENAME COLUMN calculationdate2 TO calculationdate;
CREATE INDEX calculationindex ON checksums ( calculationdate );
[code]