Re: diff-/patch-functionality for text-type data inside PostgreSQL

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Markus Wollny <Markus(dot)Wollny(at)computec(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: diff-/patch-functionality for text-type data inside PostgreSQL
Date: 2009-05-04 13:30:23
Message-ID: 20090504133023.GB26374@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Buś 2009-05-04 13:41:59 Re: could not bind IPv4 socket
Previous Message Adrian Klaver 2009-05-04 13:18:53 Re: could not bind IPv4 socket