Skip site navigation (1) Skip section navigation (2)

Re: NUMERIC x VARCHAR

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: galvao(at)galvao(dot)eti(dot)br
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: NUMERIC x VARCHAR
Date: 2004-08-11 07:41:25
Message-ID: D909485D-EB69-11D8-831D-000A95C88220@myrealbox.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Aug 11, 2004, at 4:27 PM, Er Galvão Abbott wrote:

> It will. As I've said I wont be storing any symbols.

It won't store leading zeros, however. This may or may not be an issue 
for you.


test=# create table tel (name_id integer not null, tel_numeric 
numeric(15) not null, tel_varchar varchar(15) not null);
CREATE TABLE
test=# insert into tel (name_id, tel_numeric, tel_varchar) values 
(1,012345678911234, '012345678911234');
INSERT 17153 1
test=# select * from tel;
  name_id |  tel_numeric   |   tel_varchar
---------+----------------+-----------------
        1 | 12345678911234 | 012345678911234
(1 row)

I would do as another poster suggested: create a telephone number 
domain as text with the check constraints you desire.

Michael Glaesemann
grzm myrealbox com


In response to

Responses

pgsql-performance by date

Next:From: Merlin MoncureDate: 2004-08-11 12:21:33
Subject: Re: Hardware upgrade for a high-traffic database
Previous:From: Er Galvão AbbottDate: 2004-08-11 07:27:31
Subject: Re: NUMERIC x VARCHAR

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group