Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 99AA21E0AD71 for ; Wed, 11 Jan 2012 21:22:43 -0400 (AST) Received: from nm20.bullet.mail.sp2.yahoo.com ([98.139.91.90]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Rl9NI-0001es-D1 for pgsql-sql@postgresql.org; Thu, 12 Jan 2012 01:22:42 +0000 Received: from [98.139.91.67] by nm20.bullet.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 01:22:26 -0000 Received: from [98.139.91.13] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 01:21:26 -0000 Received: from [127.0.0.1] by omp1013.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 01:21:26 -0000 X-Yahoo-Newman-Id: 429742.60184.bm@omp1013.mail.sp2.yahoo.com Received: (qmail 36880 invoked from network); 12 Jan 2012 01:21:26 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:References:Mime-Version:In-Reply-To:X-Apple-Yahoo-Original-Message-Folder:Content-Type:Content-Transfer-Encoding:Message-Id:Cc:X-Mailer:From:X-Apple-Yahoo-Replied-Msgid:Subject:Date:To; b=VFZShEnhQxIEOqZzkTJB0BVF4aubiZ3Y27BijzgogGHEtIMqW8v+bZxwTFiwjNdQxmP6CAXUQjmXp9QmiD8bZ/MiX97c4gHH7+bMJMspa+o5+YACTEElSw51TH33KfkfANT0d3ElHf1mnDg0LMpZN9aeVaCq1BKGM6gmp+s1+Cs= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326331286; bh=kjUgGWizrkMK1vMB5Zm1AHO6RMy2OA+hfUFGn+3Iecc=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:References:Mime-Version:In-Reply-To:X-Apple-Yahoo-Original-Message-Folder:Content-Type:Content-Transfer-Encoding:Message-Id:Cc:X-Mailer:From:X-Apple-Yahoo-Replied-Msgid:Subject:Date:To; b=ActmScHWLYwWWBbIyDk2kd6OSDX0Eepib5+e9YDFF1TaJ2rBISsqSX/Jgnik8HoLutNq9rlrJu5aeQrUTu4zs9S+VwL92OO1IoEK1FiPmZcXr24XGJXyCBdv8p47HBU7YiTZAs9oMPxwkN1jU+Wj6vYIzfqrpNv49VysKp6QbjE= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: OOE1jc0VM1mPgdJSlhOunkKfDIa.flyJijgWrq18QSGOlLF TYjYc0qDjrEr3q6Irplf2f1UpLHWGLdt7hlfjD9m4NrO5PnMwQWpH.jelRDg NJo0sFMJjnc86myCkJf7g85HvI4jF35eUUFW57GlN35dH5Wrbr.BGnFr5TRK xn45xsUSqsbRfS4M2ON6NNFs31xkSOomhB3wJ143qWy8VsuUKb.ACnwmDSb1 ndrWMZJsQiYoDHHthwuqSketmhAmwIoaACT7JllWCzo3D002fIr2kMXH8MXM nwrShwW7UWozQg42ETcKB_UiP9i2eh7X3l_BrrrDrGcJUDr9EB_kxcqybyww X5DYUGmc2HCz57eYpb9xMWlnN62n_kx5_w9Ul6O9Z3co24VXF.DxkNJBeB3E kFi654A-- X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from [192.12.17.102] (polobo@24.93.23.188 with xymcookie) by smtp114-mob.biz.mail.gq1.yahoo.com with SMTP; 11 Jan 2012 17:21:25 -0800 PST References: <00be01ccd0bf$1340da50$39c28ef0$@yahoo.com> Mime-Version: 1.0 (iPad Mail 8J2) In-Reply-To: X-Apple-Yahoo-Original-Message-Folder: Inbox Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <26EC0BB6-61A9-4DBE-BEB0-7043F44A5A9D@yahoo.com> Cc: "PostgreSQL \(SQL\)" X-Mailer: iPad Mail (8J2) From: David Johnston X-Apple-Yahoo-Replied-Msgid: 1_436019_AOakiGIAAQz2Tw4pswsX9TN8IfQ Subject: Re: Unable To Alter Data Type Date: Wed, 11 Jan 2012 20:21:25 -0500 To: Carlos Mennens X-Pg-Spam-Score: -2.0 (--) X-Archive-Number: 201201/44 X-Sequence-Number: 36215 On Jan 11, 2012, at 19:30, Carlos Mennens wrote: > On Wed, Jan 11, 2012 at 7:13 PM, David Johnston wrote: >> However, I will say again, you DO NOT WANT TO ACTUALLY DO THIS! >>=20 >> The specific issue is that some US Postal Code begin with a zero ( 0 ) an= d >> so whenever you want to the zip_code value you need to pad leading zeros i= f >> the length is less than 5. Now consider that a full zip_code can be in 5= +4 >> format with an embedded hyphen and you no longer can even store it as >> numeric. If you deal with Canada (and maybe Mexico) at all then spaces a= nd >> letters become acceptable characters within the zip_code. >=20 > David - Thank you for that great info / explanation. Very informative > and helpful. I was not required to make this change but rather just > goofing off attempting to learn SQL as I'm rather terrible at it. Can > you tell me if there's an organized cheat sheet or something > documented in regards to data types commonly used for commonly used > field association? I think that's great for people who can't look at > the documentation and clearly understand specific definitions or > assumed categorization based on the type definition. If you can perform reasonable arithmetic on the field value you encode it as= a number otherwise you should use text; even if the only possibly valid va= lues are numbers. David J.