mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Make ALTER .. SET SCHEMA do nothing, instead of throwing an ERROR.
This was already true for CREATE EXTENSION, but historically has not been true for other object types. Therefore, this is a backward incompatibility. Per discussion on pgsql-hackers, everyone seems to agree that the new behavior is better. Marti Raudsepp, reviewed by Haribabu Kommi and myself
This commit is contained in:
@ -592,8 +592,18 @@ AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid)
|
||||
Assert(!isnull);
|
||||
oldNspOid = DatumGetObjectId(namespace);
|
||||
|
||||
/*
|
||||
* If the object is already in the correct namespace, we don't need
|
||||
* to do anything except fire the object access hook.
|
||||
*/
|
||||
if (oldNspOid == nspOid)
|
||||
{
|
||||
InvokeObjectPostAlterHook(classId, objid, 0);
|
||||
return oldNspOid;
|
||||
}
|
||||
|
||||
/* Check basic namespace related issues */
|
||||
CheckSetNamespace(oldNspOid, nspOid, classId, objid);
|
||||
CheckSetNamespace(oldNspOid, nspOid);
|
||||
|
||||
/* Permission checks ... superusers can always do it */
|
||||
if (!superuser())
|
||||
|
Reference in New Issue
Block a user