PDA

View Full Version : PostgreSQL prob with timestamp column


Jean-René
07-05-2005, 12:29 PM
I'm trying to imort data from a postgre dump file to a db on your server but it seems that phpPgAdmin dosent like the copy commande <br/> I can't insert a specific timstamp value here is a insert exempl that i have tried :
<code>
INSERT INTO "commain"("comno", "comcli", "comdate", "compay", "comcc", "comexp1", "comtotal", "comconf", "comtps", "comtvq", "comnom", "comexp", "posted") VALUES ('250562',2003-12-30 00:00:00.000000,'XXX','\N','\N','42.49','\N','2.37 ','2.72','\N','\N','false')
</code>
and many other variation but to no avail

thanks for any input

jack
07-05-2005, 04:04 PM
It would be helpful to provide us with the SQL error you receive.

Also I might be not right but I think that you specify that you will insert 13 fields in the DB but give values for only 12. I think that you are missing the first field "comno" in the VALUES parts. Also I think that you should enclose the date field value in quotation marks.

Jean-René
07-05-2005, 04:09 PM
i'v found my answer i must cast the string in the timestamp format using 'string value'::timestamp and you are right the query i posted lacked one field