Hello Peter,
Fantastic. It is possible to provide wrappers around most utilities.
I am stuck down on my chair. Cannot believe it...
Cheers,
Jean-Michel POURE
At 16:40 11/11/01 +0100, you wrote:
>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