Search Postgresql Archives

Re: Control PhoneNumber Via SQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 15, 2018 at 4:10 AM, tango ward <tangoward15@xxxxxxxxx> wrote:

Hi,

Sorry for asking question again.

I would like to know if it is possible to control the phone number in SQL before inserting it to the destination DB?

I have a model in Django:

class BasePerson(TimeStampedModel):
 phone_number = PhoneNumberField(max_length=50, verbose_name=_(u'phone number'), blank=True)


The data for phone number that I am migrating doesn't have country code. I want to determine first if the number has country code in it, if it doesn't then I will add the country code on the number before INSERTING it to the destination database.

Any suggestion will be highly appreciated.


Thanks,
J
I don't have any code for you, if that is what you are soliciting. I did find a couple of informative web sites which help explain how international phone numbers are formatted. These are known as E.164 numbers.



Note that the above mainly talk about how a number is formatted, not on how to validate that it is an actual phone number. You must trust the end user. Which is another can of worms. Case in point -- Yesterday I got 6 automated phone calls from the local cable company to verify some installation. The problem is, I am not installing anything. The person either gave them a bad number or mistyped it into a web page or the customer service rep mistyped it.​

--
We all have skeletons in our closet.
Mine are so old, they have osteoporosis.

Maranatha! <><
John McKown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux