pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
calling webservice through postgresql function
9+ messages / 4 participants
[nested] [flat]

* calling webservice through postgresql function
@ 2007-07-13 07:14 Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-13 07:26 ` Re: calling webservice through postgresql function Richard Huxton <dev@archonet.com>
  2007-07-16 13:18 ` Re: [OBORONA-SPAM]  calling webservice through postgresql function Dmitry Turin <sql4-en@narod.ru>
  0 siblings, 2 replies; 9+ messages in thread

From: Jyoti Seth @ 2007-07-13 07:14 UTC (permalink / raw)
  To: pgsql-sql

Hi all,

 

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

 

Thanks,

Jyoti Seth

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: calling webservice through postgresql function
  2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
@ 2007-07-13 07:26 ` Richard Huxton <dev@archonet.com>
  2007-07-13 07:31   ` Re: calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Richard Huxton @ 2007-07-13 07:26 UTC (permalink / raw)
  To: Jyoti Seth <jyotiseth2001@gmail.com>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: calling webservice through postgresql function
  2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-13 07:26 ` Re: calling webservice through postgresql function Richard Huxton <dev@archonet.com>
@ 2007-07-13 07:31   ` Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-13 07:37     ` Re: calling webservice through postgresql function Richard Huxton <dev@archonet.com>
  2007-07-13 07:46     ` Re: calling webservice through postgresql function A. Kretschmer <andreas.kretschmer@schollglas.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Jyoti Seth @ 2007-07-13 07:31 UTC (permalink / raw)
  To: 'Richard Huxton' <dev@archonet.com>; +Cc: 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@archonet.com] 
Sent: Friday, July 13, 2007 12:57 PM
To: Jyoti Seth
Cc: pgsql-sql@postgresql.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




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: calling webservice through postgresql function
  2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-13 07:26 ` Re: calling webservice through postgresql function Richard Huxton <dev@archonet.com>
  2007-07-13 07:31   ` Re: calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
@ 2007-07-13 07:37     ` Richard Huxton <dev@archonet.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Richard Huxton @ 2007-07-13 07:37 UTC (permalink / raw)
  To: Jyoti Seth <jyotiseth2001@gmail.com>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: calling webservice through postgresql function
  2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-13 07:26 ` Re: calling webservice through postgresql function Richard Huxton <dev@archonet.com>
  2007-07-13 07:31   ` Re: calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
@ 2007-07-13 07:46     ` A. Kretschmer <andreas.kretschmer@schollglas.com>
  1 sibling, 0 replies; 9+ messages in thread

From: A. Kretschmer @ 2007-07-13 07:46 UTC (permalink / raw)
  To: 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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: [OBORONA-SPAM]  calling webservice through postgresql function
  2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
@ 2007-07-16 13:18 ` Dmitry Turin <sql4-en@narod.ru>
  2007-07-17 05:18   ` Re: [OBORONA-SPAM]  calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Dmitry Turin @ 2007-07-16 13:18 UTC (permalink / raw)
  To: 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




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: [OBORONA-SPAM]  calling webservice through postgresql function
  2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-16 13:18 ` Re: [OBORONA-SPAM]  calling webservice through postgresql function Dmitry Turin <sql4-en@narod.ru>
@ 2007-07-17 05:18   ` Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-27 06:40     ` Re: calling webservice through postgresql function Dmitry Turin <sql4-en@narod.ru>
  0 siblings, 1 reply; 9+ messages in thread

From: Jyoti Seth @ 2007-07-17 05:18 UTC (permalink / raw)
  To: 'Dmitry Turin' <sql4-en@narod.ru>; +Cc: 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@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of Dmitry Turin
Sent: Monday, July 16, 2007 6:49 PM
To: pgsql-sql@postgresql.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




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: calling webservice through postgresql function
  2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-16 13:18 ` Re: [OBORONA-SPAM]  calling webservice through postgresql function Dmitry Turin <sql4-en@narod.ru>
  2007-07-17 05:18   ` Re: [OBORONA-SPAM]  calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
@ 2007-07-27 06:40     ` Dmitry Turin <sql4-en@narod.ru>
  2007-07-31 13:08       ` Re: calling webservice through postgresql function Dmitry Turin <sql4-en@narod.ru>
  0 siblings, 1 reply; 9+ messages in thread

From: Dmitry Turin @ 2007-07-27 06:40 UTC (permalink / raw)
  To: 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




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: calling webservice through postgresql function
  2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-16 13:18 ` Re: [OBORONA-SPAM]  calling webservice through postgresql function Dmitry Turin <sql4-en@narod.ru>
  2007-07-17 05:18   ` Re: [OBORONA-SPAM]  calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
  2007-07-27 06:40     ` Re: calling webservice through postgresql function Dmitry Turin <sql4-en@narod.ru>
@ 2007-07-31 13:08       ` Dmitry Turin <sql4-en@narod.ru>
  0 siblings, 0 replies; 9+ messages in thread

From: Dmitry Turin @ 2007-07-31 13:08 UTC (permalink / raw)
  To: 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




^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2007-07-31 13:08 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-07-13 07:14 calling webservice through postgresql function Jyoti Seth <jyotiseth2001@gmail.com>
2007-07-13 07:26 ` Richard Huxton <dev@archonet.com>
2007-07-13 07:31   ` Jyoti Seth <jyotiseth2001@gmail.com>
2007-07-13 07:37     ` Richard Huxton <dev@archonet.com>
2007-07-13 07:46     ` A. Kretschmer <andreas.kretschmer@schollglas.com>
2007-07-16 13:18 ` Dmitry Turin <sql4-en@narod.ru>
2007-07-17 05:18   ` Jyoti Seth <jyotiseth2001@gmail.com>
2007-07-27 06:40     ` Dmitry Turin <sql4-en@narod.ru>
2007-07-31 13:08       ` Dmitry Turin <sql4-en@narod.ru>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox