plpython and current_timestamp / current_user

Поиск
Список
Период
Сортировка
От Vitor Tortorello
Тема plpython and current_timestamp / current_user
Дата
Msg-id 3F28030E.6010301@visuaw.net
обсуждение исходный текст
Список pgsql-general
Hi.

1 - current_timestamp and current_user are not enable in plpython?

2 - About timestamp using plpython:
a.
    upd= strftime(''%Y-%m-%d %H:%M:%S'', localtime())
     TD["new"]["updated"]   = upd

psql:/tmp/insereusuario.sql:2: NOTICE:  ('2003-07-30 13:55:32',)
psql:/tmp/insereusuario.sql:2: ERROR:  TIMESTAMP(154) precision must be
between 0 and 6

b.
     qsql = plpy.prepare("SELECT fqdn_id, user, now() AS upd FROM fqdns
WHERE domain = $1", ["text"])
     qry = plpy.execute(qsql, [userdomain],1)

     plpy.notice(qry[0]["upd"])

     TD["new"]["updated"]   = qry[0]["upd"]

psql:/tmp/insereusuario.sql:2: NOTICE:  ('2003-07-30 13:58:23.19289-03',)
psql:/tmp/insereusuario.sql:2: ERROR:  TIMESTAMP(154) precision must be
between 0 and 6

3. links to plpython manuals are welcome.

Thank you.

Vitor


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Alter table
Следующее
От: Ron Johnson
Дата:
Сообщение: Minimal system (was Re: Basic questions before start)