Re: binary representation of datatypes

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Matthieu Imbert <matthieu(dot)imbert(at)ens-lyon(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: binary representation of datatypes
Date: 2008-10-21 09:40:34
Message-ID: 20081021094034.GA24468@feivel.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 21, 2008 at 10:21:38AM +0200, Matthieu Imbert wrote:
> I would like to be able to get results from SQL commands directly in a
> binary format, instead of a textual one. Actually, I want to be able to
> get timestamps with their full precision (microsecond).

Are you sure you cannot get those in textual mode? If so I wonder why I got
some numbers in a quick test:

...
[NO_PID]: ecpg_execute on line 37: query: select * from date_test where d = $1 ; with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: free_params on line 37: parameter 1 = 1966-01-17
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 37: correctly got 1 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 37: RESULT: 1966-01-17 offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_get_data on line 37: RESULT: 2000-07-12 17:34:29.140787 offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
...

What do I miss here?

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes(at)jabber(dot)org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2008-10-21 09:48:36 SE-PostgreSQL wiki updates, but ...
Previous Message Martijn van Oosterhout 2008-10-21 09:01:28 Re: SSL cleanups/hostname verification