]> granicus.if.org Git - postgresql/commitdiff
Use -ieee alpha flag for gcc and egcs only.
authorBruce Momjian <bruce@momjian.us>
Tue, 20 Jul 1999 16:48:58 +0000 (16:48 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 20 Jul 1999 16:48:58 +0000 (16:48 +0000)
src/backend/catalog/index.c
src/backend/catalog/indexing.c
src/backend/utils/adt/Makefile
src/backend/utils/cache/syscache.c
src/include/catalog/indexing.h
src/include/utils/syscache.h

index 607f48fd4b613869749b9b9a121ef8ad7a049c0b..53103e2f66363b6851626b1dd9a91986c6daee87 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.85 1999/07/17 20:16:49 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.86 1999/07/20 16:48:54 momjian Exp $
  *
  *
  * INTERFACE ROUTINES
 
 /* non-export function prototypes */
 static Oid GetHeapRelationOid(char *heapRelationName, char *indexRelationName,
-                                  bool istemp);
+               bool istemp);
 static TupleDesc BuildFuncTupleDesc(FuncIndexInfo *funcInfo);
 static TupleDesc ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
-                                                List *attributeList,
-                                                int numatts, AttrNumber *attNums);
+               List *attributeList, int numatts, AttrNumber *attNums);
 
 static void ConstructIndexReldesc(Relation indexRelation, Oid amoid);
 static Oid     UpdateRelationRelation(Relation indexRelation, char *temp_relname);
 static void InitializeAttributeOids(Relation indexRelation,
-                                               int numatts,
-                                               Oid indexoid);
-static void
-                       AppendAttributeTuples(Relation indexRelation, int numatts);
+               int numatts, Oid indexoid);
+static void AppendAttributeTuples(Relation indexRelation, int numatts);
 static void UpdateIndexRelation(Oid indexoid, Oid heapoid,
-                                       FuncIndexInfo *funcInfo, int natts,
-                                       AttrNumber *attNums, Oid *classOids, Node *predicate,
-                  List *attributeList, bool islossy, bool unique, bool primary);
+               FuncIndexInfo *funcInfo, int natts,
+               AttrNumber *attNums, Oid *classOids, Node *predicate,
+               List *attributeList, bool islossy, bool unique, bool primary);
 static void DefaultBuild(Relation heapRelation, Relation indexRelation,
-                        int numberOfAttributes, AttrNumber *attributeNumber,
-                        IndexStrategy indexStrategy, uint16 parameterCount,
+               int numberOfAttributes, AttrNumber *attributeNumber,
+               IndexStrategy indexStrategy, uint16 parameterCount,
                Datum *parameter, FuncIndexInfoPtr funcInfo, PredInfo *predInfo);
 
 /* ----------------------------------------------------------------
index 92a3385f4e982c97ddd16e82ecbbb8cb2c636eab..f29b317f9e7df51e10359a5ddc26fccb735c1035 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.40 1999/07/17 20:16:49 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.41 1999/07/20 16:48:54 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 /*
  * Names of indices on the following system catalogs:
- *
- *             pg_attribute
- *             pg_proc
- *             pg_type
- *             pg_naming
- *             pg_class
- *             pg_attrdef
- *             pg_relcheck
- *             pg_trigger
  */
 
+char      *Name_pg_amop_indices[Num_pg_amop_indices] = {AccessMethodOpidIndex,
+                       AccessMethodStrategyIndex};
 char      *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndex,
-       AttributeNumIndex,
-AttributeRelidIndex};
+                       AttributeNumIndex, AttributeRelidIndex};
+char      *Name_pg_index_indices[Num_pg_index_indices] = {IndexRelidIndex};
 char      *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndex,
-       ProcedureOidIndex,
-ProcedureSrcIndex};
+                       ProcedureOidIndex, ProcedureSrcIndex};
 char      *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndex,
