pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedBuild in function to verify email addresses
6+ messages / 6 participants
[nested] [flat]
* Build in function to verify email addresses
@ 2017-11-16 07:56 Nick Dro <postgresql@walla.co.il>
0 siblings, 4 replies; 6+ messages in thread
From: Nick Dro @ 2017-11-16 07:56 UTC (permalink / raw)
To: pgsql-general
<div dir='rtl'><div dir="ltr">I beleieve that every information system has the needs to send emails.</div>
<div dir="ltr">Currently PostgreSQL doesn't have a function which gets TEXT and return true if it's valid email address (xxx@YYY.com / .co.ZZ)</div>
<div dir="ltr">Do you believe such function should exist in PostgreSQL or it's best to let every user to implement his own function?</div></div>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Build in function to verify email addresses
@ 2017-11-16 08:05 Pavel Stehule <pavel.stehule@gmail.com>
parent: Nick Dro <postgresql@walla.co.il>
3 siblings, 1 reply; 6+ messages in thread
From: Pavel Stehule @ 2017-11-16 08:05 UTC (permalink / raw)
To: Nick Dro <postgresql@walla.co.il>; +Cc: pgsql-general
Hi
2017-11-16 8:56 GMT+01:00 Nick Dro <postgresql@walla.co.il>:
> I beleieve that every information system has the needs to send emails.
> Currently PostgreSQL doesn't have a function which gets TEXT and return
> true if it's valid email address (xxx@YYY.com / .co.ZZ)
> Do you believe such function should exist in PostgreSQL or it's best to
> let every user to implement his own function?
>
I don't think so this functionality should be in upstream - but it is good
use for some extension and placing it in PGXN or PostgreSQL community
repository.
Postgres has good regexp support and this case can be implemented by one
regexp.
you can use PLPerlu and use some modules from CPAN
http://search.cpan.org/~rjbs/Email-Valid-1.202/lib/Email/Valid.pm
Regards
Pavel
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Build in function to verify email addresses
@ 2017-11-16 14:55 Chris Withers <chris@simplistix.co.uk>
parent: Nick Dro <postgresql@walla.co.il>
3 siblings, 0 replies; 6+ messages in thread
From: Chris Withers @ 2017-11-16 14:55 UTC (permalink / raw)
To: Nick Dro <postgresql@walla.co.il>; pgsql-general
I'm pretty sure this isn't as simple as you think it is, I'd suggest
having a good read of:
https://stackoverflow.com/a/201378/216229
Chris
On 16/11/2017 07:56, Nick Dro wrote:
> I beleieve that every information system has the needs to send emails.
> Currently PostgreSQL doesn't have a function which gets TEXT and
> return true if it's valid email address (xxx@YYY.com / .co.ZZ)
> Do you believe such function should exist in PostgreSQL or it's best
> to let every user to implement his own function?
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Build in function to verify email addresses
@ 2017-11-16 15:13 btober@computer.org <btober@broadstripe.net>
parent: Nick Dro <postgresql@walla.co.il>
3 siblings, 0 replies; 6+ messages in thread
From: btober@computer.org @ 2017-11-16 15:13 UTC (permalink / raw)
To: Nick Dro <postgresql@walla.co.il>; +Cc: pgsql-general
----- Original Message -----
From: "Nick Dro" <postgresql@walla.co.il>
To: pgsql-general@postgresql.org
Sent: Thursday, November 16, 2017 2:56:42 AM
Subject: [GENERAL] Build in function to verify email addresses
I beleieve that every information system has the needs to send emails.
Currently PostgreSQL doesn't have a function which gets TEXT and return true if it's valid email address (xxx@YYY.com / .co.ZZ)
Do you believe such function should exist in PostgreSQL or it's best to let every user to implement his own function?
I don't mean to sound snarky, but did you even try to google search?
https://pgxn.org/dist/email/
https://github.com/asotolongo/email
or
https://github.com/petere/pgemailaddr
-- B
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Build in function to verify email addresses
@ 2017-11-16 15:44 Andreas Joseph Krogh <andreas@visena.com>
parent: Pavel Stehule <pavel.stehule@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Joseph Krogh @ 2017-11-16 15:44 UTC (permalink / raw)
To: pgsql-general
På torsdag 16. november 2017 kl. 09:05:00, skrev Pavel Stehule <
pavel.stehule@gmail.com <mailto:pavel.stehule@gmail.com>>:
Hi 2017-11-16 8:56 GMT+01:00 Nick Dro <postgresql@walla.co.il
<mailto:postgresql@walla.co.il>>: I beleieve that every information system has
the needs to send emails.
Currently PostgreSQL doesn't have a function which gets TEXT and return true
if it's valid email address (xxx@YYY.com / .co.ZZ)
Do you believe such function should exist in PostgreSQL or it's best to let
every user to implement his own function?
I don't think so this functionality should be in upstream - but it is good
use for some extension and placing it in PGXN or PostgreSQL community
repository.
Postgres has good regexp support and this case can be implemented by one
regexp.
you can use PLPerlu and use some modules from CPAN
http://search.cpan.org/~rjbs/Email-Valid-1.202/lib/Email/Valid.pm
<http://search.cpan.org/~rjbs/Email-Valid-1.202/lib/Email/Valid.pm;
Regards
Pavel
In general, I see no reason for a modern RDBMS not to provide an
email-datatype. IMV that's no different from other types which also could have
been plain-text but are convenient to have datatypes for.
Being an open-source project I guess one must show initiative and start a
discussion on -hackers to see what interesst there's in having one in core. I
for one hope there will be.
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas@visena.com <mailto:andreas@visena.com>
www.visena.com <https://www.visena.com;
<https://www.visena.com;
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Build in function to verify email addresses
@ 2017-11-16 15:45 Michael Nolan <htfoot@gmail.com>
parent: Nick Dro <postgresql@walla.co.il>
3 siblings, 0 replies; 6+ messages in thread
From: Michael Nolan @ 2017-11-16 15:45 UTC (permalink / raw)
To: Nick Dro <postgresql@walla.co.il>; +Cc: pgsql-general
On Thu, Nov 16, 2017 at 1:56 AM, Nick Dro <postgresql@walla.co.il> wrote:
> I beleieve that every information system has the needs to send emails.
> Currently PostgreSQL doesn't have a function which gets TEXT and return
> true if it's valid email address (xxx@YYY.com / .co.ZZ)
> Do you believe such function should exist in PostgreSQL or it's best to
> let every user to implement his own function?
>
There's a world of difference between an email address that is well-formed
and one that actually works.
In the systems I administer there's a lot of time spent dealing with
bounced mail to make sure that the email addresses we have actually reach
someone, hopefully the intended target. And in the US, bulk emailers also
have to deal with the CAN-SPAM act, which specifies procedures that must be
in place to allow easy administrative options to remove one'e email address
from mailing lists.
Procedures to verify that an email address works and to administer its use
under rules like CAN_SPAM cannot exist solely within the database itself.
And as others have noted, what makes for a 'well-formed' email address has
always been a bit complicated.
--
Mike Nolan
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2017-11-16 15:45 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16 07:56 Build in function to verify email addresses Nick Dro <postgresql@walla.co.il>
2017-11-16 08:05 ` Pavel Stehule <pavel.stehule@gmail.com>
2017-11-16 15:44 ` Andreas Joseph Krogh <andreas@visena.com>
2017-11-16 14:55 ` Chris Withers <chris@simplistix.co.uk>
2017-11-16 15:13 ` btober@computer.org <btober@broadstripe.net>
2017-11-16 15:45 ` Michael Nolan <htfoot@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox