Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgdRW-00077U-2Z for pgsql-sql@arkaria.postgresql.org; Wed, 13 Nov 2013 16:37:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VgdRV-0003X7-H2 for pgsql-sql@arkaria.postgresql.org; Wed, 13 Nov 2013 16:37:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgdRU-0003Vm-1w for pgsql-sql@postgresql.org; Wed, 13 Nov 2013 16:37:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgdRN-000725-L0 for pgsql-sql@postgresql.org; Wed, 13 Nov 2013 16:37:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id rADGagUA006366; Wed, 13 Nov 2013 11:36:42 -0500 From: Tom Lane To: skinner@britvault.co.uk (Craig R. Skinner) cc: pgsql-sql@postgresql.org Subject: Re: Function args: TEXT -vs- VARCHAR? In-reply-to: <20131113155113.GA26600@teak.britvault.co.uk> References: <20131112181744.GA7522@teak.britvault.co.uk> <20131113130308.GA17439@teak.britvault.co.uk> <20131113141718.GA29223@teak.britvault.co.uk> <20131113142515.GB29223@teak.britvault.co.uk> <52838DF0.8040708@gmail.com> <20131113155113.GA26600@teak.britvault.co.uk> Comments: In-reply-to skinner@britvault.co.uk (Craig R. Skinner) message dated "Wed, 13 Nov 2013 15:51:13 +0000" Date: Wed, 13 Nov 2013 11:36:42 -0500 Message-ID: <6365.1384360602@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org skinner@britvault.co.uk (Craig R. Skinner) writes: > On 2013-11-13 Wed 06:34 AM |, Adrian Klaver wrote: >> The full SQL type syntax is allowed for input arguments and return >> value. However, some details of the type specification (e.g., the >> precision field for type numeric) are the responsibility of the >> underlying function implementation and are silently swallowed (i.e., >> not recognized or enforced) by the CREATE FUNCTION command. > That's rather vague..... "... some details ..." What's ignored by CREATE FUNCTION (and, indeed, pretty much the entire type inference mechanism) is typmod. So any parenthesized modifier for a type name is not considered. Usually those are length/precision constraints, but user-defined types might do something else with them. > An explicit table of datatype & what's "silently swallowed" would be > valuable to clarify this topic that's said to be often repeatedly asked. Can't be asked that often, as that text has been untouched for more than a dozen years ... regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql