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
31309423
Commit
31309423
authored
Aug 20, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another vacuum fix.
parent
09e12508
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
21 deletions
+46
-21
src/backend/catalog/index.c
src/backend/catalog/index.c
+31
-7
src/backend/catalog/indexing.c
src/backend/catalog/indexing.c
+4
-4
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+9
-8
src/bin/initdb/initdb.sh
src/bin/initdb/initdb.sh
+2
-2
No files found.
src/backend/catalog/index.c
View file @
31309423
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.4
8 1998/08/19 02:01:32
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.4
9 1998/08/20 15:16:54
momjian Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -1308,6 +1308,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
Datum
values
[
Natts_pg_class
];
char
nulls
[
Natts_pg_class
];
char
replace
[
Natts_pg_class
];
HeapScanDesc
pg_class_scan
=
NULL
;
/* ----------------
* This routine handles updates for both the heap and index relation
...
...
@@ -1340,11 +1341,30 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
if
(
!
RelationIsValid
(
pg_class
))
elog
(
ERROR
,
"UpdateStats: could not open RELATION relation"
);
tuple
=
SearchSysCacheTupleCopy
(
RELOID
,
ObjectIdGetDatum
(
relid
),
0
,
0
,
0
);
if
(
!
IsBootstrapProcessingMode
())
{
tuple
=
SearchSysCacheTupleCopy
(
RELOID
,
ObjectIdGetDatum
(
relid
),
0
,
0
,
0
);
}
else
{
ScanKeyData
key
[
1
];
ScanKeyEntryInitialize
(
&
key
[
0
],
0
,
ObjectIdAttributeNumber
,
F_OIDEQ
,
ObjectIdGetDatum
(
relid
));
pg_class_scan
=
heap_beginscan
(
pg_class
,
0
,
SnapshotNow
,
1
,
key
);
tuple
=
heap_getnext
(
pg_class_scan
,
0
);
}
if
(
!
HeapTupleIsValid
(
tuple
))
{
if
(
IsBootstrapProcessingMode
())
heap_endscan
(
pg_class_scan
);
heap_close
(
pg_class
);
elog
(
ERROR
,
"UpdateStats: cannot scan RELATION relation"
);
}
...
...
@@ -1385,11 +1405,11 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
* At bootstrap time, we don't need to worry about concurrency or
* visibility of changes, so we cheat.
*/
rd_rel
=
(
Form_pg_class
)
GETSTRUCT
(
tuple
);
rd_rel
->
relpages
=
relpages
;
rd_rel
->
reltuples
=
reltuples
;
rd_rel
->
relhasindex
=
hasindex
;
WriteBuffer
(
pg_class_scan
->
rs_cbuf
);
}
else
{
...
...
@@ -1402,14 +1422,18 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
values
[
Anum_pg_class_relhasindex
-
1
]
=
CharGetDatum
(
hasindex
);
newtup
=
heap_modifytuple
(
tuple
,
pg_class
,
values
,
nulls
,
replace
);
heap_replace
(
pg_class
,
&
newtup
->
t_ctid
,
newtup
);
heap_replace
(
pg_class
,
&
tuple
->
t_ctid
,
newtup
);
pfree
(
newtup
);
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
idescs
);
CatalogIndexInsert
(
idescs
,
Num_pg_class_indices
,
pg_class
,
newtup
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
}
pfree
(
tuple
);
if
(
!
IsBootstrapProcessingMode
())
pfree
(
tuple
);
else
heap_endscan
(
pg_class_scan
);
heap_close
(
pg_class
);
heap_close
(
whichRel
);
}
...
...
src/backend/catalog/indexing.c
View file @
31309423
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.2
0 1998/08/19 02:01:33
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.2
1 1998/08/20 15:16:55
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -254,7 +254,7 @@ CatalogIndexFetchTuple(Relation heapRelation,
index_endscan
(
sd
);
pfree
(
sd
);
return
(
tuple
)
;
return
tuple
;
}
/*
...
...
@@ -276,7 +276,7 @@ AttributeNameIndexScan(Relation heapRelation,
(
bits16
)
0x0
,
(
AttrNumber
)
1
,
(
RegProcedure
)
F_OIDEQ
,
Int32
GetDatum
(
relid
));
ObjectId
GetDatum
(
relid
));
ScanKeyEntryInitialize
(
&
skey
[
1
],
(
bits16
)
0x0
,
...
...
@@ -456,7 +456,7 @@ ClassNameIndexScan(Relation heapRelation, char *relName)
(
bits16
)
0x0
,
(
AttrNumber
)
1
,
(
RegProcedure
)
F_NAMEEQ
,
(
Datum
)
relName
);
PointerGetDatum
(
relName
)
);
idesc
=
index_openr
(
ClassNameIndex
);
tuple
=
CatalogIndexFetchTuple
(
heapRelation
,
idesc
,
skey
,
1
);
...
...
src/backend/commands/vacuum.c
View file @
31309423
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.7
4 1998/08/19 23:48:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.7
5 1998/08/20 15:16:57
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -188,7 +188,7 @@ vc_init()
if
((
fd
=
open
(
"pg_vlock"
,
O_CREAT
|
O_EXCL
,
0600
))
<
0
)
{
elog
(
ERROR
,
"Can't create lock file
--
another vacuum cleaner running?
\n
\
elog
(
ERROR
,
"Can't create lock file
. Is
another vacuum cleaner running?
\n
\
\t
If not, you may remove the pg_vlock file in the pgsql/data/base/your_db
\n
\
\t
directory"
);
}
...
...
@@ -2204,24 +2204,25 @@ static void
vc_mkindesc
(
Relation
onerel
,
int
nindices
,
Relation
*
Irel
,
IndDesc
**
Idesc
)
{
IndDesc
*
idcur
;
HeapTuple
tuple
;
HeapTuple
tuple
,
cachetuple
;
AttrNumber
*
attnumP
;
int
natts
;
int
i
;
Buffer
buffer
;
*
Idesc
=
(
IndDesc
*
)
palloc
(
nindices
*
sizeof
(
IndDesc
));
for
(
i
=
0
,
idcur
=
*
Idesc
;
i
<
nindices
;
i
++
,
idcur
++
)
{
tuple
=
SearchSysCacheTuple
(
INDEXRELID
,
ObjectIdGetDatum
(
RelationGetRelid
(
Irel
[
i
])),
0
,
0
,
0
);
cachetuple
=
SearchSysCacheTupleCopy
(
INDEXRELID
,
ObjectIdGetDatum
(
RelationGetRelid
(
Irel
[
i
])),
0
,
0
,
0
);
Assert
(
tuple
);
/* get the buffer cache tuple */
tuple
=
heap_fetch
(
onerel
,
SnapshotNow
,
&
tuple
->
t_ctid
,
&
buffer
);
tuple
=
heap_fetch
(
onerel
,
SnapshotNow
,
&
cache
tuple
->
t_ctid
,
&
buffer
);
Assert
(
tuple
);
pfree
(
cachetuple
);
idcur
->
tform
=
(
IndexTupleForm
)
GETSTRUCT
(
tuple
);
for
(
attnumP
=
&
(
idcur
->
tform
->
indkey
[
0
]),
natts
=
0
;
...
...
src/bin/initdb/initdb.sh
View file @
31309423
...
...
@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.4
8 1998/08/19 23:48:23
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.4
9 1998/08/20 15:16:59
momjian Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -316,7 +316,7 @@ fi
BACKENDARGS
=
"-boot -C -F -D
$PGDATA
$BACKEND_TALK_ARG
"
echo
"
$CMDNAME
: c
reating template database in
$PGDATA
/base/template1"
echo
"
C
reating template database in
$PGDATA
/base/template1"
[
"
$debug
"
-ne
0
]
&&
echo
"Running: postgres
$BACKENDARGS
template1"
cat
$TEMPLATE
\
...
...
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