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 14:18:01 -0400
Message-ID: <22386.1376331481@sss.pgh.pa.us> (raw)
In-Reply-To: <21732.1376330108@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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
I wrote:
> This will break even more stuff than the last patch, ie, every single
> stored rule or view that contains a TRIM function. You can *not*
> eliminate, or mess with, the expr_list production, because that's what
> dumping of these function calls relies on.
No, wait, I take that back. I was thinking that the function call would
dump out as trim(x, y) but actually none of the underlying functions
are named just "trim"; they're btrim, ltrim, or rtrim. So actually the
dump/reload scenario does not have anything to do with the trim_list
production --- the underlying functions just parse normally in any case.
The question remains why it's a good idea to mess with a syntax behavior
that's been like that for a dozen years or more. I don't see any upside
to doing that. As an example of a downside, right now if you try to
pass extra arguments to TRIM() you'll get
regression=# select trim(1,2,3);
ERROR: function pg_catalog.btrim(integer, integer, integer) does not exist
LINE 1: select trim(1,2,3);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
You might wonder why the message mentions "btrim" not "trim", but at least
the complaint is reasonably on-topic. After this patch, you'd just get
a "syntax error" message, which doesn't seem helpful at all.
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
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: <22386.1376331481@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>
* 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