-TypeOidIndex};
+                       TypeOidIndex};
 char      *Name_pg_class_indices[Num_pg_class_indices] = {ClassNameIndex,
-ClassOidIndex};
+                       ClassOidIndex};
 char      *Name_pg_attrdef_indices[Num_pg_attrdef_indices] = {AttrDefaultIndex};
 
 char      *Name_pg_relcheck_indices[Num_pg_relcheck_indices] = {RelCheckIndex};
 
 char      *Name_pg_trigger_indices[Num_pg_trigger_indices] = {TriggerRelidIndex};
+char      *Name_pg_description_indices[Num_pg_description_indices] = {DescriptionObjIndex};
 
 
 static HeapTuple CatalogIndexFetchTuple(Relation heapRelation,
-                                          Relation idesc,
-                                          ScanKey skey,
-                                          int16 num_keys);
+                       Relation idesc, ScanKey skey, int16 num_keys);
 
 
 /*
@@ -252,12 +243,89 @@ CatalogIndexFetchTuple(Relation heapRelation,
 }
 
 
+/*---------------------------------------------------------------------
+ *                       Class-specific index lookups
+ *---------------------------------------------------------------------
+ */
+
 /*
  * The remainder of the file is for individual index scan routines.  Each
  * index should be scanned according to how it was defined during bootstrap
  * (that is, functional or normal) and what arguments the cache lookup
  * requires.  Each routine returns the heap tuple that qualifies.
  */
+HeapTuple
+AccessMethodOpidIndexScan(Relation heapRelation,
+                                                 Oid claid,
+                                                 Oid opopr,
+                                                 Oid opid)
+{
+       Relation        idesc;
+       ScanKeyData skey[3];
+       HeapTuple       tuple;
+
+       ScanKeyEntryInitialize(&skey[0],
+                                                  (bits16) 0x0,
+                                                  (AttrNumber) 1,
+                                                  (RegProcedure) F_OIDEQ,
+                                                  ObjectIdGetDatum(claid));
+
+       ScanKeyEntryInitialize(&skey[1],
+                                                  (bits16) 0x0,
+                                                  (AttrNumber) 2,
+                                                  (RegProcedure) F_OIDEQ,
+                                                  ObjectIdGetDatum(opopr));
+
+       ScanKeyEntryInitialize(&skey[2],
+                                                  (bits16) 0x0,
+                                                  (AttrNumber) 3,
+                                                  (RegProcedure) F_OIDEQ,
+                                                  ObjectIdGetDatum(opid));
+
+       idesc = index_openr(AccessMethodOpidIndex);
+       tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
+
+       index_close(idesc);
+
+       return tuple;
+}
+
+HeapTuple
+AccessMethodStrategyIndexScan(Relation heapRelation,
+                                                         Oid opid,
+                                                         Oid claid,
+                                                         int2 opstrategy)
+{
+       Relation        idesc;
+       ScanKeyData skey[3];
+       HeapTuple       tuple;
+
+       ScanKeyEntryInitialize(&skey[0],
+                                                  (bits16) 0x0,
+                                                  (AttrNumber) 1,
+                                                  (RegProcedure) F_OIDEQ,
+                                                  ObjectIdGetDatum(opid));
+
+       ScanKeyEntryInitialize(&skey[1],
+                                                  (bits16) 0x0,
+                                                  (AttrNumber) 2,
+                                                  (RegProcedure) F_OIDEQ,
+                                                  ObjectIdGetDatum(claid));
+
+       ScanKeyEntryInitialize(&skey[2],
+                                                  (bits16) 0x0,
+                                                  (AttrNumber) 3,
+                                                  (RegProcedure) F_INT2EQ,
+                                                  Int16GetDatum(opstrategy));
+
+       idesc = index_openr(AccessMethodStrategyIndex);
+       tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
+
+       index_close(idesc);
+
+       return tuple;
+}
 HeapTuple
 AttributeNameIndexScan(Relation heapRelation,
                                           Oid relid,
@@ -317,6 +385,28 @@ AttributeNumIndexScan(Relation heapRelation,
        return tuple;
 }
 
+HeapTuple
+IndexRelidIndexScan(Relation heapRelation, Oid relid)
+{
+       Relation        idesc;
+       ScanKeyData skey[1];
+       HeapTuple       tuple;
+
+       ScanKeyEntryInitialize(&skey[0],
+                                                  (bits16) 0x0,
+                                                  (AttrNumber) 1,
+                                                  (RegProcedure) F_OIDEQ,
+                                                  ObjectIdGetDatum(relid));
+
+       idesc = index_openr(IndexRelidIndex);
+       tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
+
+       index_close(idesc);
+
+       return tuple;
+}
+
+
 
 HeapTuple
 ProcedureOidIndexScan(Relation heapRelation, Oid procId)
index b3870b4ae5d43400ff573ebff0d1e500242acf12..45f837043e1768bf99cc9b2f3c82a60a56b85846 100644 (file)
@@ -4,7 +4,7 @@
 #    Makefile for utils/adt
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.23 1999/07/20 02:44:09 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.24 1999/07/20 16:48:55 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -15,8 +15,13 @@ CFLAGS += -I../..
 
 # seems to be required for some date/time stuff 07/19/1999 bjm
 ifeq ($(CPU),alpha)
+ifeq ($(CC), gcc)
 CFLAGS+= -mieee
 endif
+ifeq ($(CC), egcs)
+CFLAGS+= -mieee
+endif
+endif
 
 ifdef MULTIBYTE
 CFLAGS+= $(MBFLAGS)
index 3a7f524ccce1abcb7a244c38b7b77a5179c89888..2dc797206f7a34ce5e5bb82a16037220b6791230 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.31 1999/07/17 20:18:02 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.32 1999/07/20 16:48:55 momjian Exp $
  *
  * NOTES
  *       These routines allow the parser/planner/executor to perform
@@ -58,8 +58,8 @@ static struct cachedesc cacheinfo[] = {
                        0
                },
                sizeof(FormData_pg_amop),
-               NULL,
-       (ScanFunc) NULL},
+               AccessMethodOpidIndex,
+       (ScanFunc) AccessMethodOpidIndexScan},
        {AccessMethodOperatorRelationName,      /* AMOPSTRATEGY */
                3,
                {
@@ -69,8 +69,8 @@ static struct cachedesc cacheinfo[] = {
                        0
                },
                sizeof(FormData_pg_amop),
-               NULL,
-       (ScanFunc) NULL},
+               AccessMethodStrategyIndex,
+       (ScanFunc) AccessMethodStrategyIndexScan},
        {AttributeRelationName,         /* ATTNAME */
                2,
                {
@@ -81,7 +81,7 @@ static struct cachedesc cacheinfo[] = {
                },
                ATTRIBUTE_TUPLE_SIZE,
                AttributeNameIndex,
-       (ScanFunc) AttributeNameIndexScan},
+       (ScanFunc) IndexRelidIndexScan},
        {AttributeRelationName,         /* ATTNUM */
                2,
                {
@@ -102,8 +102,8 @@ static struct cachedesc cacheinfo[] = {
                        0
                },
                offsetof(FormData_pg_index, indpred),
-               NULL,
-       NULL},
+               IndexRelidIndex,
+       (ScanFunc) IndexRelidIndexScan},
        {LanguageRelationName,          /* LANNAME */
                1,
                {
@@ -225,17 +225,6 @@ static struct cachedesc cacheinfo[] = {
                sizeof(FormData_pg_opclass),
                NULL,
        NULL},
-       {IndexRelationName,                     /* INDRELIDKEY *//* never used */
-               2,
-               {
-                       Anum_pg_index_indrelid,
-                       Anum_pg_index_indkey,
-                       0,
-                       0
-               },
-               offsetof(FormData_pg_index, indpred),
-               NULL,
-       (ScanFunc) NULL},
        {InheritsRelationName,          /* INHRELID */
                2,
                {
index 73df64aaca6337d61d984e7af6e4f8e11c285ed1..4a7cfa7c47190fa7e9356f3b7b1948c174691213 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: indexing.h,v 1.21 1999/07/15 23:03:42 momjian Exp $
+ * $Id: indexing.h,v 1.22 1999/07/20 16:48:56 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -19,7 +19,9 @@
 /*
  * Some definitions for indices on pg_attribute
  */
+#define Num_pg_amop_indices            2
 #define Num_pg_attr_indices            3
+#define Num_pg_index_indices   1
 #define Num_pg_proc_indices            3
 #define Num_pg_type_indices            2
 #define Num_pg_class_indices   2
 /*
  * Names of indices on system catalogs
  */
-#define AttributeNameIndex "pg_attribute_relid_attnam_index"
-#define AttributeNumIndex  "pg_attribute_relid_attnum_index"
+#define AccessMethodOpidIndex "pg_amop_opid_index"
+#define AccessMethodStrategyIndex "pg_amop_strategy_index"
+#define AttributeNameIndex     "pg_attribute_relid_attnam_index"
+#define AttributeNumIndex      "pg_attribute_relid_attnum_index"
 #define AttributeRelidIndex "pg_attribute_attrelid_index"
-#define ProcedureOidIndex  "pg_proc_oid_index"
-#define ProcedureNameIndex "pg_proc_proname_narg_type_index"
-#define ProcedureSrcIndex  "pg_proc_prosrc_index"
-#define TypeOidIndex      "pg_type_oid_index"
-#define TypeNameIndex     "pg_type_typname_index"
-#define ClassOidIndex     "pg_class_oid_index"
-#define ClassNameIndex    "pg_class_relname_index"
-#define AttrDefaultIndex   "pg_attrdef_adrelid_index"
-#define RelCheckIndex     "pg_relcheck_rcrelid_index"
-#define TriggerRelidIndex  "pg_trigger_tgrelid_index"
+#define IndexRelidIndex        "pg_index_indexrelid_index"
+#define ProcedureOidIndex      "pg_proc_oid_index"
+#define ProcedureNameIndex     "pg_proc_proname_narg_type_index"
+#define ProcedureSrcIndex      "pg_proc_prosrc_index"
+#define TypeOidIndex           "pg_type_oid_index"
+#define TypeNameIndex          "pg_type_typname_index"
+#define ClassOidIndex          "pg_class_oid_index"
+#define ClassNameIndex         "pg_class_relname_index"
+#define AttrDefaultIndex       "pg_attrdef_adrelid_index"
+#define RelCheckIndex          "pg_relcheck_rcrelid_index"
+#define TriggerRelidIndex      "pg_trigger_tgrelid_index"
 #define DescriptionObjIndex "pg_description_objoid_index"
 
+extern char *Name_pg_amop_indices[];
 extern char *Name_pg_attr_indices[];
+extern char *Name_pg_index_indices[];
 extern char *Name_pg_proc_indices[];
 extern char *Name_pg_type_indices[];
 extern char *Name_pg_class_indices[];
@@ -56,6 +63,7 @@ extern char *Name_pg_relcheck_indices[];
 extern char *Name_pg_trigger_indices[];
 extern char *Name_pg_description_indices[];
 
+
 extern char *IndexedCatalogNames[];
 
 /*
@@ -71,16 +79,22 @@ extern void CatalogIndexInsert(Relation *idescs,
                                   HeapTuple heapTuple);
 extern bool CatalogHasIndex(char *catName, Oid catId);
 
-extern HeapTuple AttributeNameIndexScan(Relation heapRelation,
-                                          Oid relid,
-                                          char *attname);
 
+
+extern HeapTuple AccessMethodOpidIndexScan(Relation heapRelation,
+                                 Oid claid, Oid opopr, Oid opid);
+extern HeapTuple AccessMethodStrategyIndexScan(Relation heapRelation,
+                                 Oid opid, Oid claid, int2 opstrategy);
+extern HeapTuple AttributeNameIndexScan(Relation heapRelation,
+                                  Oid relid,
+                                  char *attname);
 extern HeapTuple AttributeNumIndexScan(Relation heapRelation,
-                                         Oid relid,
-                                         AttrNumber attnum);
+                                 Oid relid,
+                                 AttrNumber attnum);
+extern HeapTuple IndexRelidIndexScan(Relation heapRelation, Oid relid);
 extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId);
 extern HeapTuple ProcedureNameIndexScan(Relation heapRelation,
-                                          char *procName, int2 nargs, Oid *argTypes);
+                                  char *procName, int2 nargs, Oid *argTypes);
 extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text *procSrc);
 extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
 extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
@@ -88,6 +102,8 @@ extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName);
 extern HeapTuple ClassOidIndexScan(Relation heapRelation, Oid relId);
 
 
+
+
 /*
  * What follows are lines processed by genbki.sh to create the statements
  * the bootstrap parser will turn into DefineIndex commands.
@@ -95,10 +111,15 @@ extern HeapTuple ClassOidIndexScan(Relation heapRelation, Oid relId);
  * The keyword is DECLARE_INDEX every thing after that is just like in a
  * normal specification of the 'define index' POSTQUEL command.
  */
+DECLARE_INDEX(pg_amop_opid_index on pg_amop using btree(amopclaid oid_ops, amopopr oid_ops, amopid oid_ops));
+DECLARE_INDEX(pg_amop_strategy_index on pg_amop using btree(amopid oid_ops, amopclaid oid_ops, amopstrategy int2_ops));
+
 DECLARE_INDEX(pg_attribute_relid_attnam_index on pg_attribute using btree(attrelid oid_ops, attname name_ops));
 DECLARE_INDEX(pg_attribute_relid_attnum_index on pg_attribute using btree(attrelid oid_ops, attnum int2_ops));
 DECLARE_INDEX(pg_attribute_attrelid_index on pg_attribute using btree(attrelid oid_ops));
 
+DECLARE_INDEX(pg_index_indexrelid_index on pg_index using btree(indrelid oid_ops));
+
 DECLARE_INDEX(pg_proc_oid_index on pg_proc using btree(oid oid_ops));
 DECLARE_INDEX(pg_proc_proname_narg_type_index on pg_proc using btree(proname name_ops, pronargs int2_ops, proargtypes oid8_ops));
 DECLARE_INDEX(pg_proc_prosrc_index on pg_proc using btree(prosrc text_ops));
index 14f888b76ce2ac89bca5d46357bfae7ce266a831..5378b6319dc562b21964d88af1545f7a49d2fa90 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: syscache.h,v 1.15 1999/07/15 23:04:24 momjian Exp $
+ * $Id: syscache.h,v 1.16 1999/07/20 16:48:58 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #define TYPOID                 13
 #define AMNAME                 14
 #define CLANAME                        15
-#define INDRELIDKEY            16
-#define INHRELID               17
-#define RULOID                 18
-#define AGGNAME                        19
-#define LISTENREL              20
-#define USENAME                        21
-#define USESYSID               22
-#define GRONAME                        23
-#define GROSYSID               24
-#define REWRITENAME            25
-#define PROSRC                 26
-#define CLADEFTYPE             27
-#define LANOID                 28
+#define INHRELID               16
+#define RULOID                 17
+#define AGGNAME                        18
+#define LISTENREL              19
+#define USENAME                        20
+#define USESYSID               21
+#define GRONAME                        22
+#define GROSYSID               23
+#define REWRITENAME            24
+#define PROSRC                 25
+#define CLADEFTYPE             26
+#define LANOID                 27
 
 /* ----------------
  *             struct cachedesc:               information needed for a call to InitSysCache()