Re: datatype advice numeric vs. varchar

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: gene(at)sotech(dot)us
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: datatype advice numeric vs. varchar
Date: 2007-01-18 07:07:45
Message-ID: 45AF1CC1.7070009@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gene schrieb:
> you're probably right, actually using LIKE with numeric works fine but
> of course i will have to contend with things like truncating zeros to
> the left etc... are there any advantages to using ascii encoding as
> far as performance of LIKE, REGEXES, INDEXES etc versus using UTF8?

Well if you are really concerned, write a custom datatype where you
store 2 digits of the telephone number in one byte. A nibble for
0-9+-/ und " " should be plenty (you would even have a c-like
string end marker :-) Of course you would need to write operators
for everything you want to do w/ it. IIRC, there were even plans
I read on the list to write such a datatype. Maybe you scan the
list archives first.

Regards
Tino

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-01-18 07:08:25 Re: Index bloat of 4x
Previous Message Darmawan Sugiarto 2007-01-18 06:32:51 libpq/libpq-fs.h