Re: Diff/Patch integration -> SQL cvs clone

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Diff/Patch integration -> SQL cvs clone
Date: 2001-11-22 03:11:30
Message-ID: 200111220311.fAM3BU408930@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-hackers


Peter, should plsh be added to our supplied server-side programming
languages? Seems like a major feature to me and to others as well.

---------------------------------------------------------------------------

> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Tom Lane 2001-11-22 03:36:52 Re: Diff/Patch integration -> SQL cvs clone
Previous Message Dave Page 2001-11-16 21:12:31 FW: [pgsql-www] FW: http://pgadmin.postgresql.o rg does not work

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-11-22 03:12:30 Re: rename index?
Previous Message Tom Lane 2001-11-22 03:11:12 Re: rename index?