plpython and current_timestamp / current_user

From: Vitor Tortorello <vitor(at)visuaw(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: plpython and current_timestamp / current_user
Date: 2003-07-30 17:40:30
Message-ID: 3F28030E.6010301@visuaw.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Michael Govorun 2003-07-30 17:54:20 Don't removes/recycles WAL files at all
Previous Message Ron Johnson 2003-07-30 17:39:33 Minimal system (was Re: Basic questions before start)