Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 5E6FB9FB285 for ; Thu, 19 Oct 2006 09:24:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 26794-05-2 for ; Thu, 19 Oct 2006 12:22:41 +0000 (UTC) X-Greylist: delayed 00:06:38.319036 by SQLgrey- Received: from web30714.mail.mud.yahoo.com (web30714.mail.mud.yahoo.com [68.142.201.252]) by postgresql.org (Postfix) with SMTP id 6425F9FB25E for ; Thu, 19 Oct 2006 09:22:41 -0300 (ADT) Received: (qmail 6756 invoked by uid 60001); 19 Oct 2006 12:15:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type; b=yO6Pl0EYUOT/crg0fs8RSLu6wlShTGm8GKx9Hjflb8XOx8qG6ZMflgwj0GD/XSVa14unN9xEnaI0J7Kle2sip+TAeeji9CdYN3m0a9bPH5RSIZaf8tNigNnP2r5T3TK1DYIoSd/uGvyny71nAO8A24gSs54ZMkkc6JeaWnxZj38= ; Message-ID: <20061019121559.6754.qmail@web30714.mail.mud.yahoo.com> Received: from [199.36.20.5] by web30714.mail.mud.yahoo.com via HTTP; Thu, 19 Oct 2006 05:15:59 PDT Date: Thu, 19 Oct 2006 05:15:59 -0700 (PDT) From: Stephen Byers Subject: Re: binary copy timestamps with libpq To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-689457914-1161260159=:5658" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.852 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, HTML_40_50, HTML_MESSAGE X-Spam-Level: *** X-Archive-Number: 200610/22 X-Sequence-Number: 6305 --0-689457914-1161260159=:5658 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable I just discovered PGTYPEStimestamp_from_asc(). =0AI'm sure that will help m= e -- is this the correct method to use?=0A=0A=0A----- Original Message ----= =0AFrom: Stephen Byers =0ATo: pgsql-interfaces@pos= tgresql.org=0ASent: Wednesday, October 18, 2006 11:38:19 PM=0ASubject: [INT= ERFACES] binary copy timestamps with libpq=0A=0A=0AI 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. = =0A =0AI have tried a few different ways, setting the paramFormat to 0 (ASC= II) and paramType to OID_TIMESTAMP (1114). I've tried various strings, quo= ted 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'::tim= estamp)=0A =0AWhat 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)=0A =0A(I am also having the same troub= le with the interval data type.)=0A =0AAny help most appreciated!=0AThanks,= =0ASteve=0A=0A --0-689457914-1161260159=:5658 Content-Type: text/html; charset=ascii Content-Transfer-Encoding: quoted-printable
I just discovered PGTY= PEStimestamp_from_asc().
=0A
I'm sure that will help me -- is this the co= rrect method to use?
=0A

 
=0A
= ----- 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 l= ibpq

=0A
=0A
I am using postgres 8.1.4 and am tryi= ng to use the binary copy interface via libpq (PQputCopyData, PQputCopyEnd)= .  I am having trouble doing the copy for timestamp fields.  =0A
 
=0A
I have tried a few different ways, setting th= e paramFormat to 0 (ASCII) and paramType to OID_TIMESTAMP (1114).  I'v= e tried various strings, quoted and unquoted, also with "::timestamp" as pa= rt of the string -- but I am having no luck at getting the data to ins= ert.  ('2006-10-19 05:26:00'::timestamp)
=0A
 
=0A<= DIV>What am I doing wrong?  Is ASCII supported for timestamp type= in binary copy mode?  If not, how do I convert my timestamp to postgr= es's format (I am using default settings)
=0A
 
=0A
= (I am also having the same trouble with the interval data type.)
=0A 
=0A
Any help most appreciated!
=0A
Thanks,=0A
Steve

=0A


--0-689457914-1161260159=:5658--