Mantis Bugtracker 

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007893TestLinkDatabase Postgrespublic2017-03-20 20:012017-03-20 20:45
Assigned To 
PlatformOSOS Version
Product Version1.9.16 (2016 Q4) 
Fixed in Version 
Summary0007893: Upgrade TL 1.9.15 to TL 1.9.16 fails on PostgreSQL - syntax failures in db_schema_update.sql
Descriptiontrying to upgrade my TL 1.9.15 installation, running on PostgreSQL 9.2.19 with
- alter_tables\1.9.16\postgres\DB.1.9.16\step1\db_schema_update.sql
fails, cause
a) the psql command ALTER TABLE is called with a wrong syntax - ADD COLUMN does not use SET DATA TYPE - details see [^]
b) the psql command ADD PRIMARY KEY includes a syntax failure - a missing closing "
c) the last line includes a none sql statement
Steps To Reproducepsql -h localhost -U tlink -f alter_tables\1.9.16\postgres\DB.1.9.16\step1\db_schema_update.sql testlink

psql:db_schema_update.sql:7: FEHLER: Syntaxfehler bei »DATA«
ZEILE 1: ...prefix*/execution_bugs ADD COLUMN "tcstep_id" SET DATA TYPE ...
psql:db_schema_update.sql:10: FEHLER: Bezeichner in Anführungszeichen nicht abgeschlossen bei »"tcstep_id);
ZEILE 1: ...ion_bugs ADD PRIMARY KEY ("execution_id","bug_id","tcstep_id...
Additional InformationSuggestion for Fix:

Replace the four lines

ALTER TABLE /*prefix*/execution_bugs ADD COLUMN "tcstep_id" SET DATA TYPE BIGINT NOT NULL DEFAULT '0';
ALTER TABLE /*prefix*/execution_bugs DROP CONSTRAINT /*prefix*/execution_bugs_pkey;
ALTER TABLE /*prefix*/execution_bugs ADD PRIMARY KEY ("execution_id","bug_id","tcstep_id);

with the tree lines

ALTER TABLE /*prefix*/execution_bugs ADD COLUMN "tcstep_id" BIGINT NOT NULL DEFAULT '0';
ALTER TABLE /*prefix*/execution_bugs DROP CONSTRAINT /*prefix*/execution_bugs_pkey;
ALTER TABLE /*prefix*/execution_bugs ADD PRIMARY KEY ("execution_id","bug_id","tcstep_id");
TagsNo tags attached.
Database (MySQL,Postgres,etc)PostgreSQL 9.2.19
PHP Version
QA Team - Task Workflow Status
Attached Files

- Relationships
duplicate of 0007819new POSTGRESQL - error while upgrading from 1.9.14 to 1.9.16 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-03-20 20:01 lczub New Issue
2017-03-20 20:45 fman Relationship added duplicate of 0007819

Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker