2008-05-17 03:28:26 +02:00
|
|
|
/*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/commands/comment.h
|
2008-05-17 03:28:26 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
1999-10-26 05:12:39 +02:00
|
|
|
*
|
|
|
|
* comment.h
|
2000-04-12 19:17:23 +02:00
|
|
|
*
|
1999-10-26 05:12:39 +02:00
|
|
|
* Prototypes for functions in commands/comment.c
|
|
|
|
*
|
2015-01-06 17:43:47 +01:00
|
|
|
* Copyright (c) 1999-2015, PostgreSQL Global Development Group
|
1999-10-26 05:12:39 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COMMENT_H
|
|
|
|
#define COMMENT_H
|
|
|
|
|
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: 20150218213255.GC6717@tamriel.snowman.net
Reviewed-By: Stephen Frost, Andres Freund
2015-03-03 18:10:50 +01:00
|
|
|
#include "catalog/objectaddress.h"
|
2002-04-09 22:35:55 +02:00
|
|
|
#include "nodes/parsenodes.h"
|
2000-06-15 02:52:26 +02:00
|
|
|
|
1999-10-26 05:12:39 +02:00
|
|
|
/*------------------------------------------------------------------
|
|
|
|
* Function Prototypes --
|
2000-04-12 19:17:23 +02:00
|
|
|
*
|
2003-03-10 23:28:22 +01:00
|
|
|
* The following prototypes define the public functions of the comment
|
2001-08-10 20:57:42 +02:00
|
|
|
* related routines. CommentObject() implements the SQL "COMMENT ON"
|
|
|
|
* command. DeleteComments() deletes all comments for an object.
|
|
|
|
* CreateComments creates (or deletes, if comment is NULL) a comment
|
2014-05-06 18:12:18 +02:00
|
|
|
* for a specific key. There are versions of these two methods for
|
2006-02-12 04:22:21 +01:00
|
|
|
* both normal and shared objects.
|
1999-10-26 05:12:39 +02:00
|
|
|
*------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
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: 20150218213255.GC6717@tamriel.snowman.net
Reviewed-By: Stephen Frost, Andres Freund
2015-03-03 18:10:50 +01:00
|
|
|
extern ObjectAddress CommentObject(CommentStmt *stmt);
|
1999-10-26 05:12:39 +02:00
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
extern void DeleteComments(Oid oid, Oid classoid, int32 subid);
|
2001-08-10 20:57:42 +02:00
|
|
|
|
|
|
|
extern void CreateComments(Oid oid, Oid classoid, int32 subid, char *comment);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2006-02-12 04:22:21 +01:00
|
|
|
extern void DeleteSharedComments(Oid oid, Oid classoid);
|
|
|
|
|
|
|
|
extern void CreateSharedComments(Oid oid, Oid classoid, char *comment);
|
|
|
|
|
2009-10-12 21:49:24 +02:00
|
|
|
extern char *GetComment(Oid oid, Oid classoid, int32 subid);
|
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* COMMENT_H */
|