pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedbinary copy timestamps with libpq
3+ messages / 1 participants
[nested] [flat]
* binary copy timestamps with libpq
@ 2006-10-19 03:38 Stephen Byers <stephenabyers@yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Byers @ 2006-10-19 03:38 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* binary copy timestamps with libpq
@ 2006-10-19 03:53 Stephen Byers <stephenabyers@yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Byers @ 2006-10-19 03:53 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: binary copy timestamps with libpq
@ 2006-10-19 12:15 Stephen Byers <stephenabyers@yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Byers @ 2006-10-19 12:15 UTC (permalink / raw)
To: pgsql-interfaces
I just discovered PGTYPEStimestamp_from_asc().
I'm sure that will help me -- is this the correct method to use?
----- Original Message ----
From: Stephen Byers <stephenabyers@yahoo.com>
To: pgsql-interfaces@postgresql.org
Sent: Wednesday, October 18, 2006 11:38:19 PM
Subject: [INTERFACES] binary copy timestamps with libpq
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2006-10-19 12:15 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-10-19 03:38 binary copy timestamps with libpq Stephen Byers <stephenabyers@yahoo.com>
2006-10-19 03:53 binary copy timestamps with libpq Stephen Byers <stephenabyers@yahoo.com>
2006-10-19 12:15 Re: binary copy timestamps with libpq Stephen Byers <stephenabyers@yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox