Re: Diff/Patch integration -> SQL cvs clone

Lists: pgadmin-hackersPostg토토 캔SQL :
From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Diff/Patch integration -> SQL cvs clone
Date: 2001-11-10 17:29:56
Message-ID: 4.2.0.58.20011110181543.00d292a0@pop.freesurf.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers Postg토토SQL : Postg토토SQL

Dear all,

I need to store text documents in PosgreSQL with revision management.
Chora PHP cvs library can be used for this purpose.

Did anyone think of integrating diff/patch within PostgreSQL?
If it were the case, we could build the first SQL CVS clone...

Best regards, Jean-Michel POURE


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Diff/Patch integration -> SQL cvs clone
Date: 2001-11-11 15:40:26
Message-ID: Pine.LNX.4.30.0111111607350.647-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers Postg토토 사이트 순위SQL

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


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
Lists: Postg스포츠 토토SQL : Postg스포츠 토토 베트맨SQL

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


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: 014901c16aff014901c16aff$0dfeed60$5dd9fea9@gunndfeed60dd9fea9@gunn
Views: Raw Message | Whole Thread | Download mbox | Resend email
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


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
Lists: Postg토토 사이트SQL : 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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, 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:36:52
Message-ID: 27901.1006400212@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Peter, should plsh be added to our supplied server-side programming
> languages? Seems like a major feature to me and to others as well.

While plsh is surely a cool hack, I've got considerable unease about
making it into an officially supported feature. The only reasons I can
see for wanting to use it (over plpgsql, pltcl, plperl, etc) are
inherently violations of transaction semantics. Who's going to roll
back your sendmail call when the calling transaction later aborts?
What's going to ensure that the order of external effects has something
to do with the serialization order that the database assigns to several
concurrent transactions?

IMHO plsh is a great tool for shooting yourself in the foot (with a
large-gauge firearm, in fact). People who know what they're doing are
welcome to use it ... but those sorts of people can find and install
it for themselves.

Of course the same worries apply to the untrusted variants of pltcl,
plperl, etc. Perhaps we need to document the risks they carry. But
plsh hasn't even got the possibility of a trusted variant :-(

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, 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:44:38
Message-ID: 200111220344.fAM3ic811924@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Peter, should plsh be added to our supplied server-side programming
> > languages? Seems like a major feature to me and to others as well.
>
> While plsh is surely a cool hack, I've got considerable unease about
> making it into an officially supported feature. The only reasons I can
> see for wanting to use it (over plpgsql, pltcl, plperl, etc) are
> inherently violations of transaction semantics. Who's going to roll
> back your sendmail call when the calling transaction later aborts?
> What's going to ensure that the order of external effects has something
> to do with the serialization order that the database assigns to several
> concurrent transactions?
>
> IMHO plsh is a great tool for shooting yourself in the foot (with a
> large-gauge firearm, in fact). People who know what they're doing are
> welcome to use it ... but those sorts of people can find and install
> it for themselves.
>
> Of course the same worries apply to the untrusted variants of pltcl,
> plperl, etc. Perhaps we need to document the risks they carry. But
> plsh hasn't even got the possibility of a trusted variant :-(

Yes, I see your point, but if you need to do something in the operating
system, like send mail, you are stuck with leaving transactions
semantics and security anyway. If they have to leave those anyway, why
not give them simple shell scripts?

--
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


From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
To: pgsql-hackers(at)postgresql(dot)org
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: ALTER OR REPLACE feature
Date: 2001-11-22 11:01:54
Message-ID: 200111221101.fAMB1sN04555@www1.translationforge
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers pgsql-hackers

Dear friends

I was surprised to notice that INTERBASE already has more than a dozen
graphical administration interfaces:
- http://www.interbase2000.org/tools_dbman.htm,
- http://delphree.clexpert.com.

In my dreams, I would welcome ALTER OR REPLACE VIEW + ALTER OR REPLACE
TRIGGER (sorry, this is on my whish list again). Without these two features,
this is not easily ***possible*** to build a graphical admin & IDE interface
for PostgreSQL.

KDE3/QT3 makes it possible to build cross-platform database administration
tools. We don't need a dozen of them, just one good IDE with migration
features from MySQL, Oracle, MS SQL, Interbase...

The community is waiting for ALTER OR REPLACE, my friends... We also need
ALTER TABLE DROP FIELD, but this is probably more tricky.

Cheers,
Jean-Michel POURE


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: jm(dot)poure(at)freesurf(dot)fr
Cc: pgsql-hackers(at)postgresql(dot)org, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] ALTER OR REPLACE feature
Date: 2001-11-22 11:44:01
Message-ID: 3BFCE501.C4B480A3@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers Postg범퍼카 토토SQL

Jean-Michel POURE wrote:
>
> Dear friends
>
> I was surprised to notice that INTERBASE already has more than a dozen
> graphical administration interfaces:
> - http://www.interbase2000.org/tools_dbman.htm,
> - http://delphree.clexpert.com.
>
> In my dreams, I would welcome ALTER OR REPLACE VIEW + ALTER OR REPLACE
> TRIGGER (sorry, this is on my whish list again). Without these two features,
> this is not easily ***possible*** to build a graphical admin & IDE interface
> for PostgreSQL.
>
> KDE3/QT3 makes it possible to build cross-platform database administration
> tools. We don't need a dozen of them, just one good IDE with migration
> features from MySQL, Oracle, MS SQL, Interbase...

Check out TOra - this is currently for Oracle only, but teher is no
inherent
reason why you can't alter it for others.

> The community is waiting for ALTER OR REPLACE, my friends... We also need
> ALTER TABLE DROP FIELD, but this is probably more tricky.
>
> Cheers,
> Jean-Michel POURE
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster


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 17:18:33
Message-ID: 200111221718.fAMHIX713830@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 503 사설 토토 사이트 페치 503 토토 꽁 머니 페치

> Bruce Momjian writes:
>
> > Peter, should plsh be added to our supplied server-side programming
> > languages? Seems like a major feature to me and to others as well.
>
> I get mail from people that are using it for some pretty ugly
> applications. Not the sort of stuff we want to let loose on newbies. I
> should probably stick a warning in there somewhere.

Yes, if we outline the cases where they should/shouldn't be use plsh, it
seems fine to me.

Added to TODO:

* Add plsh server-side shell language (Peter E)

--
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


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
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 17:21:30
Message-ID: Pine.LNX.4.30.0111221755240.766-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers Postg토토 캔SQL :

Bruce Momjian writes:

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

I get mail from people that are using it for some pretty ugly
applications. Not the sort of stuff we want to let loose on newbies. I
should probably stick a warning in there somewhere.

--
Peter Eisentraut peter_e(at)gmx(dot)net