[DOCS] CREATE DOMAIN should also include an example of use with functions

Поиск
Список
Период
Сортировка
От postgresql@eric.brechemier.name
Тема [DOCS] CREATE DOMAIN should also include an example of use with functions
Дата
Msg-id 20170202204935.1400.31181@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: CREATE DOMAIN should also include an example of use withfunctions  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список 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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [DOCS] Encoding change actually works)
Следующее
От: postgresql@eric.brechemier.name
Дата:
Сообщение: [DOCS] Cross-references between DOMAIN and POLICY