Re: calling webservice through postgresql function

Lists: pgsql-sql
From: "Jyoti Seth" <jyotiseth2001(at)gmail(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: calling webservice through postgresql function
Date: 2007-07-13 07:14:31
Message-ID: 00b101c7c51d$7754fb50$65fef1f0$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Hi all,

I want to call webservice from my postgresql database. Please let me know if
anyone has idea.

Thanks,

Jyoti Seth


From: Richard Huxton <dev(at)archonet(dot)com>
To: Jyoti Seth <jyotiseth2001(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: calling webservice through postgresql function
Date: 2007-07-13 07:26:40
Message-ID: 46972930.30301@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Jyoti Seth wrote:
> Hi all,
>
> I want to call webservice from my postgresql database. Please let me know if
> anyone has idea.

You can use any of the "untrusted" procedural languages to access
resources outside the database (e.g. pl/perlu), or of course C.

--
Richard Huxton
Archonet Ltd


From: "Jyoti Seth" <jyotiseth2001(at)gmail(dot)com>
To: "'Richard Huxton'" <dev(at)archonet(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: calling webservice through postgresql function
Date: 2007-07-13 07:31:30
Message-ID: 00b601c7c51f$d775d430$86617c90$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Thanks a lot for ur quick response. I have searched a lot on net for code to
call a webservice through tcl/tk or any other scripting lang that is
supported by postgresql, but couldn't find one. If u can provide me some
code to call a web service through postgresql it would be a great help.

Thanks,
Jyoti Setj

-----Original Message-----
From: Richard Huxton [mailto:dev(at)archonet(dot)com]
Sent: Friday, July 13, 2007 12:57 PM
To: Jyoti Seth
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] calling webservice through postgresql function

Jyoti Seth wrote:
> Hi all,
>
> I want to call webservice from my postgresql database. Please let me know
if
> anyone has idea.

You can use any of the "untrusted" procedural languages to access
resources outside the database (e.g. pl/perlu), or of course C.

--
Richard Huxton
Archonet Ltd


From: Richard Huxton <dev(at)archonet(dot)com>
To: Jyoti Seth <jyotiseth2001(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: calling webservice through postgresql function
Date: 2007-07-13 07:37:46
Message-ID: 46972BCA.5050605@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Jyoti Seth wrote:
> Thanks a lot for ur quick response. I have searched a lot on net for code to
> call a webservice through tcl/tk or any other scripting lang that is
> supported by postgresql, but couldn't find one. If u can provide me some
> code to call a web service through postgresql it would be a great help.

Just use pl/perlu (or pythonu or tclu) in whatever way you would
normally "call a webservice". That side of things has nothing to do with
PG (other than the fact that it will hold up your query).

If you don't know how to "call a webservice" then you'll need to check
with one of the developer forums for your language of choice I'm afraid.

--
Richard Huxton
Archonet Ltd


From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: calling webservice through postgresql function
Date: 2007-07-13 07:46:18
Message-ID: 20070713074618.GA32089@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

am Fri, dem 13.07.2007, um 13:01:30 +0530 mailte Jyoti Seth folgendes:
> Thanks a lot for ur quick response. I have searched a lot on net for code to
> call a webservice through tcl/tk or any other scripting lang that is
> supported by postgresql, but couldn't find one. If u can provide me some
> code to call a web service through postgresql it would be a great help.

As Richard says, use an untrusted language like pl/perlU (U means
untrusted) to call arbitrary external programs.

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net


From: Dmitry Turin <sql4-en(at)narod(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [OBORONA-SPAM] calling webservice through postgresql function
Date: 2007-07-16 13:18:57
Message-ID: 414476065.20070716161857@narod.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Good day, Jyoti.

JS> I want to call webservice from my postgresql database. Please let me know if anyone has idea.

Idia or proper tool?
If idea, I offer to append some code into source of pg.

I already raised this question in topic
"We all are looped on Internet",
in which i read, that the most widespread transport protocol is HTTP,
and the most general format for data is XML (XHTML).
Idea is so: if we made

create table a (
id num primary key,
data float
);
create table b (
id num primary key,
ref num references a(id),
data float
);
create table c (
id num primary key,
link num references b(id),
data float
);
insert into a values (1, 12.3);
insert into b values (10, 1, 23.4);
insert into b values (20, 1, 34.5);
insert into b values (30, 1, 45.6);
insert into c values (100,10,56.7);
insert into c values (101,10,67.8);
insert into c values (200,20,78.9);
insert into c values (201,20,89.1);
insert into c values (300,30,91.2);

we need simple request 'a.b.c' to get

<a id=1 data=12.3>
<b id=10 data=23.4>
<c id=100 data=56.7/>
<c id=101 data=67.8/>
</b>
<b id=20 data=34.5>
<c id=200 data=78.9/>
<c id=201 data=89.1/>
</b>
<b id=30 data=45.6>
<c id=200 data=91.2/>
</b>
</a>

Request 'a.b.c' allow to avoid php,etc,
that is very necessary for unskilled users!

Details are on:
http://sql40.chat.ru/site/sql40/en/author/introduction_eng.htm
http://sql40.chat.ru/site/sql40/en/author/determination_eng.htm
http://sql40.chat.ru/site/sql40/en/author/inout_eng.htm

Dmitry Turin
HTML6 (6.1.2) http://html60.chat.ru
SQL4 (4.1.2) http://sql40.chat.ru
Unicode2 (2.0.0) http://unicode2.chat.ru
Computer2 (2.0.3) http://computer20.chat.ru


From: "Jyoti Seth" <jyotiseth2001(at)gmail(dot)com>
To: "'Dmitry Turin'" <sql4-en(at)narod(dot)ru>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [OBORONA-SPAM] calling webservice through postgresql function
Date: 2007-07-17 05:18:41
Message-ID: 002e01c7c831$f2b61380$d8223a80$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Hello Dmity,

As suggested by Richard Huxton in this forum we can use any of the
"untrusted" procedural languages to access resources outside the database
(e.g. pl/perlu).

You can get the code to call the webservice from the postgresql function
from this url. http://www.pgsql.cz/index.php/PL/Perlu_-_Untrusted_Perl_(en)

Thanks,
Jyoti

-----Original Message-----
From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org]
On Behalf Of Dmitry Turin
Sent: Monday, July 16, 2007 6:49 PM
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [OBORONA-SPAM] [SQL] calling webservice through postgresql
function

Good day, Jyoti.

JS> I want to call webservice from my postgresql database. Please let me
know if anyone has idea.

Idia or proper tool?
If idea, I offer to append some code into source of pg.

I already raised this question in topic
"We all are looped on Internet",
in which i read, that the most widespread transport protocol is HTTP,
and the most general format for data is XML (XHTML).
Idea is so: if we made

create table a (
id num primary key,
data float
);
create table b (
id num primary key,
ref num references a(id),
data float
);
create table c (
id num primary key,
link num references b(id),
data float
);
insert into a values (1, 12.3);
insert into b values (10, 1, 23.4);
insert into b values (20, 1, 34.5);
insert into b values (30, 1, 45.6);
insert into c values (100,10,56.7);
insert into c values (101,10,67.8);
insert into c values (200,20,78.9);
insert into c values (201,20,89.1);
insert into c values (300,30,91.2);

we need simple request 'a.b.c' to get

<a id=1 data=12.3>
<b id=10 data=23.4>
<c id=100 data=56.7/>
<c id=101 data=67.8/>
</b>
<b id=20 data=34.5>
<c id=200 data=78.9/>
<c id=201 data=89.1/>
</b>
<b id=30 data=45.6>
<c id=200 data=91.2/>
</b>
</a>

Request 'a.b.c' allow to avoid php,etc,
that is very necessary for unskilled users!

Details are on:
http://sql40.chat.ru/site/sql40/en/author/introduction_eng.htm
http://sql40.chat.ru/site/sql40/en/author/determination_eng.htm
http://sql40.chat.ru/site/sql40/en/author/inout_eng.htm

Dmitry Turin
HTML6 (6.1.2) http://html60.chat.ru
SQL4 (4.1.2) http://sql40.chat.ru
Unicode2 (2.0.0) http://unicode2.chat.ru
Computer2 (2.0.3) http://computer20.chat.ru

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


From: Dmitry Turin <sql4-en(at)narod(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: calling webservice through postgresql function
Date: 2007-07-27 06:40:13
Message-ID: 467967778.20070727094013@narod.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Good day, Jyoti.

JS> we can use any of the "untrusted" procedural languages
JS> http://www.pgsql.cz/index.php/PL/Perlu_-_Untrusted_Perl_(en)
What !! There is no need to have
CREATE OR REPLACE FUNCTION
open FILE, $_[0]; my @cntn = ();
while (<FILE>) { }

__You as man (by hands) convert__ tree of data into database tables
by procedural language once again.
You are wrong: all, which is necessary, is to have __a.b.c__ in language for
JS> create table a (
JS> id num primary key,
JS> data float
JS> );
JS> create table b (
JS> id num primary key,
JS> ref num references a(id),
JS> data float
JS> );
JS> create table c (
JS> id num primary key,
JS> link num references b(id),
JS> data float
JS> );

JS> to access resources outside the database
JS> (e.g. pl/perlu).
There is no need to have
CREATE OR REPLACE FUNCTION
use DBI;
my $dbh = DBI->connect('dbi:mysql:'.$_[0],$_[1],$_[2],
{ RaiseError => 1, AutoCommit = > });

__You as man (by hands) install connect__ between DBMS and external world
by procedural language once again.
You are wrong once again:
advantage is to __refuse__ from procedural language (to install connect)
instead of put it from outside of DBMS into inside of DBMS.
All, which is necessary, is DBMS itself listen some port/protocol.

Dmitry Turin
SQL4 (4.1.3) http://sql40.chat.ru
HTML6 (6.3.0) http://html6.by.ru
Unicode2 (2.0.0) http://unicode2.chat.ru
Computer2 (2.0.3) http://computer20.chat.ru


From: Dmitry Turin <sql4-en(at)narod(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: calling webservice through postgresql function
Date: 2007-07-31 13:08:23
Message-ID: 125615350.20070731160823@narod.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Good day, Jyoti.

JS>> (e.g. pl/perlu).
DT> __You as man (by hands) install connect__ between DBMS and external world
DT> by procedural language once again.
DT> You are wrong once again:
DT> advantage is to __refuse__ from procedural language (to install connect)
DT> instead of put it from outside of DBMS into inside of DBMS.
DT> All, which is necessary, is DBMS itself listen some port/protocol.

My version:

(1.1)
User send to remote database (HTTP will ask login):
c:/dir> xml2http.exe database.my.com username password a.xml
for example
c:/dir> dbf2xml.exe a.dbf | xml2http.exe database.my.com username password

(1.2)
User send to local database (at transformation data between DBMS-s):
c:/dir> xml2http.exe 127.0.0.1 username password a.xml
for example
c:/dir> dbf2xml.exe a.dbf | xml2http.exe 127.0.0.1 username password

(2.1)
Database send to local file (at transformation data between DBMS-s):
pg> copy a.b.c to filename.xml;

(2.2)
Database send to remote database
(if 'sys.username' and 'sys.password' are equal null,
then database sends as anonymous):
pg> update sys set
pg> ral="database.remote.com",
pg> username=
pg> password= ;
pg> a.b.c ->;
or
pg> update sys set
pg> ran="101.102.103.104",
pg> username=
pg> password= ;
pg> a.b.c ->;
or if you prefer to export per table
pg> update sys set ral="database.remote.com";
pg> create view av as select * from a where ...
pg> create view bv as select * from b where ...
pg> create view cv as select * from c where ...
pg> av ->;
pg> bv ->;
pg> cv ->;

Once again: users need simple instruments, instead of your (in you link)
JS>> CREATE OR REPLACE FUNCTION
JS>> use DBI;
JS>> my $dbh = DBI->connect('dbi:mysql:'.$_[0],$_[1],$_[2],
JS>> { RaiseError => 1, AutoCommit = > });

Do you understand me ?

Dmitry Turin
SQL4 (4.1.3) http://sql40.chat.ru
HTML6 (6.3.0) http://html6.by.ru
Unicode2 (2.0.1) http://unicode2.chat.ru
Computer2 (2.0.3) http://computer20.chat.ru