Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgejK-00021W-Fu for pgsql-sql@arkaria.postgresql.org; Wed, 13 Nov 2013 17:59:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VgejJ-0004y4-O1 for pgsql-sql@arkaria.postgresql.org; Wed, 13 Nov 2013 17:59:53 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgejI-0004xx-Ji for pgsql-sql@postgresql.org; Wed, 13 Nov 2013 17:59:52 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vgej9-0002tR-D9 for pgsql-sql@postgresql.org; Wed, 13 Nov 2013 17:59:51 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Vgej8-0005Fa-NV for pgsql-sql@postgresql.org; Wed, 13 Nov 2013 09:59:42 -0800 Date: Wed, 13 Nov 2013 09:59:42 -0800 (PST) From: David Johnston To: pgsql-sql@postgresql.org Message-ID: <1384365582722-5778200.post@n5.nabble.com> In-Reply-To: <17777.1384365119@sss.pgh.pa.us> References: <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> <17777.1384365119@sss.pgh.pa.us> Subject: Re: Function args: TEXT -vs- VARCHAR? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.8 (+) 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 Tom Lane-2 wrote > David Johnston < > polobo@ > > 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) ...". +1 FWIW I have always read that as "if you care about stuff like precision and text lengths you have to deal with it yourself inside your function." Not that the PL implementation itself would be capable to doing something with the information. Since CREATE FUNCTION was doing the stripping I reasoned out the actual PL language interpreter never even saw the info. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Function-args-TEXT-vs-VARCHAR-tp5777968p5778200.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql