Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V8zCM-0003O4-T5 for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2013 20:58:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V8zCM-0005EB-AD for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2013 20:58:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V8zCL-0005E3-CD for pgsql-hackers@postgresql.org; Mon, 12 Aug 2013 20:58:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V8zCJ-0002le-13 for pgsql-hackers@postgresql.org; Mon, 12 Aug 2013 20:58:41 +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 r7CKwNZr026074; Mon, 12 Aug 2013 16:58:23 -0400 From: Tom Lane To: Bruce Momjian cc: amutu@amutu.com, PostgreSQL-development Subject: Re: [BUGS] BUG #8335: trim() un-document behaviour In-reply-to: <20130812202910.GE12510@momjian.us> References: <20130807161953.GZ11189@momjian.us> <19166.1376060775@sss.pgh.pa.us> <20130809162359.GA3353@momjian.us> <20130812141144.GA12510@momjian.us> <21732.1376330108@sss.pgh.pa.us> <22386.1376331481@sss.pgh.pa.us> <20130812202910.GE12510@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Mon, 12 Aug 2013 16:29:10 -0400" Date: Mon, 12 Aug 2013 16:58:23 -0400 Message-ID: <26073.1376341103@sss.pgh.pa.us> X-Pg-Spam-Score: -4.7 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Bruce Momjian writes: > We did have someone confused by what we have now, as well as me, so I > think there is a reason to clean this up. It would be a > backward-compatible change, though. backward-INcompatible, I assume you meant. > To document this, I think we would need to add only one line: > trim([leading | trailing | both] [characters] from string) > new trim([leading | trailing | both] [from] string [, characters]) > Of course, that second line is non-standard --- do we have to mention > that? The second line is wrong no? We don't allow the LEADING etc keywords in the expr_list alternative. Anyway, I'm dubious that we really want to document a nonstandard syntax --- that would just be encouraging people to use it, to little benefit. Now that I've thought about this some more, I think that there was some previous discussion around this syntax production, and that the reason we left it like this is that we wanted to leave the door open for user-defined trim functions that might take extra arguments. That discussion probably predated 7.3 (when we added schemas) because the code's current habit of forcing a "pg_catalog" prefix would make it a little bit painful to add such functions. Still, you could do it with superuser privileges. Not sure how strong that argument is, but I think that's where we left it years ago. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers