From: | Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp> |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, PgHacker <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: ALTER command reworks |
Date: | 2013-01-09 11:46:37 |
Message-ID: | CADyhKSWVqaA6iF5wVuW5EzLaiYyCYEE2zO9guqNKy8FRdLx5Gw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2013/1/7 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
> Tom Lane escribió:
>> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> > On Mon, Jan 7, 2013 at 3:43 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>
>> >> If this is considered a problem, I think the way to fix it is to have a
>> >> getObjectDescriptionOids() variant that quotes the object name in the
>> >> output.
>>
>> > This sort of thing has been rejected repeatedly in the past on
>> > translation grounds:
>>
>> Yes. I'm surprised Alvaro isn't well aware of the rules against trying
>> to build error messages out of sentence fragments: see first item under
>> http://www.postgresql.org/docs/devel/static/nls-programmer.html#NLS-GUIDELINES
>
> Actually I'm fully aware of the limitations; I just had a brain fade. I
> knew there was something wrong with that usage of getObjectDescription,
> but managed to miss what it was exactly. Doh. Thankfully there are
> other hackers paying attention.
>
> BTW this patch was correct in this regard in a previous version -- there
> was one separate copy of the error message per object type. I think
> it's just a matter of returning to that older coding.
>
The attached patch is a rebased version towards the latest master
branch, and fix up the issue around error messages on name conflicts.
I could also find an abused of getObjectDescription() for error message
of namespace conflicts at AlterObjectNamespace_internal().
The newly added ereport_on_namespace_conflict() can handle the
both of cases, so I also replaced it.
As we have a discussion in another thread, we may add special case
handling for functions and collation on checks on namespace conflicts,
however, I didn't tough code path of them, right now.
Thanks,
--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>
Attachment | Content-Type | Size |
---|---|---|
pgsql-v9.3-alter-reworks.3-rename.v8.patch | application/octet-stream | 46.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2013-01-09 11:46:53 | Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4) |
Previous Message | Peter Eisentraut | 2013-01-09 11:28:32 | information schema parameter_default implementation |