Commit c10575ff authored by Robert Haas's avatar Robert Haas

Rewrite comment code for better modularity, and add necessary locking.

Review by Alvaro Herrera, KaiGai Kohei, and Tom Lane.
parent 73b3bd55
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for backend/catalog # Makefile for backend/catalog
# #
# $PostgreSQL: pgsql/src/backend/catalog/Makefile,v 1.78 2010/05/13 11:49:48 petere Exp $ # $PostgreSQL: pgsql/src/backend/catalog/Makefile,v 1.79 2010/08/27 11:47:41 rhaas Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -11,9 +11,10 @@ top_builddir = ../../.. ...@@ -11,9 +11,10 @@ top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
OBJS = catalog.o dependency.o heap.o index.o indexing.o namespace.o aclchk.o \ OBJS = catalog.o dependency.o heap.o index.o indexing.o namespace.o aclchk.o \
pg_aggregate.o pg_constraint.o pg_conversion.o pg_depend.o pg_enum.o \ objectaddress.o pg_aggregate.o pg_constraint.o pg_conversion.o \
pg_inherits.o pg_largeobject.o pg_namespace.o pg_operator.o pg_proc.o \ pg_depend.o pg_enum.o pg_inherits.o pg_largeobject.o pg_namespace.o \
pg_db_role_setting.o pg_shdepend.o pg_type.o storage.o toasting.o pg_operator.o pg_proc.o pg_db_role_setting.o pg_shdepend.o pg_type.o \
storage.o toasting.o
BKIFILES = postgres.bki postgres.description postgres.shdescription BKIFILES = postgres.bki postgres.description postgres.shdescription
......
This diff is collapsed.
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.45 2010/04/05 01:09:53 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.46 2010/08/27 11:47:41 rhaas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define DEPENDENCY_H #define DEPENDENCY_H
#include "nodes/parsenodes.h" /* for DropBehavior */ #include "nodes/parsenodes.h" /* for DropBehavior */
#include "catalog/objectaddress.h"
/* /*
...@@ -100,17 +101,6 @@ typedef enum SharedDependencyType ...@@ -100,17 +101,6 @@ typedef enum SharedDependencyType
SHARED_DEPENDENCY_INVALID = 0 SHARED_DEPENDENCY_INVALID = 0
} SharedDependencyType; } SharedDependencyType;
/*
* The two objects related by a dependency are identified by ObjectAddresses.
*/
typedef struct ObjectAddress
{
Oid classId; /* Class Id from pg_class */
Oid objectId; /* OID of the object */
int32 objectSubId; /* Subitem within object (eg column), or 0 */
} ObjectAddress;
/* expansible list of ObjectAddresses (private in dependency.c) */ /* expansible list of ObjectAddresses (private in dependency.c) */
typedef struct ObjectAddresses ObjectAddresses; typedef struct ObjectAddresses ObjectAddresses;
......
/*-------------------------------------------------------------------------
*
* objectaddress.h
* functions for working with object addresses
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/objectaddress.h,v 1.1 2010/08/27 11:47:41 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef OBJECTADDRESS_H
#define OBJECTADDRESS_H
#include "nodes/parsenodes.h"
#include "storage/lock.h"
#include "utils/rel.h"
/*
* An ObjectAddress represents a database object of any type.
*/
typedef struct ObjectAddress
{
Oid classId; /* Class Id from pg_class */
Oid objectId; /* OID of the object */
int32 objectSubId; /* Subitem within object (eg column), or 0 */
} ObjectAddress;
ObjectAddress get_object_address(ObjectType objtype, List *objname,
List *objargs, Relation *relp, LOCKMODE lockmode);
#endif /* PARSE_OBJECT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment