pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: postgresql@eric.brechemier.name
To: pgsql-docs@postgresql.org
Subject: CREATE DOMAIN should also include an example of use with functions
Date: Thu, 02 Feb 2017 20:49:35 +0000
Message-ID: <20170202204935.1400.31181@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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)

-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


view thread (3+ messages)  latest in thread

Message-ID: <20170202204935.1400.31181@wrigleys.postgresql.org>
Permalink:  ../20170202204935.1400.31181@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170202204935.1400.31181@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: postgresql@eric.brechemier.name
  Subject: Re: CREATE DOMAIN should also include an example of use with functions
  In-Reply-To: <20170202204935.1400.31181@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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