Re: [BUGS] BUG #8335: trim() un-document behaviour - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUGS] BUG #8335: trim() un-document behaviour
Date
Msg-id 26073.1376341103@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #8335: trim() un-document behaviour  (Bruce Momjian <bruce@momjian.us>)
Responses Re: [BUGS] BUG #8335: trim() un-document behaviour  (Bruce Momjian <bruce@momjian.us>)
List pgsql-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



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve
Next
From: Bruce Momjian
Date:
Subject: Re: [BUGS] BUG #8335: trim() un-document behaviour