From: Michael H. <Mi...@Hi...> - 2004-09-29 13:11:49
|
Karsten Hilbert wrote: >>-------------------------- >>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. There is only one column in that table as it is a "test" for the timestamp type since that is what is giving me trouble. Here is the SQL that created it: CREATE TABLE dailylog ( enttime timestamp -- time entered by the operator ); Which is why the error about "varchar(4)" is puzzling since I have none. Thank you, Michael |