head 1.19; access; symbols Version_2_1:1.14 Version_2:1.10 C_Demo_1:1.5; locks; strict; comment @ * @; 1.19 date 92.03.11.02.23.49; author mer; state Exp; branches; next 1.18; 1.18 date 92.03.02.21.31.26; author mer; state Exp; branches; next 1.17; 1.17 date 91.12.04.01.58.30; author glass; state Exp; branches; next 1.16; 1.16 date 91.09.06.12.26.46; author hong; state Exp; branches; next 1.15; 1.15 date 91.04.28.09.15.15; author cimarron; state Exp; branches; next 1.14; 1.14 date 91.02.19.13.56.30; author mao; state Exp; branches; next 1.13; 1.13 date 90.09.18.21.51.34; author hong; state Exp; branches; next 1.12; 1.12 date 90.08.17.08.54.15; author cimarron; state Exp; branches; next 1.11; 1.11 date 90.08.08.08.24.17; author cimarron; state Exp; branches; next 1.10; 1.10 date 90.04.02.11.20.08; author hong; state Version_2; branches; next 1.9; 1.9 date 90.03.01.15.40.10; author cimarron; state Exp; branches; next 1.8; 1.8 date 89.09.25.11.24.51; author cimarron; state Exp; branches; next 1.7; 1.7 date 89.09.21.19.13.09; author hirohama; state Exp; branches; next 1.6; 1.6 date 89.09.18.08.01.54; author cimarron; state Exp; branches; next 1.5; 1.5 date 89.09.05.17.11.10; author mao; state C_Demo_1; branches; next 1.4; 1.4 date 89.04.12.19.55.56; author dillon; state Exp; branches; next 1.3; 1.3 date 89.03.01.17.08.36; author goh; state Stab; branches; next 1.2; 1.2 date 89.01.31.16.33.01; author dillon; state Exp; branches; next 1.1; 1.1 date 89.01.17.05.54.45; author cimarron; state Exp; branches; next ; desc @@ 1.19 log @define an accessor macro for lock info field of reldesc @ text @/* * rel.h -- * POSTGRES relation descriptor definitions. */ #ifndef RelIncluded /* Include this file only once */ #define RelIncluded 1 /* * Identification: */ #define REL_H "$Header: /u/mer/pg/src/lib/H/utils/RCS/rel.h,v 1.18 1992/03/02 21:31:26 mer Exp mer $" #include "tmp/postgres.h" #include "storage/fd.h" #include "access/istrat.h" #include "access/tupdesc.h" #include "catalog/pg_am.h" #include "catalog/pg_operator.h" #include "catalog/pg_relation.h" typedef struct RelationData { File rd_fd; /* open file descriptor */ int rd_nblocks; /* number of blocks in rel */ uint16 rd_refcnt; /* reference count */ bool rd_ismem; /* rel is in-memory only */ bool rd_isnailed; /* rel is nailed in cache */ AccessMethodTupleForm rd_am; /* AM tuple */ RelationTupleForm rd_rel; /* RELATION tuple */ ObjectId rd_id; /* relations's object id */ Pointer lockInfo; /* ptr. to misc. info. */ TupleDescriptorData rd_att; /* tuple desciptor */ /* VARIABLE LENGTH ARRAY AT END OF STRUCT */ /* IndexStrategy rd_is; */ /* index strategy */ } RelationData; typedef RelationData *Relation; /* ---------------- * RelationPtr is used in the executor to support index scans * where we have to keep track of several index relations in an * array. -cim 9/10/89 * ---------------- */ typedef Relation *RelationPtr; #define InvalidRelation ((Relation)NULL) typedef char ArchiveMode; /* * RelationIsValid -- * True iff relation descriptor is valid. */ #define RelationIsValid(relation) PointerIsValid(relation) /* * RelationGetSystemPort -- * Returns system port of a relation. * * Note: * Assumes relation descriptor is valid. */ #define RelationGetSystemPort(relation) ((relation)->rd_fd) /* * RelationGetLockInfo -- * Returns the lock information structure in the reldesc * */ #define RelationGetLockInfo(relation) ((relation)->lockInfo) /* * RelationHasReferenceCountZero -- * True iff relation reference count is zero. * * Note: * Assumes relation descriptor is valid. */ #define RelationHasReferenceCountZero(relation) \ ((bool)((relation)->rd_refcnt == 0)) /* * RelationSetReferenceCount -- * Sets relation reference count. */ #define RelationSetReferenceCount(relation,count) ((relation)->rd_refcnt = count) /* * RelationIncrementReferenceCount -- * Increments relation reference count. */ #define RelationIncrementReferenceCount(relation) ((relation)->rd_refcnt += 1); /* * RelationDecrementReferenceCount -- * Decrements relation reference count. */ #define RelationDecrementReferenceCount(relation) ((relation)->rd_refcnt -= 1) /* * RelationGetAccessMethodTupleForm -- * Returns access method attribute values for a relation. * * Note: * Assumes relation descriptor is valid. */ #define RelationGetAccessMethodTupleForm(relation) ((relation)->rd_am) /* * RelationGetRelationTupleForm -- * Returns relation attribute values for a relation. * * Note: * Assumes relation descriptor is valid. */ #define RelationGetRelationTupleForm(relation) ((relation)->rd_rel) /* * RelationGetTupleDescriptor -- * Returns tuple descriptor for a relation. * * Note: * Assumes relation descriptor is valid. */ #define RelationGetTupleDescriptor(relation) (&(relation)->rd_att) /* * RelationGetRelationId -- * * returns the object id of the relation * */ #define RelationGetRelationId(relation) ((relation)->rd_id) /* * RelationGetFile -- * * Returns the open File decscriptor */ #define RelationGetFile(relation) ((relation)->rd_fd) /* * RelationGetRelationName -- * * Returns a Relation Name */ #define RelationGetRelationName(relation) (&(relation)->rd_rel->relname) /* * RelationGetRelationName -- * * Returns a the number of attributes. */ #define RelationGetNumberOfAttributes(relation) ((relation)->rd_rel->relnatts) /* * RelationGetIndexStrategy -- * Returns index strategy for a relation. * * Note: * Assumes relation descriptor is valid. * Assumes relation descriptor is for an index relation. */ extern IndexStrategy RelationGetIndexStrategy ARGS(( Relation relation )); /* * RelationSetIndexSupport -- * Sets index strategy and support info for a relation. * * Note: * Assumes relation descriptor is a valid pointer to sufficient space. * Assumes index strategy is valid. Assumes support is valid if non- * NULL. */ extern void RelationSetIndexSupport ARGS(( Relation relation, IndexStrategy strategy, RegProcedure *support )); #endif /* !defined(RelIncluded) */ @ 1.18 log @make many silly one line functions macros (see rel.c) @ text @d12 1 a12 1 #define REL_H "$Header: /users/mer/pg/src/lib/H/utils/RCS/rel.h,v 1.17 1991/12/04 01:58:30 glass Exp mer $" d67 7 @ 1.17 log @unterminated comment @ text @d12 1 a12 1 #define REL_H "$Header: lib/H/utils/RCS/rel.h,v 1.16 91/09/06 12:26:46 hong Exp Locker: glass $" d66 1 a66 5 extern File /* XXX SystemPort of "os.h" */ RelationGetSystemPort ARGS(( Relation relation )); d75 2 a76 5 extern bool RelationHasReferenceCountZero ARGS(( Relation relation )); d82 1 a82 6 extern void RelationSetReferenceCount ARGS(( Relation relation, Count count )); d88 1 a88 5 extern void RelationIncrementReferenceCount ARGS(( Relation relation )); d94 1 a94 5 extern void RelationDecrementReferenceCount ARGS(( Relation relation )); d103 1 a103 5 extern AccessMethodTupleForm RelationGetAccessMethodTupleForm ARGS(( Relation relation )); d112 1 a112 5 extern RelationTupleForm RelationGetRelationTupleForm ARGS(( Relation relation )); d121 31 a151 5 extern TupleDescriptor RelationGetTupleDescriptor ARGS(( Relation relation )); a181 44 )); /* * RelationGetRelationId -- * * returns the object id of the relation * */ extern ObjectId RelationGetRelationId ARGS(( Relation relation )); /* * RelationGetFile -- * * Returns the open File decscriptor */ extern File RelationGetFile ARGS(( Relation relation )); /* * RelationGetRelationName -- * * Returns a Relation Name */ extern Name RelationGetRelationName ARGS(( Relation relation )); extern AttributeNumber RelationGetNumberOfAttributes ARGS(( Relation relation @ 1.16 log @added a new field to relation descriptor @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.15 91/04/28 09:15:15 cimarron Exp Locker: hong $" d36 1 a36 1 /* IndexStrategy rd_is; /* index strategy */ @ 1.15 log @Converted IsValid code into macros and added an improved NodeIsType scheme @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.14 91/02/19 13:56:30 mao Exp Locker: cimarron $" d29 1 @ 1.14 log @fix rtree interface @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.13 90/09/18 21:51:34 hong Exp Locker: mao $" d56 1 a56 5 extern bool RelationIsValid ARGS (( Relation relation )); @ 1.13 log @added a field to Relation structure, to avoid unnecessary seek's @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.12 90/08/17 08:54:15 cimarron Exp Locker: cimarron $" d173 2 a174 2 * RelationSetIndexStrategy -- * Sets index strategy for a relation. d178 2 a179 1 * Assumes index strategy is valid. d183 1 a183 1 RelationSetIndexStrategy ARGS(( d185 2 a186 1 IndexStrategy strategy @ 1.12 log @added pathnames to #include statements @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.11 90/08/08 08:24:17 cimarron Exp Locker: cimarron $" d26 1 @ 1.11 log @reorganized some header files @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.10 90/04/02 11:20:08 hong Exp Locker: hong $" d14 1 a14 1 #include "postgres.h" d16 3 a18 3 #include "fd.h" #include "istrat.h" #include "tupdesc.h" @ 1.10 log @minor change for striping @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.8 89/09/25 11:24:51 cimarron Exp $" d14 1 a14 3 #ifndef C_H #include "c.h" #endif d16 7 a22 15 #ifndef CAT_H # include "cat.h" #endif #ifndef FD_H # include "fd.h" #endif #ifndef ISTRAT_H # include "istrat.h" #endif #ifndef OID_H # include "oid.h" #endif #ifndef TUPDESC_H # include "tupdesc.h" #endif @ 1.9 log @general changes to add parallelism support, in-memory relations, and various code cleanups. @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.8 89/09/25 11:24:51 cimarron Exp Locker: hong $" d79 1 a79 1 int /* XXX SystemPort of "os.h" */ @ 1.8 log @moved dynamic symbol stuff to syms.h @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.7 89/09/21 19:13:09 hirohama Exp $" d37 1 @ 1.7 log @added ...SYMBOLS declarations miscellaneous cleanup @ text @d12 1 a12 1 #define REL_H "$Header: RCS/rel.h,v 1.6 89/09/18 08:01:54 cimarron Exp Locker: hirohama $" a237 18 #define REL_SYMBOLS \ SymbolDecl(RelationIsValid, "_RelationIsValid"), \ SymbolDecl(RelationGetSystemPort, "_RelationGetSystemPort"), \ SymbolDecl(RelationGetAccessMethodTupleForm, "_RelationGetAccessMethodTupleForm"), \ SymbolDecl(RelationGetRelationTupleForm, "_RelationGetRelationTupleForm"), \ SymbolDecl(RelationGetTupleDescriptor, "_RelationGetTupleDescriptor"), \ SymbolDecl(RelationGetIndexStrategy, "_RelationGetIndexStrategy"), \ SymbolDecl(RelationGetRelationId, "_RelationGetRelationId"), \ SymbolDecl(RelationGetFile, "_RelationGetFile"), \ SymbolDecl(RelationGetRelationName, "_RelationGetRelationName"), \ SymbolDecl(RelationGetNumberOfAttributes, "_RelationGetNumberOfAttributes") /* * SymbolDecl(RelationHasReferenceCountZero, "_RelationHasReferenceCountZero") * SymbolDecl(RelationIncrementReferenceCount, "_RelationIncrementReferenceCount") * SymbolDecl(RelationDecrementReferenceCount, "_RelationDecrementReferenceCount") * SymbolDecl(RelationSetIndexStrategy, "_RelationSetIndexStrategy") */ @ 1.6 log @added code to support index scans in the executor. @ text @a3 3 * * Identification: * $Header: RCS/rel.h,v 1.4 89/04/12 19:55:56 dillon Exp $ d6 1 a6 1 #ifndef RelIncluded /* Include this file only once. */ d9 5 d18 15 a32 1 #include "os.h" a33 6 #include "oid.h" #include "cat.h" #include "istrat.h" #include "tupdesc.h" #include "fd.h" d78 1 a78 1 SystemPort d237 20 a256 1 )); @ 1.5 log @Working version of C-only demo @ text @d6 1 a6 1 * $Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/rel.h,v 1.4 89/04/12 19:55:56 dillon Exp $ d37 8 @ 1.4 log @c.h @ text @d6 1 a6 1 * $Header: /usr6/postgres/dillon/ptree/src/lib/H/RCS/rel.h,v 1.3 89/03/01 17:08:36 goh Stab $ @ 1.3 log @added RelationGetNumberOfAttributes @ text @d6 1 a6 1 * $Header: rel.h,v 1.2 89/01/31 16:33:01 goh Locked $ d12 1 d14 1 @ 1.2 log @txfer from old tree @ text @d6 1 a6 1 * $Header: rel.h,v 1.8 88/08/26 11:59:50 dillon Locked $ d213 5 @ 1.1 log @Initial revision @ text @a0 27 ; /* ; * ; * POSTGRES Data Base Management System ; * ; * Copyright (c) 1988 Regents of the University of California ; * ; * Permission to use, copy, modify, and distribute this software and its ; * documentation for educational, research, and non-profit purposes and ; * without fee is hereby granted, provided that the above copyright ; * notice appear in all copies and that both that copyright notice and ; * this permission notice appear in supporting documentation, and that ; * the name of the University of California not be used in advertising ; * or publicity pertaining to distribution of the software without ; * specific, written prior permission. Permission to incorporate this ; * software into commercial products can be obtained from the Campus ; * Software Office, 295 Evans Hall, University of California, Berkeley, ; * Ca., 94720 provided only that the the requestor give the University ; * of California a free licence to any derived software for educational ; * and research purposes. The University of California makes no ; * representations about the suitability of this software for any ; * purpose. It is provided "as is" without express or implied warranty. ; * ; */ d6 1 a6 1 * $Header: rel.h,v 1.1 88/11/11 16:37:22 postgres Exp $ @