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
1aff1d30
Commit
1aff1d30
authored
Jan 04, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some incorrect and obsolete commentary.
parent
c5c28ed0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
src/backend/catalog/README
src/backend/catalog/README
+13
-8
No files found.
src/backend/catalog/README
View file @
1aff1d30
$Header: /cvsroot/pgsql/src/backend/catalog/README,v 1.
1.1.1 1996/07/09 06:21:15 scrappy
Exp $
$Header: /cvsroot/pgsql/src/backend/catalog/README,v 1.
2 2002/01/04 17:06:51 tgl
Exp $
This directory contains .c files that manipulate the system catalogs
as well as .h files that define the structure of the system catalogs.
...
...
@@ -29,7 +29,8 @@ contains back-pointers into pg_type (pg_proc.proargtypes). In these
cases, the references may be explicitly set by use of the "OID ="
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
(i.e., the system generates a random OID in the usual way).
(i.e., the system generates a random OID in the usual way, or leaves it
0 in a catalog that has no OIDs).
If you need to find a valid OID for a set of tuples that refer to each
other, use the unused_oids script. It generates inclusive ranges of
...
...
@@ -38,17 +39,21 @@ not been allocated yet). However, you should not rely 100% on this
script, since it only looks at the .h files in the catalog/ directory.
Do a pg_grepsrc (recursive grep) of the source tree to insure that
there aren't any hidden crocks (i.e., explicit use of a numeric OID)
anywhere in the code.
anywhere in the code. (tgl 1/2002: that advice is obsolete; there are
no hardcoded uses of OIDs in the C files anymore. All OIDs that are known
directly to C code should be referenced via #defines in the catalog .h files.
So unused_oids is sufficient for assigning new OIDs.)
-----------------------------------------------------------------
When munging the .c files, you should be aware of certain conventions:
- The system catalog cache code (and most catalog-munging code in
general) assumes that the fixed-length portion of all system catalog
tuples are in fact present. That is, only the variable-length
portions of a catalog tuple are assumed to be permitted to be
non-NULL. For example, if you set pg_type.typdelim to be NULL, a
general) assumes that the fixed-length portions of all system catalog
tuples are in fact present, because it maps C struct declarations onto
them. Thus, the variable-length fields must all be at the end, and
only the variable-length fields of a catalog tuple are permitted to be
NULL. For example, if you set pg_type.typdelim to be NULL, a
piece of code will likely perform "typetup->typdelim" (or, worse,
"typetyp->typelem", which follows typdelim). This will result in
random errors or even segmentation violations. Hence, do NOT insert
...
...
@@ -56,7 +61,7 @@ catalog tuples that contain NULL attributes except in their
variable-length portions!
- Modification of the catalogs must be performed with the proper
updating of catalog indexes! That is,
several
catalogs have indexes
updating of catalog indexes! That is,
most
catalogs have indexes
on them; when you munge them using the executor, the executor will
take care of doing the index updates, but if you make direct access
method calls to insert new or modified tuples into a heap, you must
...
...
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