summaryrefslogtreecommitdiff
path: root/src/backend/commands/seclabel.c
diff options
context:
space:
mode:
authorAlvaro Herrera2015-03-03 17:10:50 +0000
committerAlvaro Herrera2015-03-03 17:10:50 +0000
commita2e35b53c39b2a27d3e332dc7c506539c306fd44 (patch)
tree1f4cd33208d33f4a8b3159b0d3757109c67d4b14 /src/backend/commands/seclabel.c
parent6f9d79904748c26a58991942dc6719db558f77b0 (diff)
Change many routines to return ObjectAddress rather than OID
The changed routines are mostly those that can be directly called by ProcessUtilitySlow; the intention is to make the affected object information more precise, in support for future event trigger changes. Originally it was envisioned that the OID of the affected object would be enough, and in most cases that is correct, but upon actually implementing the event trigger changes it turned out that ObjectAddress is more widely useful. Additionally, some command execution routines grew an output argument that's an object address which provides further info about the executed command. To wit: * for ALTER DOMAIN / ADD CONSTRAINT, it corresponds to the address of the new constraint * for ALTER OBJECT / SET SCHEMA, it corresponds to the address of the schema that originally contained the object. * for ALTER EXTENSION {ADD, DROP} OBJECT, it corresponds to the address of the object added to or dropped from the extension. There's no user-visible change in this commit, and no functional change either. Discussion: [email protected] Reviewed-By: Stephen Frost, Andres Freund
Diffstat (limited to 'src/backend/commands/seclabel.c')
-rw-r--r--src/backend/commands/seclabel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c
index 6e15bc8de7b..1ef98ce3532 100644
--- a/src/backend/commands/seclabel.c
+++ b/src/backend/commands/seclabel.c
@@ -37,8 +37,10 @@ static List *label_provider_list = NIL;
* ExecSecLabelStmt --
*
* Apply a security label to a database object.
+ *
+ * Returns the ObjectAddress of the object to which the policy was applied.
*/
-Oid
+ObjectAddress
ExecSecLabelStmt(SecLabelStmt *stmt)
{
LabelProvider *provider = NULL;
@@ -133,7 +135,7 @@ ExecSecLabelStmt(SecLabelStmt *stmt)
if (relation != NULL)
relation_close(relation, NoLock);
- return address.objectId;
+ return address;
}
/*