Re: 9.5 BLOCKER: regrole and regnamespace and quotes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 9.5 BLOCKER: regrole and regnamespace and quotes
Date
Msg-id 29618.1451882238@sss.pgh.pa.us
Whole thread Raw
In response to Re: 9.5 BLOCKER: regrole and regnamespace and quotes  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: 9.5 BLOCKER: regrole and regnamespace and quotes  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
Jim Nasby <Jim.Nasby@bluetreble.com> writes:
> On 1/3/16 9:23 PM, Tom Lane wrote:
>> (Though at least in HEAD we ought to
>> fix them to take type text as input.  Using cstring for ordinary functions
>> is just sloppy.)

> BTW, *all* the reg*in() functions do that...

Yeah, I noticed that.  They're all broken.  There are no other built-in
functions that take cstring except for datatype input functions and
encoding conversion functions, which are required to by their respective
meta-APIs, and which are not meant to be invoked directly from SQL.
These functions had no business being the first to think that cstring is
a full fledged type; which it is not.  Notably, that means this doesn't
work:

regression=# select to_regrole('foo'::text);
ERROR:  function to_regrole(text) does not exist

and most other cases where you'd computed an input value rather than
merely typed in a literal would fail likewise.

It's not a release stopper, but I plan to fix it in HEAD whenever I have
an idle hour.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: 9.5 BLOCKER: regrole and regnamespace and quotes
Next
From: Michael Paquier
Date:
Subject: Re: Additional role attributes && superuser review