Re: [v9.2] DROP statement reworks
От | Kohei KaiGai |
---|---|
Тема | Re: [v9.2] DROP statement reworks |
Дата | |
Msg-id | CADyhKSUmH5F_yuUgtj5bEpcfJ8cx3LJGvco8Nkkfw_+eTRWPTw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [v9.2] DROP statement reworks (Robert Haas <robertmhaas@gmail.com>) |
Список | pgsql-hackers |
2011/10/12 Robert Haas <robertmhaas@gmail.com>: > On Wed, Oct 12, 2011 at 8:07 AM, Kohei KaiGai <kaigai@kaigai.gr.jp> wrote: >> I'm currently trying to revise my patches according to your suggestions, >> but I'm facing a trouble about error messages when user tries to drop >> a non-exists object. >> >> Because the ObjectProperty array has an entry for each catalogs, it is >> unavailable to hold the name of object type (such as "table" or "index") >> when multiple object types are associated with a particular system >> catalog, such as pg_class, pg_type or pg_proc. >> >> How should I implement the following block? >> >> if (!OidIsValid(address.objectId)) >> { >> ereport(NOTICE, >> (errmsg("%s \"%s\" does not exist, skipping", >> get_object_property_typetext(stmt->removeType), >> NameListToString(objname)))); >> continue; >> } >> >> One idea is to add a separated array to translate from OBJECT_* to >> its text representation. (Maybe, it can be used to translattions with >> opposite direction.) > > For reasons of translation, you can't do something like "%s \"%s\" > does not exist, skipping". Instead I think you need an array that > works something like dropmsgstringarray[], but based on the OBJECT_* > constants rather than the RELKIND_* constants. IOW, it maps the > object type to the full error message, not just the name of the object > type. > OK, I'll revise the code based on this idea. Thanks, -- KaiGai Kohei <kaigai@kaigai.gr.jp>
В списке pgsql-hackers по дате отправления: