On Wed, Oct 5, 2011 at 12:16 PM, Kohei KaiGai <kaigai@kaigai.gr.jp> wrote:
> * The logic of check_object_validation() got included within
> get_relation_address(), and rewritten more smartly, as:
>
> + relkind = RelationGetForm(relation)->relkind;
> + if ((objtype == OBJECT_INDEX && relkind != RELKIND_INDEX) ||
> + (objtype == OBJECT_SEQUENCE && relkind != RELKIND_SEQUENCE) ||
> + (objtype == OBJECT_TABLE && relkind != RELKIND_RELATION) ||
> + (objtype == OBJECT_VIEW && relkind != RELKIND_VIEW) ||
> + (objtype == OBJECT_FOREIGN_TABLE && relkind != RELKIND_FOREIGN_TABLE))
> + ereport(ERROR,
> + (errcode(ERRCODE_WRONG_OBJECT_TYPE),
> + errmsg("\"%s\" is not a %s",
> + NameListToString(objname),
> + get_object_property_typetext(objtype))));
> +
That's no good. We've discussed it before. It breaks translatability.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company