From: Michael H. <Mi...@Hi...> - 2004-09-28 14:18:39
|
Hello, first post. I'm fairly new to Python, PostgreSQL and pyPgSQL so please forgive if I'm doing something dumb ... How do you store an mxDateTime in a database? Here's the essence of my code: -------------------------- from pyPgSQL import PgSQL from mx.DateTime import * db = PgSQL.connect(dsn="localhost", database="test") cursor = db.cursor() rightnow = now() cursor.execute("insert into dailylog values (%s)", rightnow) -------------------------- That column in PostgreSQL was defined as a 'timestamp' type. This gives error: libpq.OperationalError: ERROR: value too long for type character varying(4) Any help appreciated, Michael |