Opened 2 years ago

Last modified 20 months ago

#3622 new defect

Darcs revisions break postgres

Reported by: vlstill Owned by:
Priority: major Milestone: 0.9.+
Version: master Keywords: darcs, postgresql
Cc:

Description

When migrating to PostgreSQL Darcs repositories stopped working, the reason is that darcs contexts are much longer then the table column for revision, which has at most 256 characters. I had to perform following modifications of the database:

ALTER TABLE sourcestamps ALTER COLUMN revision TYPE text;
ALTER TABLE changes ALTER COLUMN revision TYPE text;
DROP INDEX IF EXISTS "changes_revision";
CREATE INDEX "changes_revision" ON changes USING hash ( revision );

Could you please change initialization of the database so that this is not necessary? The index change is necessary as btree indices have upper limit on index value size. The error was on 0.9.0rc1 (which is not in you selection list).

Change History (4)

comment:1 Changed 2 years ago by tardyp

  • Milestone changed from undecided to 0.9.+
  • Type changed from undecided to defect
  • Version changed from 0.9.0b9 to master

comment:2 Changed 2 years ago by tardyp

Hi vlstill

The problem is that USING hash is not available under sqlite which is used by a lot of our users, so this is not as simple as that.

I dont understand why darcs did worked for you before with sqlite, as I would expect sqlite is supposed to enforce the varchar length

what is the style of a darcs revision?

In the tests I can see those have this form, which is incoherent with what you say

'got_revision', 'Tue Aug 20 09:18:41 IST 2013 abc@…', 'Darcs')

comment:3 Changed 2 years ago by dustin

I believe sqlite does not enforce column lengths.

Note: See TracTickets for help on using tickets.