pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: amutu@amutu.com
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [BUGS] BUG #8335: trim() un-document behaviour
Date: Mon, 12 Aug 2013 16:58:23 -0400
Message-ID: <26073.1376341103@sss.pgh.pa.us> (raw)
In-Reply-To: <20130812202910.GE12510@momjian.us>
References: <E1V2XgU-0003tb-Ii@wrigleys.postgresql.org>
	<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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Bruce Momjian <bruce@momjian.us> 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



view thread (16+ messages)  latest in thread

Message-ID: <26073.1376341103@sss.pgh.pa.us>
Permalink:  ../26073.1376341103@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26073.1376341103@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, amutu@amutu.com, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #8335: trim() un-document behaviour
  In-Reply-To: <26073.1376341103@sss.pgh.pa.us>
  References: <E1V2XgU-0003tb-Ii@wrigleys.postgresql.org> <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> <26073.1376341103@sss.pgh.pa.us>

* 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