Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 01:11 AM
Robert Fitzpatrick
Guest
 
Posts: n/a
Default Database accesss using plperl

I have plperl installed my PostgreSQL 7.4.2 server, but from what I
understand in chapter 39.3 of the docs, you cannot access the databases
without DBD::PgSPI. According to the readme for that module, it will
only run on the untrusted plperlu.

Is this the only way to run queries (SELECT, INSERT, UPDATE) using
plperl?

What are the consequences and things to look out for when running
untrusted languages?

--
Robert


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

  #2  
Old November 23rd, 2005, 01:11 AM
Paul Thomas
Guest
 
Posts: n/a
Default Re: Database accesss using plperl


On 16/06/2004 21:27 Robert Fitzpatrick wrote:[color=blue]
> I have plperl installed my PostgreSQL 7.4.2 server, but from what I
> understand in chapter 39.3 of the docs, you cannot access the databases
> without DBD::PgSPI. According to the readme for that module, it will
> only run on the untrusted plperlu.
>
> Is this the only way to run queries (SELECT, INSERT, UPDATE) using
> plperl?[/color]

Are you talking about writing functions/stored procedures in PERL or
accessing the database from a PERL program because what you have read is
specific to functions/stored procedures. (sorry for the bad/absent
punctuation but I've just come back from the pub after a generous quantity
of Old Speckled Hen)

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

  #3  
Old November 23rd, 2005, 01:11 AM
Paul Thomas
Guest
 
Posts: n/a
Default Re: Database accesss using plperl


On 16/06/2004 21:27 Robert Fitzpatrick wrote:[color=blue]
> I have plperl installed my PostgreSQL 7.4.2 server, but from what I
> understand in chapter 39.3 of the docs, you cannot access the databases
> without DBD::PgSPI. According to the readme for that module, it will
> only run on the untrusted plperlu.
>
> Is this the only way to run queries (SELECT, INSERT, UPDATE) using
> plperl?[/color]

Are you talking about writing functions/stored procedures in PERL or
accessing the database from a PERL program because what you have read is
specific to functions/stored procedures. (sorry for the bad/absent
punctuation but I've just come back from the pub after a generous quantity
of Old Speckled Hen)

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

  #4  
Old November 23rd, 2005, 01:11 AM
Robert Fitzpatrick
Guest
 
Posts: n/a
Default Re: Database accesss using plperl

On Wed, 2004-06-16 at 19:05, Paul Thomas wrote:[color=blue]
> On 16/06/2004 21:27 Robert Fitzpatrick wrote:[color=green]
> > I have plperl installed my PostgreSQL 7.4.2 server, but from what I
> > understand in chapter 39.3 of the docs, you cannot access the databases
> > without DBD::PgSPI. According to the readme for that module, it will
> > only run on the untrusted plperlu.
> >
> > Is this the only way to run queries (SELECT, INSERT, UPDATE) using
> > plperl?[/color]
>
> Are you talking about writing functions/stored procedures in PERL or
> accessing the database from a PERL program because what you have read is
> specific to functions/stored procedures. (sorry for the bad/absent
> punctuation but I've just come back from the pub after a generous quantity
> of Old Speckled Hen)[/color]

I'm talking about writing PostgreSQL stored procedures using Perl that
access the database via queries (like pl/pgsql, maybe using DBI:Pg) for
SELECTs, INSERTs, UPDATEs, etc.

--
Robert


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

  #5  
Old November 23rd, 2005, 01:11 AM
Robert Fitzpatrick
Guest
 
Posts: n/a
Default Re: Database accesss using plperl

On Wed, 2004-06-16 at 19:05, Paul Thomas wrote:[color=blue]
> On 16/06/2004 21:27 Robert Fitzpatrick wrote:[color=green]
> > I have plperl installed my PostgreSQL 7.4.2 server, but from what I
> > understand in chapter 39.3 of the docs, you cannot access the databases
> > without DBD::PgSPI. According to the readme for that module, it will
> > only run on the untrusted plperlu.
> >
> > Is this the only way to run queries (SELECT, INSERT, UPDATE) using
> > plperl?[/color]
>
> Are you talking about writing functions/stored procedures in PERL or
> accessing the database from a PERL program because what you have read is
> specific to functions/stored procedures. (sorry for the bad/absent
> punctuation but I've just come back from the pub after a generous quantity
> of Old Speckled Hen)[/color]

I'm talking about writing PostgreSQL stored procedures using Perl that
access the database via queries (like pl/pgsql, maybe using DBI:Pg) for
SELECTs, INSERTs, UPDATEs, etc.

--
Robert


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

  #6  
Old November 23rd, 2005, 01:11 AM
Paul Thomas
Guest
 
Posts: n/a
Default Re: Database accesss using plperl

On 17/06/2004 15:56 Robert Fitzpatrick wrote:[color=blue]
> [snip]
> I'm talking about writing PostgreSQL stored procedures using Perl that
> access the database via queries (like pl/pgsql, maybe using DBI:Pg) for
> SELECTs, INSERTs, UPDATEs, etc.[/color]

Then DBI:PgSPI is what you want. AFAIK, DBI:Pg is for client-side only.

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

  #7  
Old November 23rd, 2005, 01:11 AM
Paul Thomas
Guest
 
Posts: n/a
Default Re: Database accesss using plperl

On 17/06/2004 15:56 Robert Fitzpatrick wrote:[color=blue]
> [snip]
> I'm talking about writing PostgreSQL stored procedures using Perl that
> access the database via queries (like pl/pgsql, maybe using DBI:Pg) for
> SELECTs, INSERTs, UPDATEs, etc.[/color]

Then DBI:PgSPI is what you want. AFAIK, DBI:Pg is for client-side only.

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

  #8  
Old November 23rd, 2005, 01:11 AM
Jeff Eckermann
Guest
 
Posts: n/a
Default Re: Database accesss using plperl

--- Paul Thomas <paul@tmsl.demon.co.uk> wrote:[color=blue]
> On 17/06/2004 15:56 Robert Fitzpatrick wrote:[color=green]
> > [snip]
> > I'm talking about writing PostgreSQL stored[/color]
> procedures using Perl that[color=green]
> > access the database via queries (like pl/pgsql,[/color]
> maybe using DBI:Pg) for[color=green]
> > SELECTs, INSERTs, UPDATEs, etc.[/color]
>
> Then DBI:PgSPI is what you want. AFAIK, DBI:Pg is
> for client-side only.[/color]

CommandPrompt has their own beta version of pl/perl,
which does database queries:

http://www.commandprompt.com/index.lxp?lxpt=22

This is certainly more actively developed than
DBI:PgSPI, which only ever was an experimental,
hackish workaround for the missing functionality.
[color=blue]
>
> HTH
>
> --
> Paul Thomas
>[/color]
+------------------------------+---------------------------------------------+[color=blue]
> | Thomas Micro Systems Limited | Software Solutions
> for
> Business |
> | Computer Consultants |
> http://www.thomas-micro-systems-ltd.co.uk |
>[/color]
+------------------------------+---------------------------------------------+[color=blue]
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)
>[/color]




__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

  #9  
Old November 23rd, 2005, 01:11 AM
Jeff Eckermann
Guest
 
Posts: n/a
Default Re: Database accesss using plperl

--- Paul Thomas <paul@tmsl.demon.co.uk> wrote:[color=blue]
> On 17/06/2004 15:56 Robert Fitzpatrick wrote:[color=green]
> > [snip]
> > I'm talking about writing PostgreSQL stored[/color]
> procedures using Perl that[color=green]
> > access the database via queries (like pl/pgsql,[/color]
> maybe using DBI:Pg) for[color=green]
> > SELECTs, INSERTs, UPDATEs, etc.[/color]
>
> Then DBI:PgSPI is what you want. AFAIK, DBI:Pg is
> for client-side only.[/color]

CommandPrompt has their own beta version of pl/perl,
which does database queries:

http://www.commandprompt.com/index.lxp?lxpt=22

This is certainly more actively developed than
DBI:PgSPI, which only ever was an experimental,
hackish workaround for the missing functionality.
[color=blue]
>
> HTH
>
> --
> Paul Thomas
>[/color]
+------------------------------+---------------------------------------------+[color=blue]
> | Thomas Micro Systems Limited | Software Solutions
> for
> Business |
> | Computer Consultants |
> http://www.thomas-micro-systems-ltd.co.uk |
>[/color]
+------------------------------+---------------------------------------------+[color=blue]
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)
>[/color]




__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

  #10  
Old November 23rd, 2005, 01:12 AM
Jeff Eckermann
Guest
 
Posts: n/a
Default Re: Database accesss using plperl

Further to my earlier email: the CommandPrompt
pl/perl appears to handle trigger functions, but not
direct database access? Someone correct me if I'm
wrong.

So DBI:PgSPI may still be the only way to query the
database from a function using Perl. But are you sure
you really have to use Perl? If you are looking for a
language other than pl/pgsql to do queries from
functions, look at pl/tcl; I think that pl/python and
pl/ruby may also have some capability to do what you
want.

--- Paul Thomas <paul@tmsl.demon.co.uk> wrote:[color=blue]
> On 17/06/2004 15:56 Robert Fitzpatrick wrote:[color=green]
> > [snip]
> > I'm talking about writing PostgreSQL stored[/color]
> procedures using Perl that[color=green]
> > access the database via queries (like pl/pgsql,[/color]
> maybe using DBI:Pg) for[color=green]
> > SELECTs, INSERTs, UPDATEs, etc.[/color]
>
> Then DBI:PgSPI is what you want. AFAIK, DBI:Pg is
> for client-side only.
>
> HTH
>
> --
> Paul Thomas
>[/color]
+------------------------------+---------------------------------------------+[color=blue]
> | Thomas Micro Systems Limited | Software Solutions
> for
> Business |
> | Computer Consultants |
> http://www.thomas-micro-systems-ltd.co.uk |
>[/color]
+------------------------------+---------------------------------------------+[color=blue]
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)
>[/color]




__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

  #11  
Old November 23rd, 2005, 01:12 AM
Jeff Eckermann
Guest
 
Posts: n/a
Default Re: Database accesss using plperl

Further to my earlier email: the CommandPrompt
pl/perl appears to handle trigger functions, but not
direct database access? Someone correct me if I'm
wrong.

So DBI:PgSPI may still be the only way to query the
database from a function using Perl. But are you sure
you really have to use Perl? If you are looking for a
language other than pl/pgsql to do queries from
functions, look at pl/tcl; I think that pl/python and
pl/ruby may also have some capability to do what you
want.

--- Paul Thomas <paul@tmsl.demon.co.uk> wrote:[color=blue]
> On 17/06/2004 15:56 Robert Fitzpatrick wrote:[color=green]
> > [snip]
> > I'm talking about writing PostgreSQL stored[/color]
> procedures using Perl that[color=green]
> > access the database via queries (like pl/pgsql,[/color]
> maybe using DBI:Pg) for[color=green]
> > SELECTs, INSERTs, UPDATEs, etc.[/color]
>
> Then DBI:PgSPI is what you want. AFAIK, DBI:Pg is
> for client-side only.
>
> HTH
>
> --
> Paul Thomas
>[/color]
+------------------------------+---------------------------------------------+[color=blue]
> | Thomas Micro Systems Limited | Software Solutions
> for
> Business |
> | Computer Consultants |
> http://www.thomas-micro-systems-ltd.co.uk |
>[/color]
+------------------------------+---------------------------------------------+[color=blue]
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)
>[/color]




__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles