Re: Diff/Patch integration -> SQL cvs clone

From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: Diff/Patch integration -> SQL cvs clone
Date: 2001-11-11 15:41:04
Message-ID: 4.2.0.58.20011111163530.00d4b2e0@pop.freesurf.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-hackers

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(at)gmx(dot)net

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Serguei Mokhov 2001-11-11 22:20:12 Re: Diff/Patch integration -> SQL cvs clone
Previous Message Peter Eisentraut 2001-11-11 15:40:26 Re: Diff/Patch integration -> SQL cvs clone

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-11-11 15:41:18 Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed
Previous Message Peter Eisentraut 2001-11-11 15:40:54 Re: [COMMITTERS] pgsql/src/backend/postmaster postmaster.c