I am a bit of newbie with postgreSQL and have been experimenting with
pl/pythonU on the server.
I have a couple of questions I hope someone can help with;
1) Calling another pl/pythonu function from within an existing one -
is this possible?
can I do;
"SELECT foo( a,b)"
and then within foo() call bar(b) ?
-- I am thinking that I can't, unless I define bar in an internal package
2) How do you do transactions ??
Lets say I do;
SELECT my_inserter(a, b, c, d)
within "my_insert" I need to update three tables;
plpy.execute("INSERT INTO table_a VALUES (a,b)")
plpy.execute("INSERT INTO table_b VALUES (b,c)")
plpy.execute("INSERT INTO table_c VALUES (c,d)")
Can I wrap these in a transaction so that I can be sure they all get processed ?
Is someone has an example, it would be appreciated.
3) For some of the datavalues, I want to pass a dictionary. The pgdb
seems to error so I pickled it with cPickle, and then unpickle in the
stored procedure.
... any comments on this ? Seems really easy to me.
3) Does anyone actually use pl/pythonu ?
The manual says it is "untrusted", which I understand means that it
gives the programmer complete access to the host machine (ie could
delete / remove files), etc. But if I am the programmer, doesn't that
mean I can control access at the "CREATE FUNCTION" level ??
Thanks in advance.
Any comments would be appreciated.
Geoff.
_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql