Re: [GENERAL] PLPythonu for production server

2016-03-05 Thread Rémi Cura
Thanks ! Cheers, Rémi-C 2016-03-05 0:38 GMT+01:00 Adrian Klaver : > On 03/04/2016 01:46 AM, Rémi Cura wrote: > >> Thanks for the answer guys. >> >> I should have mentionned that I had read the doc, >> and was looking for non explicit knowledge, >> like : >> - what is the reputation of plpython fo

Re: [GENERAL] PLPythonu for production server

2016-03-04 Thread Adrian Klaver
On 03/04/2016 01:46 AM, Rémi Cura wrote: Thanks for the answer guys. I should have mentionned that I had read the doc, and was looking for non explicit knowledge, like : - what is the reputation of plpython for a dba? - are there actual production system that use it - what would be the recommend

Re: [GENERAL] PLPythonu for production server

2016-03-04 Thread s d
On 4 March 2016 at 10:46, Rémi Cura wrote: > Thanks for the answer guys. > > I should have mentionned that I had read the doc, > and was looking for non explicit knowledge, > like : > - what is the reputation of plpython for a dba? > Dunno. - are there actual production system that use it > I

Re: [GENERAL] PLPythonu for production server

2016-03-04 Thread Rémi Cura
Thanks for the answer guys. I should have mentionned that I had read the doc, and was looking for non explicit knowledge, like : - what is the reputation of plpython for a dba? - are there actual production system that use it - what would be the recommended usage perimeter ? (only administration

Re: [GENERAL] PLPythonu for production server

2016-03-03 Thread David G. Johnston
On Thu, Mar 3, 2016 at 12:35 PM, Adrian Klaver wrote: > On 03/03/2016 10:09 AM, Rémi Cura wrote: > >> Hey List, >> >> would it be considered safe to use plpythonu for a production database? >> What would be the limitations/ dangers? >> > > They are explained here: > > http://www.postgresql.org/do

Re: [GENERAL] PLPythonu for production server

2016-03-03 Thread Adrian Klaver
On 03/03/2016 10:09 AM, Rémi Cura wrote: Hey List, would it be considered safe to use plpythonu for a production database? What would be the limitations/ dangers? They are explained here: http://www.postgresql.org/docs/9.5/interactive/plpython.html "PL/Python is only available as an "untrust

[GENERAL] PLPythonu for production server

2016-03-03 Thread Rémi Cura
Hey List, would it be considered safe to use plpythonu for a production database? What would be the limitations/ dangers? Thanks, Cheers, Rémi-C

Re: [GENERAL] plpythonu memory leak

2011-01-18 Thread Daniel Popowich
I found the bug and it has been reported. Bug #5842. Details here: http://archives.postgresql.org/pgsql-bugs/2011-01/msg00134.php Dan Popowich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [GENERAL] plpythonu memory leak

2011-01-18 Thread Daniel Popowich
Alex Hunsaker writes: > FYI if I don't use a slice copy here I can't get it to leak. ( find my > test case at the end ) I don't know enough about python to know if > thats a pl/python issue or python doing what its told-- having never > really wrote any python myself. > > --- > -- le

Re: [GENERAL] plpythonu memory leak

2011-01-17 Thread Alex Hunsaker
On Fri, Jan 14, 2011 at 19:14, Daniel Popowich wrote: [ snip ] > CREATE FUNCTION pygaps(start_ts timestamp without time zone, end_ts timestamp > without time zone, gap_length interval) RETURNS SETOF timerange >    LANGUAGE plpythonu >    AS $$ > >    # because pg passes date/time to python as st

[GENERAL] plpythonu memory leak

2011-01-14 Thread Daniel Popowich
I am working with very large sets of time-series data. Imagine a table with a timestamp as the primary key. One question I need to ask of my data is: Are there gaps of time greater than some interval between consecutive rows? I wrote a function in plpgsql to answer this question and it worked g

Re: [GENERAL] plpythonu / using pg as an application server

2010-06-01 Thread Sim Zacks
As an example of a filesystem access that is transaction dependent: When I create a new supplier in the database, I need a set of directories built on the file system. If the directories are not there, it will cause a lot of problems when dealing with this supplier. When creating the supplier, I us

Re: [GENERAL] plpythonu / using pg as an application server

2010-06-01 Thread Sim Zacks
>> Is there any good reason not to include this functionality directly in >> the database? (Too much parallel processing, engine not equipped for >> that kind of processing, threading issues...) >> >> > there are some issues still > > * missing integrated scheduler > * missing autonomous tran

Re: [GENERAL] plpythonu / using pg as an application server

2010-06-01 Thread Sim Zacks
On 6/1/2010 11:12 AM, Szymon Guz wrote: > > > 2010/6/1 Sim Zacks mailto:s...@compulab.co.il>> > > PG 8.2 > > I am using plpythonu to add application server functionality to my > postgresql database. > > For example, I have triggers and functions that FTP files, sends > email,

Re: [GENERAL] plpythonu / using pg as an application server

2010-06-01 Thread Pavel Stehule
2010/6/1 Sim Zacks : > PG 8.2 > > I am using plpythonu to add application server functionality to my > postgresql database. > > For example, I have triggers and functions that FTP files, sends email, > processes files, etc.. > > > Is there any good reason not to include this functionality directly

Re: [GENERAL] plpythonu / using pg as an application server

2010-06-01 Thread Szymon Guz
2010/6/1 Sim Zacks > PG 8.2 > > I am using plpythonu to add application server functionality to my > postgresql database. > > For example, I have triggers and functions that FTP files, sends email, > processes files, etc.. > > > Is there any good reason not to include this functionality directly

[GENERAL] plpythonu / using pg as an application server

2010-06-01 Thread Sim Zacks
PG 8.2 I am using plpythonu to add application server functionality to my postgresql database. For example, I have triggers and functions that FTP files, sends email, processes files, etc.. Is there any good reason not to include this functionality directly in the database? (Too much parallel p

Re: [GENERAL] plpythonu

2008-01-20 Thread Alvaro Herrera
Sim Zacks wrote: > I'm a fan of unsecured languages in the database. > Obviously they should only be used by people who understand the difference. > I wouldn't want python locked down. > That would prevent so many different external functions that can now > be integrated into the database. > > Amon

Re: [GENERAL] plpythonu

2008-01-19 Thread Sim Zacks
I'm a fan of unsecured languages in the database. Obviously they should only be used by people who understand the difference. I wouldn't want python locked down. That would prevent so many different external functions that can now be integrated into the database. Among other things that I curren

Re: [GENERAL] plpythonu

2008-01-18 Thread Marko Kreen
On 1/18/08, Erik Jones <[EMAIL PROTECTED]> wrote: > On Jan 18, 2008, at 7:48 AM, Stuart Bishop wrote: > > plpython !=3D plpythonu. > > > > plpython was the 'secure' sandboxed version. The Python devs gave up > > supporting any sort of sandboxing feature in Python declaring it > > impossib= > > le.

Re: [GENERAL] plpythonu

2008-01-18 Thread Erik Jones
On Jan 18, 2008, at 7:48 AM, Stuart Bishop wrote: plpython !=3D plpythonu. plpython was the 'secure' sandboxed version. The Python devs gave up supporting any sort of sandboxing feature in Python declaring it impossib= le. Someone should definitely take a look at this: http:// sayspy.blo

Re: [GENERAL] plpythonu

2008-01-18 Thread Stuart Bishop
Alexandre da Silva wrote: > Hello, > someone can tell me if is secure to create external python modules and > import them to functions/procedures/triggers to use? Its fine as long as you trust the users with write access to your PYTHONP= ATH. > Another question is that I have read in some discuss

[GENERAL] plpythonu

2008-01-17 Thread Alexandre da Silva
Hello, someone can tell me if is secure to create external python modules and import them to functions/procedures/triggers to use? I am doing the following: function/procedure/trigger: CREATE OR REPLACE FUNCTION tabela_be_i_tg_fx() RETURNS trigger AS $body$ from dbfunctions.postgres.pg_trigger i

[GENERAL] plpythonu under OS X 10.4 -- a brief HOWTO

2007-11-19 Thread Philip Semanchuk
Hi all, I just got plpythonu working under OS X, and I'm posting my HOWTO notes here in case I (or anyone else) needs them. The install was pretty straightforward for me once I'd Googled the proper magic commands. I'm on OS X Tiger (10.4.10) which comes with Python 2.3 installed by default

Re: [GENERAL] plpythonu and PYTHONPATH/sys.path

2007-03-06 Thread Korin Richmond
On Tue, 6 Mar 2007, Korin Richmond wrote: On Tue, 6 Mar 2007, Richard Huxton wrote: Korin Richmond wrote: Hi, I want to use python modules I have written in plpythonu. I can load these modules in functions within postgres if they are installed in the "official" python module directories (

Re: [GENERAL] plpythonu and PYTHONPATH/sys.path

2007-03-06 Thread Korin Richmond
On Tue, 6 Mar 2007, Richard Huxton wrote: Korin Richmond wrote: Hi, I want to use python modules I have written in plpythonu. I can load these modules in functions within postgres if they are installed in the "official" python module directories (e.g. /blah/site-packages etc.) However, I

Re: [GENERAL] plpythonu and PYTHONPATH/sys.path

2007-03-06 Thread Richard Huxton
Korin Richmond wrote: Hi, I want to use python modules I have written in plpythonu. I can load these modules in functions within postgres if they are installed in the "official" python module directories (e.g. /blah/site-packages etc.) However, I want to use modules which are in my home fil

[GENERAL] plpythonu and PYTHONPATH/sys.path

2007-03-06 Thread Korin Richmond
Hi, I want to use python modules I have written in plpythonu. I can load these modules in functions within postgres if they are installed in the "official" python module directories (e.g. /blah/site-packages etc.) However, I want to use modules which are in my home file space, but I can't g

Re: [GENERAL] plpythonu array parameter

2007-01-24 Thread _
Anyone interested in arrays and plpython might find this interesting. Based on the conversation below I put these functions in a library (pg_stuff.py): def arr2list(a): a = a.replace("{","[").replace("}","]") pylist = eval(a) return pylist def list2arr(a): parm = `a` parm=parm

[GENERAL] plpythonu array parameter

2006-12-06 Thread Sim Zacks
I ran into an interesting issue trying to pass an array to a plpythonu function (Postgresql 8.03). When I googled the issue I found a number of people asking similar questions and they haven't found an answer. The problem is that there is no type mapped from a postgresql array to a python list.

[GENERAL] plpythonu and type record

2006-07-22 Thread Ottavio Campana
I'm trying to write a stored procedure in python with postgresql 7.4, but I cannot return a record or a setof record. I get this error: ERROR: cannot accept a value of type record Is possible to return a record or am I trying to do something impossible? Thank you signature.asc Description:

Re: [GENERAL] plpythonu and return void

2005-08-09 Thread Adrian Klaver
On Monday 08 August 2005 08:02 pm, Tom Lane wrote: > Adrian Klaver <[EMAIL PROTECTED]> writes: > > I recently migrated a database from Postgres 7.4.1 to Postgres 8.03. The > > only problem I have run into is that a plpythonu function that returns > > void will not run under 8.03. The error message

Re: [GENERAL] plpythonu and return void

2005-08-08 Thread Tom Lane
Adrian Klaver <[EMAIL PROTECTED]> writes: > I recently migrated a database from Postgres 7.4.1 to Postgres 8.03. The only > problem I have run into is that a plpythonu function that returns void will > not run under 8.03. The error message states that a plpython function cannot > return void. I g

[GENERAL] plpythonu and return void

2005-08-08 Thread Adrian Klaver
I recently migrated a database from Postgres 7.4.1 to Postgres 8.03. The only problem I have run into is that a plpythonu function that returns void will not run under 8.03. The error message states that a plpython function cannot return void. I got around it by having it return text and not act

Re: [GENERAL] plpythonu and bytea

2005-07-02 Thread Michael Fuhr
On Sat, Jul 02, 2005 at 04:49:23PM -0400, Greg Steffensen wrote: > > Hey, I'm trying to write some plpython procedures that read binary data from > images on the disk and store it in bytea fields. I'm basically trying to > write a plpython procedure that accepts a varchar and returns a bytea, wit

[GENERAL] plpythonu and bytea

2005-07-02 Thread Greg Steffensen
Hey, I'm trying to write some plpython procedures that read binary data from images on the disk and store it in bytea fields.  I'm basically trying to write a plpython procedure that accepts a varchar and returns a bytea, with these procedure contents: data = ""> return data (The actual procedure

[GENERAL] plpythonu and booleans

2005-05-04 Thread CSN
When accessing Postgres boolean fields (in the TD dictionaries) in plpythonu, their values are '0' or '1'. IIRC, in PHP their values would be 't' or 'f'. How are boolean values actually stored in Postgres? CSN Discover Yahoo! Stay in touch with email, IM, photo sharing and more

Re: [GENERAL] plpythonu and dollar quoting

2005-05-03 Thread Michael Fuhr
On Tue, May 03, 2005 at 02:46:04PM -0700, CSN wrote: > > Can dollar quoting be used with plpythonu (like with plperl - Yes, if you're using PostgreSQL 8.0 or later. Dollar quotes have nothing to do with the function's language -- they're just another way to quote a string. http://www.postgresql.

Re: [GENERAL] plpythonu and dollar quoting

2005-05-03 Thread CSN
Nevermind, I see dollar-quoting was added in 8.0. --- CSN <[EMAIL PROTECTED]> wrote: > Can dollar quoting be used with plpythonu (like with > plperl - > http://www.postgresql.org/docs/8.0/interactive/plperl.html#PLPERL-FUNCS)? > When trying to create a function I get this error: > > 'syntax err

[GENERAL] plpythonu and dollar quoting

2005-05-03 Thread CSN
Can dollar quoting be used with plpythonu (like with plperl - http://www.postgresql.org/docs/8.0/interactive/plperl.html#PLPERL-FUNCS)? When trying to create a function I get this error: 'syntax error at or near "$"' If I use single quotes, then escape all quotes and (a lot of) backslashes in the

Re: [GENERAL] plpythonu on 7.4

2005-01-21 Thread Michael Fuhr
On Sat, Jan 22, 2005 at 12:57:37AM -0500, Tom Lane wrote: > [EMAIL PROTECTED] (elein) writes: > > createlang -U postgres 'plpythonu' template1 > > createlang: language installation failed: ERROR: could not load > > library "/usr/local/pgsql74/lib/plpython.so": > > /usr/local/pgsql74/lib/plpyth

Re: [GENERAL] plpythonu on 7.4

2005-01-21 Thread Tom Lane
[EMAIL PROTECTED] (elein) writes: > createlang -U postgres 'plpythonu' template1 > createlang: language installation failed: ERROR: could not load > library "/usr/local/pgsql74/lib/plpython.so": > /usr/local/pgsql74/lib/plpython.so: undefined symbol: PyDict_Copy I'd bet on a python version is

Re: [GENERAL] plpythonu on 7.4

2005-01-21 Thread Mike G.
Is this on fedora or redhat linux? If so a separate rpm must be installed for plpython to function. If you built from source the config script must also include building python. On Fri, Jan 21, 2005 at 10:34:51PM -0700, Michael Fuhr wrote: > On Fri, Jan 21, 2005 at 09:16:27PM -0800, elein wr

Re: [GENERAL] plpythonu on 7.4

2005-01-21 Thread Michael Fuhr
On Fri, Jan 21, 2005 at 09:16:27PM -0800, elein wrote: > createlang: language installation failed: ERROR: could not load > library "/usr/local/pgsql74/lib/plpython.so": > /usr/local/pgsql74/lib/plpython.so: undefined symbol: PyDict_Copy What does "ldd /usr/local/pgsql74/lib/plpython.so" show?

[GENERAL] plpythonu on 7.4

2005-01-21 Thread elein
On a 7.4 installation built --with-python... Python installed is 2.3.4. On createlang, I get the following error: createlang -U postgres 'plpythonu' template1 createlang: language installation failed: ERROR: could not load library "/usr/local/pgsql74/lib/plpython.so": /usr/local/pgsql74/lib/