Re: Diff/Patch integration -> SQL cvs clone - Mailing list pgsql-hackers

From Serguei Mokhov
Subject Re: Diff/Patch integration -> SQL cvs clone
Date
Msg-id 014901c16aff$0dfeed60$5dd9fea9@gunn
Whole thread Raw
In response to Diff/Patch integration -> SQL cvs clone  (Jean-Michel POURE <jm.poure@freesurf.fr>)
List pgsql-hackers
----- Original Message ----- 
From: Jean-Michel POURE <jm.poure@freesurf.fr>
Sent: Sunday, November 11, 2001 10:41 AM

> Fantastic. It is possible to provide wrappers around most utilities.

Which is not always portable and/or inconsistent, unfortunately;
depending on whether an OS you're running PG on has such utilities
and they behave all in the same way or not...

-s

> >Jean-Michel POURE writes:
> >
> > > Did anyone think of integrating diff/patch within PostgreSQL?
> >
> >CREATE OR REPLACE FUNCTION diff(text, text) RETURNS text AS '
> >#!/bin/sh
> >     echo "$1" > /tmp/$$-one
> >     echo "$2" > /tmp/$$-two
> >     diff -c /tmp/$$-one /tmp/$$-two
> >     echo ""
> >     rm -f /tmp/$$-one /tmp/$$-two
> >' LANGUAGE plsh;
> >
> >peter=> \t\a
> >peter=> select diff('one\ntwo\nthree\n', 'one\nfive\nthree\n');
> >
> >*** /tmp/17580-one      Sun Nov 11 16:09:08 2001
> >--- /tmp/17580-two      Sun Nov 11 16:09:08 2001
> >***************
> >*** 1,4 ****
> >   one
> >! two
> >   three
> >
> >--- 1,4 ----
> >   one
> >! five
> >   three
> >
> >patch() is left as an exercise. ;-)
> >
> >--
> >Peter Eisentraut   peter_e@gmx.net




pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: fts.postgresql.org problem ! still no routing
Next
From: "Christopher Kings-Lynne"
Date:
Subject: regression test database borked