Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vgebk-0001m4-0F for pgsql-sql@arkaria.postgresql.org; Wed, 13 Nov 2013 17:52:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vgebj-0002ly-Cn for pgsql-sql@arkaria.postgresql.org; Wed, 13 Nov 2013 17:52:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vgebi-0002ln-My for pgsql-sql@postgresql.org; Wed, 13 Nov 2013 17:52:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vgebf-0008W6-Vk for pgsql-sql@postgresql.org; Wed, 13 Nov 2013 17:52:02 +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 rADHpx5u017778; Wed, 13 Nov 2013 12:51:59 -0500 From: Tom Lane To: David Johnston cc: pgsql-sql@postgresql.org Subject: Re: Function args: TEXT -vs- VARCHAR? In-reply-to: <1384362845994-5778192.post@n5.nabble.com> 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> <6365.1384360602@sss.pgh.pa.us> <1384362845994-5778192.post@n5.nabble.com> Comments: In-reply-to David Johnston message dated "Wed, 13 Nov 2013 09:14:06 -0800" Date: Wed, 13 Nov 2013 12:51:59 -0500 Message-ID: <17777.1384365119@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 David Johnston writes: > Tom Lane-2 wrote >> skinner@.co (Craig R. Skinner) writes: >>> 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 ... > s/some/parenthetical/ ? [ thinks for a bit ] Actually, the existing text is wrong/misleading in another way, since it implies that a PL implementation *could* enforce parameter typmods if it wanted. It can't, because the information isn't even stored by CREATE FUNCTION. So we do need to do something about this text. Perhaps something like this: The full SQL type syntax is allowed for declaring a function's arguments and return value. However, parenthesized type modifiers (e.g., the precision field for type numeric) are discarded by CREATE FUNCTION. Thus for example "CREATE FUNCTION foo (varchar(10)) ..." is exactly the same as "CREATE FUNCTION foo (varchar) ...". 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