From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: 9.5 BLOCKER: regrole and regnamespace and quotes |
Date: | 2016-01-04 04:26:35 |
Message-ID: | CAB7nPqQsNW4PrbsXCDOZ8HQNLeRCOc1x_k4LyVLnLorxNTv6QQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Jan 4, 2016 at 1:20 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> On 1/3/16 9:43 PM, Tom Lane wrote:
>>
>> Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> writes:
>>>
>>> On 1/3/16 9:23 PM, Tom Lane wrote:
>>> Another potential problem for regnamespace is that it doesn't allow an
>>> entry for the catalog. I'm not sure what the spec says about that, but
>>> every other function allows dbname.schema.blah (dbname == catalog).
>>
>>
>> Meh, these types conform to no spec, so we can make them do what we
>> like. I see about zero reason to allow a catalog name, it would mostly
>> just confuse people.
>
>
> Ok. Not like CREATE SCHEMA allows that anyway.
>
>>> I started working on a fix, but it's currently blowing up in bootstrap
>>> and I haven't been able to figure out why yet:
>>> running bootstrap script ... FATAL: improper qualified name (too many
>>> dotted names): oid_ops
>>
>>
>> Recommendation: don't muck with DeconstructQualifiedName. That is called
>> in too many places and we are *not* touching any such API twenty-four
>> hours before release wrap.
>
>
> Yeah, looks like that's what was blowing up.
>
>> There's no real advantage to that anyway, compared with just doing
>> stringToQualifiedNameList and then complaining if its list_length isn't 1.
>
>
> What I went with.
Thanks, this is more or less what I... just did..
+ result = get_namespace_oid(nsp_name, false);
This is incorrect, you should use strVal(linitial(names)) instead.
+ if (list_length(names) > 1)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("improper qualified name (too many dotted names): %s",
+ NameListToString(names))));
I would just mark that as "Invalid syntax".
A couple of tests in regproc.sql would be a good addition as well.
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Nasby | 2016-01-04 04:27:53 | Re: 9.5 BLOCKER: regrole and regnamespace and quotes |
Previous Message | Stephen Frost | 2016-01-04 04:25:11 | Re: Additional role attributes && superuser review |