Re: PL/Python

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема Re: PL/Python
Дата
Msg-id 4E8852E8.3000006@compulab.co.il
обсуждение исходный текст
Ответ на PL/Python  (Joe Abbate <jma@freedomcircle.com>)
Ответы Re: PL/Python
Список pgsql-general
<meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    body p { margin-bottom: 0cm; margin-top: 0pt; }

  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#ffffff"
    text="#000000">
    On 09/30/2011 05:10 AM, Joe Abbate wrote:
    <blockquote cite="mid:4E852515.5010801@freedomcircle.com"
      type="cite">
      Although there are no discussions or examples in the documentation, I've
determined that PL/Python supports Python new style classes like class
Test(object), and import of standard modules.

Now, in order for to_yaml/to_map to do its work, it needs to import 15
modules, e.g.,

from pyrseas.dbobject.language import LanguageDict

I'd be interested to know if anyone has tried something similar (in
terms of scope) and if so, how they tackled it.

The other function, diff_yaml() or diff_map(), is a bit trickier because
it requires reading in a YAML spec file, like the one above, and then
comparing it to the internal version of to_yaml/to_map, in order to
output SQL DDL statements.  The command line tool could read the spec
file locally and send it off as one big text argument.  Again, I'm
interested in similar experiences if any.


    If I understand plpython correctly, it uses the python installed on
    the machine. In other words, plpythonu doesn't support the new style
    classes, it depends on what version of python is installed.
    In the same way, if you have libraries installed on your machine,
    plpythonu has access to them as well. So if someone installed
    pyrseas, he would be able to use all the functions from within his
    function.

    IMO, there is no need for an extension here, all you need to do is
    have an sql file containing your 2 plpythonu functions that can be
    run into the database.

    Sim

В списке pgsql-general по дате отправления:

Предыдущее
От: Andy Colson
Дата:
Сообщение: Re: Why PGSQL has no developments in the .NET area?
Следующее
От: pasman pasmański
Дата:
Сообщение: Re: How to find freak UTF-8 character?