Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c21cb16d
Commit
c21cb16d
authored
Apr 08, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document genbki.sh's ability to auto-assign OIDs for DESCR macros.
Some other minor wording improvements.
parent
1dc789ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
src/backend/catalog/README
src/backend/catalog/README
+20
-8
No files found.
src/backend/catalog/README
View file @
c21cb16d
$Header: /cvsroot/pgsql/src/backend/catalog/README,v 1.
4 2002/03/22 20:14:42
tgl Exp $
$Header: /cvsroot/pgsql/src/backend/catalog/README,v 1.
5 2002/04/08 22:09:05
tgl Exp $
This directory contains .c files that manipulate the system catalogs
This directory contains .c files that manipulate the system catalogs
as well as .h files that define the structure of the system catalogs.
as well as .h files that define the structure of the system catalogs.
...
@@ -27,9 +27,9 @@ of cross-references from other pre-loaded tuples. For example, pg_type
...
@@ -27,9 +27,9 @@ of cross-references from other pre-loaded tuples. For example, pg_type
contains pointers into pg_proc (e.g., pg_type.typinput), and pg_proc
contains pointers into pg_proc (e.g., pg_type.typinput), and pg_proc
contains back-pointers into pg_type (pg_proc.proargtypes). For such
contains back-pointers into pg_type (pg_proc.proargtypes). For such
cases, the OID assigned to a tuple may be explicitly set by use of the
cases, the OID assigned to a tuple may be explicitly set by use of the
"OID =" clause of the .bki insert statement. If no such pointers are
"OID =
n
" clause of the .bki insert statement. If no such pointers are
required to a given tuple, then the OID
may be set to the wildcard value 0
required to a given tuple, then the OID
= n clause may be omitted
(
i.e.,
the system generates a random OID in the usual way, or leaves it
(
then
the system generates a random OID in the usual way, or leaves it
0 in a catalog that has no OIDs). In practice we usually preassign OIDs
0 in a catalog that has no OIDs). In practice we usually preassign OIDs
for all or none of the pre-loaded tuples in a given catalog, even if only
for all or none of the pre-loaded tuples in a given catalog, even if only
some of them are actually cross-referenced.
some of them are actually cross-referenced.
...
@@ -39,16 +39,28 @@ be known directly in the C code. In such cases, put a #define in the
...
@@ -39,16 +39,28 @@ be known directly in the C code. In such cases, put a #define in the
catalog's .h file, and use the #define symbol in the C code. Writing
catalog's .h file, and use the #define symbol in the C code. Writing
the actual numeric value of any OID in C code is considered very bad form.
the actual numeric value of any OID in C code is considered very bad form.
(Direct references to pg_proc OIDs are common enough that there's a special
(Direct references to pg_proc OIDs are common enough that there's a special
mechanism to create the necessary #define's automatically. For all the
mechanism to create the necessary #define's automatically: see
other system catalogs, you have to manually create any #define's you need.)
backend/utils/Gen_fmgrtab.sh. For all the other system catalogs, you have
to manually create any #define's you need.)
- If you need to find a valid OID for a tuple that will be referred to by
- If you need to find a valid OID for a tuple that will be referred to by
others, use the unused_oids script. It generates inclusive ranges of
others, use the unused_oids script. It generates inclusive ranges of
*unused* OIDs (
i.e
., the line "45-900" means OIDs 45 through 900 have
*unused* OIDs (
e.g
., the line "45-900" means OIDs 45 through 900 have
not been allocated yet). Currently, OIDs 1-9999 are reserved for manual
not been allocated yet). Currently, OIDs 1-9999 are reserved for manual
assignment; the unused_oids script simply looks through the include/catalog
assignment; the unused_oids script simply looks through the include/catalog
headers to see which ones do not appear in "OID =" clauses.
headers to see which ones do not appear in "OID =" clauses.
- OIDs 10000-16383 are reserved for assignment by the genbki.sh script:
it will insert these OIDs if it sees a clause "OID = 0" in a DATA
statement. You would typically use this feature if you don't care exactly
which OID is assigned to a catalog row (because it has no cross-references
you need to hardwire) but you want to give it a DESCR entry. The DESCR macro
will not work for rows that don't have any OID at genbki.sh time.
- The OID counter starts at 16384 at bootstrap. If a catalog row is in a
table that requires OIDs, but no OID was preassigned by hand or by genbki.sh,
then it will receive an OID of 16384 or above.
- To create a "BOOTSTRAP" table you have to do a lot of extra work: these
- To create a "BOOTSTRAP" table you have to do a lot of extra work: these
tables are not created through a normal CREATE TABLE operation, but spring
tables are not created through a normal CREATE TABLE operation, but spring
into existence when first written to during initdb. Therefore, you must
into existence when first written to during initdb. Therefore, you must
...
@@ -58,7 +70,7 @@ heap_create() in heap.c to force the correct OID to be assigned when the table
...
@@ -58,7 +70,7 @@ heap_create() in heap.c to force the correct OID to be assigned when the table
is first referenced. (It's near the top of the function with the comment
is first referenced. (It's near the top of the function with the comment
beginning in 'Real ugly stuff'.) Avoid making new catalogs be bootstrap
beginning in 'Real ugly stuff'.) Avoid making new catalogs be bootstrap
catalogs if at all possible; generally, only tables that must be written to
catalogs if at all possible; generally, only tables that must be written to
to create a table should be bootstrapped.
in order
to create a table should be bootstrapped.
- Certain BOOTSTRAP tables must be at the start of the Makefile
- Certain BOOTSTRAP tables must be at the start of the Makefile
POSTGRES_BKI_SRCS variable, as these will not be created through standard
POSTGRES_BKI_SRCS variable, as these will not be created through standard
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment