Re: Diff/Patch integration -> SQL cvs clone

From: "Serguei Mokhov" <sa_mokho(at)alcor(dot)concordia(dot)ca>
To: <pgsql-hackers(at)postgresql(dot)org>, "Jean-Michel POURE" <jm(dot)poure(at)freesurf(dot)fr>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Subject: Re: Diff/Patch integration -> SQL cvs clone
Date: 2001-11-11 22:20:12
Message-ID: 014901c16aff$0dfeed60$5dd9fea9@gunn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-hackers

----- Original Message -----
From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)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(at)gmx(dot)net

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Jean-Michel POURE 2001-11-16 11:10:09 http://pgadmin.postgresql.org does not work
Previous Message Jean-Michel POURE 2001-11-11 15:41:04 Re: Diff/Patch integration -> SQL cvs clone

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-11-12 02:25:42 regression test database borked
Previous Message Oleg Bartunov 2001-11-11 22:05:52 fts.postgresql.org problem ! still no routing