Re: NUMERIC x VARCHAR

From: Er Galvão Abbott <galvao(at)galvao(dot)eti(dot)br>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: NUMERIC x VARCHAR
Date: 2004-08-11 17:13:47
Message-ID: 411A53CB.8030209@galvao.eti.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Verdana">Thanks, Michael.<br>
<br>
You and "Evil Azrael" (lol) got me. Never thought about leading zeros.<br>
<br>
Varchar it is!<br>
<br>
Thanks a lot,</font><br>
<pre class="moz-signature" cols="72">--
Er Galv&atilde;o Abbott
Desenvolvedor Web
<a class="moz-txt-link-freetext" href="http://www.galvao.eti.br/">http://www.galvao.eti.br/</a>
<a class="moz-txt-link-abbreviated" href="mailto:galvao(at)galvao(dot)eti(dot)br">galvao(at)galvao(dot)eti(dot)br</a></pre>
<br>
<br>
Michael Glaesemann wrote:<br>
<blockquote cite="midD909485D-EB69-11D8-831D-000A95C88220(at)myrealbox(dot)com"
type="cite"><br>
On Aug 11, 2004, at 4:27 PM, Er Galv&atilde;o Abbott wrote:
<br>
<br>
<blockquote type="cite">It will. As I've said I wont be storing any
symbols.
<br>
</blockquote>
<br>
It won't store leading zeros, however. This may or may not be an issue
for you.
<br>
<br>
<br>
test=# create table tel (name_id integer not null, tel_numeric
numeric(15) not null, tel_varchar varchar(15) not null);
<br>
CREATE TABLE
<br>
test=# insert into tel (name_id, tel_numeric, tel_varchar) values
(1,012345678911234, '012345678911234');
<br>
INSERT 17153 1
<br>
test=# select * from tel;
<br>
&nbsp;name_id |&nbsp; tel_numeric&nbsp;&nbsp; |&nbsp;&nbsp; tel_varchar
<br>
---------+----------------+-----------------
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 | 12345678911234 | 012345678911234
<br>
(1 row)
<br>
<br>
I would do as another poster suggested: create a telephone number
domain as text with the check constraints you desire.
<br>
<br>
Michael Glaesemann
<br>
grzm myrealbox com
<br>
</blockquote>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.8 KB

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message pgsql 2004-08-11 17:14:05 Re: fsync vs open_sync
Previous Message Merlin Moncure 2004-08-11 17:04:00 Re: Hardware upgrade for a high-traffic database