Re: ALTER OBJECT any_name SET SCHEMA name
Dimitri Fontaine <dimitri@2ndquadrant.fr>
From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Dimitri Fontaine <dimitri@2ndquadrant.fr>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-05T09:49:34Z
Lists: pgsql-hackers
Attachments
- alter_extension.v3.patch (text/x-patch) patch v3
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Hmm, seeing the amount of new includes in extension.c, I wonder if it'd
> be better to move AlterExtensionNamespace to alter.c.
It was mainly missing includes cleanup. The guts of the function is now
so short I can inline it in this mail:
targetObjects = listDependentObjects(object);
for (i = 0; i < targetObjects->numrefs; i++)
{
ObjectAddress *thisobj = targetObjects->refs + i;
elog(DEBUG1, "SET SCHEMA on %u: %s",
thisobj->objectId, getObjectDescription(thisobj));
AlterObjectNamespace_internal(thisobj, nspOid);
}
So really, I don't think moving it to alter.c would do any better,
considering that you would then have this file include dependency
related function.
Please find attached v3 patch with #include cleanup.
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support