Skip site navigation (1) Skip section navigation (2)

binary copy timestamps with libpq

From: Stephen Byers <stephenabyers(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: binary copy timestamps with libpq
Date: 2006-10-19 03:53:29
Message-ID: 20061019035329.76361.qmail@web30705.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
I am using postgres 8.1.4 and am trying to use the binary copy interface via libpq (PQputCopyData, PQputCopyEnd).  I am having trouble doing the copy for timestamp fields.  
 
I have tried a few different ways, setting the paramFormat to 0 (ASCII) and paramType to OID_TIMESTAMP (1114).  I've tried various strings, quoted and unquoted, also with "::timestamp" as part of the string -- but I am having no luck at getting the data to insert.  ('2006-10-19 05:26:00'::timestamp)
 
What am I doing wrong?  Is ASCII supported for timestamp type in binary copy mode?  If not, how do I convert my timestamp to postgres's format (I am using default settings)
 
(I am also having the same trouble with the interval data type.)
 
Any help most appreciated!
Thanks,
Steve

pgsql-interfaces by date

Next:From: Stephen ByersDate: 2006-10-19 12:15:59
Subject: Re: binary copy timestamps with libpq
Previous:From: Stephen ByersDate: 2006-10-19 03:38:19
Subject: binary copy timestamps with libpq

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group