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

From Michael Paquier
Subject Re: 9.5 BLOCKER: regrole and regnamespace and quotes
Date
Msg-id CAB7nPqTfMp7p9Pns4T-nLutL0GMULQ4VjS0LgLzY+ZAKzY2YXQ@mail.gmail.com
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>)
Re: 9.5 BLOCKER: regrole and regnamespace and quotes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Jan 4, 2016 at 1:46 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
> On 1/3/16 10:26 PM, Michael Paquier wrote:
>>
>> Thanks, this is more or less what I... just did..
>
>
> Sorry, didn't realize you were on it.

No worries. I know it's already late where you are.

>> A couple of tests in regproc.sql would be a good addition as well.
>
> Added. I'm gonna call this good for now. Note this is just against HEAD
> since I don't have 9.5 setup yet. Presumably the patch should still apply...

+    if (list_length(names) > 1)
+        ereport(ERROR,
+                (errcode(ERRCODE_SYNTAX_ERROR),
+            errmsg("improper qualified name (too many dotted names): %s",
+                   NameListToString(names))));
I would use != 1 instead here, even if the function is strict.

You forgot to update the regression test output. And actually on
second thoughts the tests you added do not actually bring much value
because what is tested is just the behavior of
stringToQualifiedNameList, and the other reg* are not tested that as
well. However I think that we had better test the failures of
regnamespace and regrole when more than 1 element is parsed as this is
a new particular code path. Attached is an updated patch which passes
check-world in my environment.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: 9.5 BLOCKER: regrole and regnamespace and quotes
Next
From: Jim Nasby
Date:
Subject: Re: 9.5 BLOCKER: regrole and regnamespace and quotes