From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: marisradu@gmail.com <marisradu@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13652: Function names as a table prefiex by underscore, confused with array
Date: Tue, 29 Sep 2015 12:07:57 -0400
Message-ID: <16142.1443542877@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYrBOE3=4mZs672p7Mb9XWp3oFJbT+eEMa9fsDDuZ6U1w@mail.gmail.com>
References: <20150929131942.1414.58542@wrigleys.postgresql.org>
<CAKFQuwYrBOE3=4mZs672p7Mb9XWp3oFJbT+eEMa9fsDDuZ6U1w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, September 29, 2015, <marisradu@gmail.com
> <javascript:_e(%7B%7D,'cvml','marisradu@gmail.com');>> wrote:
>> Select by _c(text) returns unexpected error:
>> # select _c('text');
>> ERROR: malformed array literal: "text"
> It's unfortunate that such an implementation detail is exposed in this
> situation but the name is still valid if you place it in double-quotes (I
> think...) so making it fail at any other time seems unnecessarily strict.
Actually the way to get this to work as desired is to cast the argument
to the right type:
select _c('text'::text);
Then you get a match at step 2 in the resolution sequence ("exact match
of argument types"), so the user-defined function wins out over the cast
interpretation.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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, david.g.johnston@gmail.com, marisradu@gmail.com
Subject: Re: BUG #13652: Function names as a table prefiex by underscore, confused with array
In-Reply-To: <16142.1443542877@sss.pgh.pa.us>
References: <20150929131942.1414.58542@wrigleys.postgresql.org> <CAKFQuwYrBOE3=4mZs672p7Mb9XWp3oFJbT+eEMa9fsDDuZ6U1w@mail.gmail.com> <16142.1443542877@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