Re: diff-/patch-functionality for text-type data inside PostgreSQL - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: diff-/patch-functionality for text-type data inside PostgreSQL
Date
Msg-id 20090504133023.GB26374@svana.org
Whole thread Raw
In response to diff-/patch-functionality for text-type data inside PostgreSQL  ("Markus Wollny" <Markus.Wollny@computec.de>)
Responses Re: diff-/patch-functionality for text-type data insidePostgreSQL
List pgsql-general
On Mon, May 04, 2009 at 12:26:13PM +0200, Markus Wollny wrote:
> So far I have been playing around with PL/PerlU for diff/path
> functionality, using CPAN modules Text::Diff and Text::Patch, but
> haven't been too successful, as there seems to be some issue with this
> mechanism if the text data doesn't contain newlines. Just as an
> off-topic info, because it's some issue with the CPAN modules, not with
> PostgreSQL:

I've used the Algorithm::Diff module in the past with success. It works
on sequences of objects rather than just text but it works well. That
means you can diff on word or character level at your choice, and even
control what sequences you consider "equal". That said, it doesn't have
a patch function but that should be fairly easy to make. You'll need to
define your own storage format for the diff though.

http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/lib/Algorithm/Diff.pm

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Attachment

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: could not bind IPv4 socket
Next
From: Grzegorz Buś
Date:
Subject: Re: could not bind IPv4 socket