diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-01-15 13:23:43 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-01-15 13:23:43 -0300 |
commit | 7ac5760fa283bc090c25e4ea495a0d2bb41db7b5 (patch) | |
tree | 023eec06b6465fd108a7dbfca628ab7de872c995 /src/include/commands/defrem.h | |
parent | ffda05977a93f9b3f8a6b05657ba2f16decb6b23 (diff) | |
download | postgresql-7ac5760fa283bc090c25e4ea495a0d2bb41db7b5.tar.gz postgresql-7ac5760fa283bc090c25e4ea495a0d2bb41db7b5.zip |
Rework order of checks in ALTER / SET SCHEMA
When attempting to move an object into the schema in which it already
was, for most objects classes we were correctly complaining about
exactly that ("object is already in schema"); but for some other object
classes, such as functions, we were instead complaining of a name
collision ("object already exists in schema"). The latter is wrong and
misleading, per complaint from Robert Haas in
CA+TgmoZ0+gNf7RDKRc3u5rHXffP=QjqPZKGxb4BsPz65k7qnHQ@mail.gmail.com
To fix, refactor the way these checks are done. As a bonus, the
resulting code is smaller and can also share some code with Rename
cases.
While at it, remove use of getObjectDescriptionOids() in error messages.
These are normally disallowed because of translatability considerations,
but this one had slipped through since 9.1. (Not sure that this is
worth backpatching, though, as it would create some untranslated
messages in back branches.)
This is loosely based on a patch by KaiGai Kohei, heavily reworked by
me.
Diffstat (limited to 'src/include/commands/defrem.h')
-rw-r--r-- | src/include/commands/defrem.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index c327136a36d..7de6d5de979 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -50,9 +50,8 @@ extern Oid RenameFunction(List *name, List *argtypes, const char *newname); extern Oid AlterFunction(AlterFunctionStmt *stmt); extern Oid CreateCast(CreateCastStmt *stmt); extern void DropCastById(Oid castOid); -extern Oid AlterFunctionNamespace(List *name, List *argtypes, bool isagg, - const char *newschema); -extern Oid AlterFunctionNamespace_oid(Oid procOid, Oid nspOid); +extern void IsThereFunctionInNamespace(const char *proname, int pronargs, + oidvector proargtypes, Oid nspOid); extern void ExecuteDoStmt(DoStmt *stmt); extern Oid get_cast_oid(Oid sourcetypeid, Oid targettypeid, bool missing_ok); |