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 13:53:31
Message-ID: 20081021135331.GB6864@feivel.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 21, 2008 at 01:37:44PM +0200, Matthieu Imbert wrote:
> Yes microseconds are available in textual mode but i do want to use binary mode. Let me explain why:
> ...
> if i'm correct, it seems obvious that the second scenario is more efficient (and less ugly).

I wouldn't bet on scenario 2 being more efficient. For this you not only need
less conversions but also cheaper conversion. Now I haven't looked at this in
detail, but you might spend a lot of time doing stuff that has only a marginal
effect.

> In scenario 2, when talking about timestamp 'official' format, i mean timestamp expressed as number of microseconds since
> 2000-01-01. But of course, it only deserves this name 'official' if it is guaranteed to stay the same across postgresql versions and
> platforms

You shouldn't rely on this. Again I'd recommend using text.

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2008-10-21 14:01:17 Re: binary representation of datatypes
Previous Message Michael Meskes 2008-10-21 13:48:38 Re: automatic parser generation for ecpg