Problem with plpython

Поиск
Список
Период
Сортировка
От Steve Erickson
Тема Problem with plpython
Дата
Msg-id cc5073800910301124v7c71af81r95ef2f7025bd14ca@mail.gmail.com
обсуждение исходный текст
Ответы Re: Problem with plpython  (Justin Pasher <justinp@newmediagateway.com>)
Список pgsql-general
I'm running PostgreSQL 8.3 with pl/python 8.3.  I am getting a different date/time format when executing the below examples.  The results are the same whether I use os.popen or os.system.  In plpython, I run:
  import os
  cmd = 'ls -al /var/log/messages > /var/tmp/log'
  x = os.popen(cmd)
  for aline in x.readlines():
      plpy.notice('aline = %s', aline)

and the contents of /var/tmp/log are "-rw-r----- 1 syslog adm 495523 Oct 30 11:52 /var/log/messages

When, within Python, I run:
>>> cmd = 'ls -al /var/log/messages > /var/tmp/log'
>>> x = os.popen(cmd)
>>> for aline in x.readlines():
...   print aline

the contents of /var/tmp/log are "-rw-r----- 1 syslog adm 23591 2009-10-30 13:03 /var/log/messages

How, using plpython, can I get the output date/time in the same format as when executing from within python itself?

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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: CREATE TABLE LIKE and SERIAL
Следующее
От: Scott Bailey
Дата:
Сообщение: Re: Absolute value of intervals