Re: binary representation of datatypes - Mailing list pgsql-hackers

From Jeroen Vermeulen
Subject Re: binary representation of datatypes
Date
Msg-id 48FECA8A.5050702@xs4all.nl
Whole thread Raw
In response to Re: binary representation of datatypes  (Matthieu Imbert <matthieu.imbert@ens-lyon.fr>)
Responses Re: binary representation of datatypes
List pgsql-hackers
Matthieu Imbert wrote:

> scenario 1 - parse the textual representation of all results of requests to the database and convert textual
timestampsto a binary
 
> format that i choose among those ones (number of microseconds since 2000-01-01, or a structure similar to pg_tm (but
with
> microsecond precision), or a time-format similar to one defined in rfc1305, or something else)
> 
> or
> 
> scenario 2 - directly use pgsql binary timestamp format. I think the latter is far more efficient. I'm new to
postgresql,but from
 
> what i understand, here are the conversions involved in both scenarios (hopping that my ascii art won't be garbled by
yourmail
 
> clients ;-) :
> 
> 
> scenario 1:
> .---------.  .----------.  .---------.  .----------.  .--------------.  .----------.  .---------.
> |timestamp|  |pgsql     |  |timestamp|  |pgsql     |  |timestamp     |  |my        |  |my       |
> |storage  |->|internal  |->|storage  |->|network   |->|as            |->|timestamp |->|timestamp|
> |in       |  |to        |  |in       |  |to        |  |textual       |  |conversion|  |format   |
> |database |  |network   |  |network  |  |textual   |  |representation|  |routines  |  |         |
> |backend  |  |conversion|  |         |  |conversion|  |              |  |          |  |         |
> |         |  |function  |  |         |  |function  |  |              |  |          |  |         |
> '---------'  '----------'  '---------'  '----------'  '--------------'  '----------'  '---------'

I think this scenario has two boxes too many.  Why would the backend 
convert to network representation before converting to text?


Jeroen


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bitmap Indexes: request for feedback
Next
From: Matthieu Imbert
Date:
Subject: Re: binary representation of datatypes