Search Postgresql Archives

Shared Objects (Dynamic loading)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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' VOLATILE STRICT;
ALTER FUNCTION sp_trigger_raw_email(int4,text ) OWNER TO postgres;

---------------------------------------------



function parse_email(int caseno, char *rawemail)
populates a few global variables first and then
call another function parse_header().
function parse_header() makes use of  the  global variables and then using ECPG stores values in a table in the database.

My question is, when we try to make use of a specific function of a shared object dynamically loaded as show above, then
would that function be able to access all global variables populated elsewhere in the program or all the global variables can't be accessed inside that function of the shared object.


Also, in the above function definition,
the signature of parse_email function is
parse_email(int, char*) and i am passing (int4 , text) to int as seen in the function code pasted above.
Is text in pgsql going to match with char* or i should use some other datatype?

Thanks and regards,
Jas


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux