⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 关系型数据库 Postgresql 6.5.2
💻
字号:
$Header: /usr/local/cvsroot/pgsql/src/backend/catalog/README,v 1.1.1.1 1996/07/09 06:21:15 scrappy Exp $This directory contains .c files that manipulate the system catalogsas well as .h files that define the structure of the system catalogs.When the compile-time scripts (such as Gen_fmgrtab.sh and genbki.sh)execute, they grep the DATA statements out of the .h files and mungethese in order to generate the .bki files.  The .bki files are thenused as input to initdb (which is just a wrapper around postgresrunning single-user in bootstrapping mode) in order to generate theinitial (template) system catalog relation files.-----------------------------------------------------------------People who are going to hose around with the .h files should be awareof the following facts:- It is very important that the DATA statements be properly formatted(e.g., no broken lines, proper use of white-space and _null_).  Thescripts are line-oriented and break easily.  In addition, the onlydocumentation on the proper format for them is the code in thebootstrap/ directory.  Just be careful when adding new DATAstatements.- Some catalogs require that OIDs be preallocated to tuples becausecertain catalogs contain circular references.  For example, pg_typecontains pointers into pg_proc (pg_type.typinput), and pg_proccontains back-pointers into pg_type (pg_proc.proargtypes).  In thesecases, the references may be explicitly set by use of the "OID ="clause of the .bki insert statement.  If no such pointers are requiredto a given tuple, then the OID may be set to the wildcard value 0(i.e., the system generates a random OID in the usual way).If you need to find a valid OID for a set of tuples that refer to eachother, use the unused_oids script.  It generates inclusive ranges of*unused* OIDs (i.e., the line "45-900" means OIDs 45 through 900 havenot been allocated yet).  However, you should not rely 100% on thisscript, since it only looks at the .h files in the catalog/ directory.Do a pg_grepsrc (recursive grep) of the source tree to insure thatthere aren't any hidden crocks (i.e., explicit use of a numeric OID)anywhere in the code.-----------------------------------------------------------------When munging the .c files, you should be aware of certain conventions:- The system catalog cache code (and most catalog-munging code ingeneral) assumes that the fixed-length portion of all system catalogtuples are in fact present.  That is, only the variable-lengthportions of a catalog tuple are assumed to be permitted to benon-NULL.  For example, if you set pg_type.typdelim to be NULL, apiece of code will likely perform "typetup->typdelim" (or, worse,"typetyp->typelem", which follows typdelim).  This will result inrandom errors or even segmentation violations.  Hence, do NOT insertcatalog tuples that contain NULL attributes except in theirvariable-length portions!- Modification of the catalogs must be performed with the properupdating of catalog indexes!  That is, several catalogs have indexeson them; when you munge them using the executor, the executor willtake care of doing the index updates, but if you make direct accessmethod calls to insert new or modified tuples into a heap, you mustalso make the calls to insert the tuple into ALL of its indexes!  Ifnot, the new tuple will generally be "invisible" to the system becausemost of the accesses to the catalogs in question will be through theassociated indexes.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -