[GENERAL] Shared Objects (Dynamic loading)

2006-08-23 Thread Jasbinder Bali
Hi,I have a function in which i dynamicall load my shared object and the function definition is as follows:CREATE OR REPLACE FUNCTION sp_trigger_raw_email(int4, text)   RETURNS bool AS'/usr/local/pgsql/jsbali/parser', 'parse_email'  LANGUAGE 'c' V

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-23 Thread Michael Fuhr
On Thu, Aug 24, 2006 at 01:03:43AM -0400, Jasbinder Bali wrote: > CREATE OR REPLACE FUNCTION sp_trigger_raw_email(int4, text) > RETURNS bool AS > '/usr/local/pgsql/jsbali/parser', 'parse_email' > LANGUAGE 'c' VOLATILE STRICT; > ALTER FUNCTION sp_trigger_raw_email(int4,text ) OWNER TO postgres; >

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-24 Thread Michael Meskes
On Wed, Aug 23, 2006 at 11:41:50PM -0600, Michael Fuhr wrote: > Is there a reason this server-side code is using ECPG instead of SPI? To make sure it doesn't work? There is NO guarantee that ECPG will work in this scenario. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De, Michael

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-24 Thread Jasbinder Bali
Hi, The way we use ECPG for the database related activites while working with C, what do i need to look up if i'm using perl.As alot of people have pointed out that perl is the best language to use while dealing with email parsing. We have the perl code ready to parse the email.Just wondering what

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-24 Thread Frank Finner
On Thu, 24 Aug 2006 15:46:00 -0400 "Jasbinder Bali" <[EMAIL PROTECTED]> thought long, then sat down and wrote: > Hi, > The way we use ECPG for the database related activites while working with > C, what do i need to look up if i'm using perl. > As alot of people have pointed out that perl is the

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-24 Thread Michael Fuhr
On Thu, Aug 24, 2006 at 03:46:00PM -0400, Jasbinder Bali wrote: > The way we use ECPG for the database related activites while working with > C, what do i need to look up if i'm using perl. For information about writing server-side Perl functions see the PL/Perl documentation (adjust the link if y

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-26 Thread Jasbinder Bali
Hi, Do we have any concept of shared objects in perl. Just wondering, how do we dynamically load something written in perl in postgresql.   Thanks, Jas  On 8/24/06, Michael Fuhr <[EMAIL PROTECTED]> wrote: On Thu, Aug 24, 2006 at 03:46:00PM -0400, Jasbinder Bali wrote:> The way we use ECPG for the d

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-26 Thread Michael Fuhr
On Sat, Aug 26, 2006 at 03:32:37PM -0400, Jasbinder Bali wrote: > Do we have any concept of shared objects in perl. > Just wondering, how do we dynamically load something written in perl in > postgresql. A PL/Perl function can load external code with "use", "require", or "do". Since those are pot

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Jasbinder Bali
Hi,Can you please give me pointers to how to establish clinet server model using PL/Perl. I mean how do i give the ip address of the database server in my Perl script running in another machine.Regards,Jas On 8/26/06, Michael Fuhr <[EMAIL PROTECTED]> wrote: On Sat, Aug 26, 2006 at 03:32:37PM -0400,

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Michael Fuhr
On Sun, Aug 27, 2006 at 05:13:25PM -0400, Jasbinder Bali wrote: > Can you please give me pointers to how to establish clinet server model > using PL/Perl. > I mean how do i give the ip address of the database server in my Perl script > running in another machine. DBI is a Perl module for connectin

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Geoffrey
Michael Fuhr wrote: On Sun, Aug 27, 2006 at 05:13:25PM -0400, Jasbinder Bali wrote: Can you please give me pointers to how to establish clinet server model using PL/Perl. I mean how do i give the ip address of the database server in my Perl script running in another machine. DBI is a Perl modu

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Jasbinder Bali
The actual scenario is like my perl code is on one computer and database server is on the other computer. The perl code needs to connect to that database server residing on a diff computer.   I think client machine should also have DBI module in it. right?   Also, how much of a change would it be

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Michael Fuhr
On Sun, Aug 27, 2006 at 09:41:39PM -0400, Jasbinder Bali wrote: > The actual scenario is like my perl code is on one computer and database > server is on the other computer. The perl code needs to connect to that > database server residing on a diff computer. > > I think client machine should also

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Jasbinder Bali
Just wondering why would i need libpq here.Doesn't DBD::pg has its own functions for database related activities.I think i'm quite naive in this.Also, the triggers that i wrote in C are not all that elaborative. They are pretty basic triggers. Also, I'm a rookie in perl but don't need to do somethi

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Martijn van Oosterhout
On Mon, Aug 28, 2006 at 01:29:11AM -0400, Jasbinder Bali wrote: > Just wondering why would i need libpq here. > Doesn't DBD::pg has its own functions for database related activities. > I think i'm quite naive in this. DBD::Pg uses libpq to do the talking to the database. Think of it as the driver

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Jasbinder Bali
Thanks for that reply Martijn,Just wondering what is this SPI all about and where can i read up on that. Any quick pointers please?Thanks ~JasOn 8/28/06, Martijn van Oosterhout wrote: On Mon, Aug 28, 2006 at 01:29:11AM -0400, Jasbinder Bali wrote:> Just wondering why would i ne

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Martijn van Oosterhout
On Mon, Aug 28, 2006 at 02:08:28AM -0400, Jasbinder Bali wrote: > Thanks for that reply Martijn, > > Just wondering what is this SPI all about and where can i read up on that. > Any quick pointers please? The documentation is a good start, http://www.postgresql.org/docs/8.1/interactive/spi.html

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-28 Thread Jasbinder Bali
Its because my trigger has to initiate some unix tools and the code forthe same is already written in Perl.So my trigger just needs to call the Perl program that would do the needful eventually.~Jas On 8/28/06, Gerald Timothy G Quimpo <[EMAIL PROTECTED]> wrote: On Mon, 2006-08-28 at 01:29 -0400, Ja

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-28 Thread Tom Lane
"Jasbinder Bali" <[EMAIL PROTECTED]> writes: > Its because my trigger has to initiate some unix tools and the code for > the same is already written in Perl. > So my trigger just needs to call the Perl program that would do the needful > eventually. Seems like you should be writing the trigger in

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-29 Thread Tiger Quimpo
[original email got setn to Jasbinder but not to the list fixing that] On 8/28/06, Gerald Timothy G Quimpo... wrote: > Any reason why you don't do your functions and triggers in > pl/pgsql instead? It's simpler to setup and learn > than pl/perl, IMO. On Mon, 2006-08-28 at

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-29 Thread Gerald Timothy G Quimpo
On Mon, 2006-08-28 at 01:29 -0400, Jasbinder Bali wrote: > Also, the triggers that i wrote in C are not all that elaborative. > They are pretty basic triggers. Also, I'm a rookie in perl but don't > need to do something hifi with it. Any reason why you don't do your functions and triggers in pl/p

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-29 Thread Jasbinder Bali
Tiger, Thanks alot for sharing that info. Thats exactly how we have implemented our system after seeing the mismatch in the transactions for any rollback transactions. Regards, ~Jas  On 8/29/06, Tiger Quimpo <[EMAIL PROTECTED]> wrote: [original email got setn to Jasbinder but not to the listfixing