~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/include/catalog/objectaccess.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * objectaccess.h
 
3
 *
 
4
 *              Object access hooks.
 
5
 *
 
6
 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
 
7
 * Portions Copyright (c) 1994, Regents of the University of California
 
8
 */
 
9
 
 
10
#ifndef OBJECTACCESS_H
 
11
#define OBJECTACCESS_H
 
12
 
 
13
/*
 
14
 * Object access hooks are intended to be called just before or just after
 
15
 * performing certain actions on a SQL object.  This is intended as
 
16
 * infrastructure for security or logging pluggins.
 
17
 *
 
18
 * OAT_POST_CREATE should be invoked just after the the object is created.
 
19
 * Typically, this is done after inserting the primary catalog records and
 
20
 * associated dependencies.
 
21
 *
 
22
 * Other types may be added in the future.
 
23
 */
 
24
typedef enum ObjectAccessType
 
25
{
 
26
        OAT_POST_CREATE,
 
27
} ObjectAccessType;
 
28
 
 
29
/*
 
30
 * Hook, and a macro to invoke it.
 
31
 */
 
32
 
 
33
typedef void (*object_access_hook_type) (ObjectAccessType access,
 
34
                                                                                                         Oid classId,
 
35
                                                                                                         Oid objectId,
 
36
                                                                                                         int subId);
 
37
 
 
38
extern PGDLLIMPORT object_access_hook_type object_access_hook;
 
39
 
 
40
#define InvokeObjectAccessHook(access,classId,objectId,subId)                   \
 
41
        do {                                                                                                                            \
 
42
                if (object_access_hook)                                                                                 \
 
43
                        (*object_access_hook)((access),(classId),(objectId),(subId)); \
 
44
        } while(0)
 
45
 
 
46
#endif   /* OBJECTACCESS_H */