From: | Patrick B <patrickbakerbr(at)gmail(dot)com> |
---|---|
To: | Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> |
Cc: | "Steve Petrie, P(dot)Eng(dot)" <apetrie(at)aspetrie(dot)net>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: overwrite column data select - Postgres 9.2 |
Date: | 2016-09-21 23:11:27 |
Message-ID: | CAJNY3isMySMOQPht_BAgrrwVAn+0E=FiuQkn-wBuAr5R5nSLVw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
2016-09-22 10:02 GMT+12:00 Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>:
> On 9/21/16 1:50 PM, Steve Petrie, P.Eng. wrote:
>
>>
>> The reason I ask is -- the maximum length of a valid email address is
>> actually 256 characters (or 254, according comments in the PHP function
>> is_valid_email_address(...) that I found on the Internet at
>> http://code.iamcal.com/ and use myself).
>>
>> In my own PG DDL, I define email addresses like:
>>
>> contact_email_addr varchar(256) NOT NULL,
>>
>
> FWIW, I stay away from varchar limits that are more than a "suggestion".
> Generally speaking it's just not worth limiting to something like 50, then
> the business decides they want 60, then 70, then... I still use varchar to
> ensure the database can't get DOS'd with garbage, but I'll just set
> something like varchar(100). That said, if there's a defined limit for
> email address length, might as well use it...
>
> Disclosure: I'm a PG newbie (and a relative SQL newbie, too), and not
>> familiar with the DEFAULT ":: notation in your DDL.
>>
>
> The :: is a cast that was presumably added by Postgres when the default
> was assigned. It's equivalent to DEFAULT ''. I definitely don't like
> defaults like that... if you don't know what the email is then it should be
> NULL. Or to put it another way, having a default set largely defeats the
> purpose of NOT NULL (IMHO).
> --
>
>
Rather than test(dot)UID(dot)(at)example(dot)com <test(dot)UID(dot)(at)tikcha(dot)com> I was hoping for
values such as:
test.4645364.@ <test(dot)4645364(dot)(at)tikcha(dot)com>example.com <test(dot)UID(dot)(at)tikcha(dot)com>
test.8786756.@ <test(dot)8786756(dot)(at)tikcha(dot)com>example.com <test(dot)UID(dot)(at)tikcha(dot)com>
With UNIQUE UUID
is that possible?
Cheers
Patrick
From | Date | Subject | |
---|---|---|---|
Next Message | CS DBA | 2016-09-21 23:54:01 | json select question |
Previous Message | Jim Nasby | 2016-09-21 22:02:13 | Re: overwrite column data select - Postgres 9.2 |