Re: timestamp and mxDateTime
Karsten Hilbert <[email protected]> Wed, 29 Sep 2004 08:14:01 +0200
| Newsgroups | gmane.comp.python.db.pypgsql.user |
|---|---|
| Message-ID | <[email protected]> |
> --------------------------
> 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.
Erm, *which* column ? You certainly don't say in your insert
query. Likely you are thinking it inserts into one column
while it actually does insert into another.
> libpq.OperationalError: ERROR: value too long for type character varying(4)
Look out for varchar(4) columns in your table.
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl