https://github.com/petere/pgemailaddr
email address type for PostgreSQL
https://github.com/petere/pgemailaddr
Last synced: over 1 year ago
JSON representation
email address type for PostgreSQL
- Host: GitHub
- URL: https://github.com/petere/pgemailaddr
- Owner: petere
- Created: 2015-11-20T21:33:31.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2025-03-26T11:01:29.000Z (over 1 year ago)
- Last Synced: 2025-03-27T18:21:57.400Z (over 1 year ago)
- Language: C
- Homepage: https://twitter.com/pvh/status/667106073199775744
- Size: 3.91 KB
- Stars: 44
- Watchers: 5
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- starred-awesome - pgemailaddr - email address type for PostgreSQL (C)
README
`emailaddr` type for PostgreSQL
===============================
https://twitter.com/pvh/status/667106073199775744
This is an extension for PostgreSQL that provides a type `emailaddr`
for storing email addresses.
Installation
------------
To build and install this module:
make
make install
or selecting a specific PostgreSQL installation:
make PG_CONFIG=/some/where/bin/pg_config
make PG_CONFIG=/some/where/bin/pg_config install
And finally inside the database:
CREATE EXTENSION emailaddr;
Using
-----
This module provides a data type `emailaddr` that you can use like a
normal type. For example:
```sql
CREATE TABLE accounts (
id int PRIMARY KEY,
name text,
email emailaddr
);
INSERT INTO accounts VALUES (1, 'Peter Eisentraut', 'peter@eisentraut.org');
```
The accepted addresses correspond approximately to the `addr-spec`
production in [RFC 5322](https://www.rfc-editor.org/rfc/rfc5322.txt)
(so it's of the type `foo@bar.com`, but not `"Some Name"
`).
Request for feedback
--------------------
Let me now what other functionality you wish to see in an email
address type.