Received: from sivka.carrier.kiev.ua (root@sivka.carrier.kiev.ua [193.193.193.101]) by hub.org (8.10.1/8.10.1) with ESMTP id e9FLLqR09505 for ; Sun, 15 Oct 2000 17:21:53 -0400 (EDT) Received: from planka.carrier.kiev.ua (root@users.lucky.net [193.193.193.106]) by sivka.carrier.kiev.ua (8/Kilkenny_is_better) with ESMTP id AIK56588 for ; Mon, 16 Oct 2000 00:21:48 +0300 (EEST) (envelope-from evpopkov@carrier.kiev.ua) Received: from ed.ed (ln2-141.users.lucky.net [193.193.199.141]) by planka.carrier.kiev.ua (8) with ESMTP id AIJ07195 for ; Mon, 16 Oct 2000 00:21:47 +0300 (EEST) (envelope-from evpopkov@carrier.kiev.ua) Received: (from root@localhost) by ed.ed (8.8.7/8.8.5) id VAA00430 for pgsql-sql@postgresql.org; Sun, 15 Oct 2000 21:17:57 GMT From: KuroiNeko Date: Sun, 15 Oct 2000 21:17:57 +0000 To: pgsql-sql@postgresql.org Subject: Re: Variable-length Types Message-ID: <39EA1F05.nailA91QW5LV@ed.ed> References: <871yxi432t.fsf@matt.w80.math-hat.com> <39E9F80C.D9BE2054@agliodbs.com> <5470.971641584@sss.pgh.pa.us> <39EA154F.A5D9C9A2@agliodbs.com> User-Agent: nail 9.14 2000-06-26 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/136 X-Sequence-Number: 1798 Josh, > Thanks. You're probably right ... reformatting the phone numbers is > going to be a lot less work than a custom type. I remember from the old days of Delphi/InterBase, and even older days of Paradox, there were so called input masks, US phone code mask would be like (999)_000-00-00 or something like that (no default values) Borland has released their Turbo stuff for public domain, so it might be worth looking at. Implementing a generic picture functions (as in PL/I) would probably be easier and cover more cases. However, watch your back with user-supplied format strings, there's a plenty of ruined lives at BugTraq :) I'm just not sure what to do if 8 or 9 digits are supplied? Maybe, reject, assuming that such things should be caught by UI, and if we get such a weird thing, there's something really really wrong? -- Well I tried to be meek And I have tried to be mild But I spat like a woman And I sulked like a child I have lived behind the walls That have made me alone Striven for peace Which I never have known Dire Straits, Brothers In Arms, The Man's Too Strong (Knopfler)