6.0.0-beta1
7/5/25

[#12712] H3->H5 Migration Postgres problems
Summary H3->H5 Migration Postgres problems
Queue Horde Base
Queue Version 5.1.2
Type Bug
State No Feedback
Priority 1. Low
Owners
Requester skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de
Created 09/26/2013 (4300 days ago)
Due
Updated 01/27/2016 (3447 days ago)
Assigned 10/07/2013 (4289 days ago)
Resolved 01/27/2016 (3447 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
01/27/2016 04:52:47 PM Jan Schneider State ⇒ No Feedback
 
10/07/2013 03:19:28 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
The first part is unnecessary and in incorrect hardcoding. Missing 
sequences are already catched in the migration scripts.

For the second part I'm not sure either. First of all, it should not 
contain and debug code, and the conversion should be unconditionally 
when converting to binary.
Without taking a closer look at the code, the correct fix would 
probably be to do this in the base driver and  loop all values there 
and write them back using Horde_Db_Value.
09/26/2013 01:19:21 PM skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de Comment #1
Priority ⇒ 1. Low
New Attachment: h5_migration_postgresql_SQL_errors.patch.bz2 Download
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ H3->H5 Migration Postgres problems
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
during our migration from Horde3 to Horde5 with a Postgresql database, I
have two problems with SQL commands:

a)
2013-09-25 13:05:09 CEST STATEMENT:  DROP SEQUENCE
turba_shares_share_id_seq CASCADE
2013-09-25 13:05:09 CEST ERROR:  "turba_shares_seq" is not a table
2013-09-25 13:05:09 CEST HINT:  Use DROP SEQUENCE to remove a sequence.

the script tries to drop a squence with DROP TABLE.
Tested on Postgres v8.4.17-0squeeze1.

b)
2013-09-25 13:11:46 CEST STATEMENT:  ALTER TABLE "horde_prefs" ALTER
COLUMN "pref_value" TYPE bytea
2013-09-25 13:11:46 CEST ERROR:  invalid input syntax for type bytea

Postgres cannot cast TEXT to BYTEA, whyever ... .
see
https://drupal.org/node/1031122#comment-6219708
http://www.postgresql.org/docs/8.3/static/datatype-binary.html
http://www.postgresql.org/docs/8.0/static/functions-binarystring.html

Tested on Postgres v8.4.17-0squeeze1 and 8.1.19-0etch1.

=============================================

Attached patch contains a workaround for a) in dropTable()  by using 
DROP SEQUENCE if the name ends in _seq.

For b) I extended Db/Adapter/Postgresql/Schema.php with a special 
conversation text->binary according link #1 above, which seems to be 
backed by the postgresql.org links. One could add the conversion to a 
ALTER TABLE command, but then I had to make the patch larger. The many 
backslashes are required, because first PHP and then SQL expands the 
backslashes a second time, hence, the E'\\\\' becomes plain '\'.

Saved Queries