datatype advice numeric vs. varchar - Mailing list pgsql-general

From Gene
Subject datatype advice numeric vs. varchar
Date
Msg-id 430d92a20701172215o4dbd644dh4418fb3346a85906@mail.gmail.com
Whole thread Raw
Responses Re: datatype advice numeric vs. varchar  (Martijn van Oosterhout <kleptog@svana.org>)
Re: datatype advice numeric vs. varchar  (Michael Glaesemann <grzm@seespotcode.net>)
List pgsql-general
I'm working on a voicemail application which involves storing phone
numbers and other types that have long sequences of digits [0-9]. I
need to be able to do pattern matching using LIKE and map the fields
back to java String objects. I was thinking maybe it would be more
efficient to use the numeric(x,0) type instead of a varchar since it
could use less space on disk.

My calculations for disk space based off some information i found
online are ( 8 + ( 2 bytes for every four digits) ) for numeric and (
4 + number of chars ) for a utf8 varchar datatype. Are these
calculations still valid and has anyone tried using numeric for this
purpose or is this really stupid?

Thanks for any hints!
Gene

pgsql-general by date:

Previous
From: "Adam Rich"
Date:
Subject: Re: How I can read-back a serial value just inserted?
Next
From: Martijn van Oosterhout
Date:
Subject: Re: FATAL: invalid frontend message type 47 server closed the connection unexpectedly