[DOCS] CREATE DOMAIN should also include an example of use with functions - Mailing list pgsql-docs

From postgresql@eric.brechemier.name
Subject [DOCS] CREATE DOMAIN should also include an example of use with functions
Date
Msg-id 20170202204935.1400.31181@wrigleys.postgresql.org
Whole thread Raw
Responses Re: CREATE DOMAIN should also include an example of use withfunctions  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.6/static/sql-createdomain.html
Description:

The documentation of CREATE DOMAIN currently describes how optional
constraints can be useful for the fields of a table. There is no mention of
functions in this page.

I have recently found two use cases for domains with functions:

1. validation of the format of user inputs (mobile phone number, email
address, etc.) before any further processing in the function.

2. provide CURRENT_USER to a SECURITY DEFINER function (more details here:
http://stackoverflow.com/a/42011279/207968)

pgsql-docs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [DOCS] Encoding change actually works)
Next
From: postgresql@eric.brechemier.name
Date:
Subject: [DOCS] Cross-references between DOMAIN and POLICY