Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6923ff

Browse files
committed
Oops, only wanted python change in the last commit. Backing out.
1 parentdffb673 commitf6923ff

File tree

9 files changed

+15
-208
lines changed

9 files changed

+15
-208
lines changed

‎doc/src/sgml/ref/vacuum.sgml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuum.sgml,v 1.15 2001/05/25 15:34:49 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuum.sgml,v 1.16 2001/05/25 15:45:31 momjian Exp $
33
Postgres documentation
44
-->
55

@@ -154,8 +154,7 @@ NOTICE: Index <replaceable class="PARAMETER">index</replaceable>: Pages 28;
154154

155155
<para>
156156
With no parameter, <command>VACUUM</command> processes every table in the
157-
current database. It also detects any extraneous files in the
158-
database directory. With a parameter, <command>VACUUM</command> processes
157+
current database. With a parameter, <command>VACUUM</command> processes
159158
only that table.
160159
</para>
161160

‎src/backend/access/transam/varsup.c

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2000, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.39 2001/05/25 15:34:49 momjian Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.40 2001/05/25 15:45:32 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -16,10 +16,7 @@
1616
#include"access/transam.h"
1717
#include"access/xlog.h"
1818
#include"storage/proc.h"
19-
#include"storage/sinval.h"
20-
#include"storage/sinvaladt.h"
2119

22-
externSISeg*shmInvalBuffer;
2320

2421
/* Number of XIDs and OIDs to prefetch (preallocate) per XLOG write */
2522
#defineVAR_XID_PREFETCH1024
@@ -146,44 +143,3 @@ CheckMaxObjectId(Oid assigned_oid)
146143

147144
SpinRelease(OidGenLockId);
148145
}
149-
150-
/*
151-
* GetMinBackendOid -- returns lowest oid stored on startup of
152-
* each backend.
153-
*/
154-
Oid
155-
GetMinStartupOid(void)
156-
{
157-
SISeg*segP=shmInvalBuffer;
158-
ProcState*stateP=segP->procState;
159-
intindex;
160-
Oidmin_oid;
161-
162-
/* prime with current oid, no need for lock */
163-
min_oid=ShmemVariableCache->nextOid;
164-
165-
SpinAcquire(SInvalLock);
166-
167-
for (index=0;index<segP->lastBackend;index++)
168-
{
169-
SHMEM_OFFSETpOffset=stateP[index].procStruct;
170-
171-
if (pOffset!=INVALID_OFFSET)
172-
{
173-
PROC*proc= (PROC*)MAKE_PTR(pOffset);
174-
Oidproc_oid;
175-
176-
proc_oid=proc->startOid;/* we don't use spin-locking in
177-
* AbortTransaction() ! */
178-
if (proc==MyProc||proc_oid <=BootstrapObjectIdData)
179-
continue;
180-
if (proc_oid<min_oid)
181-
min_oid=proc_oid;
182-
}
183-
}
184-
185-
SpinRelease(SInvalLock);
186-
returnmin_oid;
187-
}
188-
189-

‎src/backend/commands/vacuum.c

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,17 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.194 2001/05/25 15:34:49 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.195 2001/05/25 15:45:32 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515
#include"postgres.h"
1616

1717
#include<fcntl.h>
1818
#include<unistd.h>
19-
#include<stdlib.h>
20-
#include<limits.h>
2119
#include<time.h>
2220
#include<sys/time.h>
2321
#include<sys/types.h>
24-
#include<dirent.h>
2522
#include<sys/file.h>
2623
#include<sys/stat.h>
2724

@@ -33,7 +30,6 @@
3330

3431
#include"access/genam.h"
3532
#include"access/heapam.h"
36-
#include"access/transam.h"
3733
#include"access/xlog.h"
3834
#include"catalog/catalog.h"
3935
#include"catalog/catname.h"
@@ -163,7 +159,6 @@ static intvac_cmp_vtlinks(const void *left, const void *right);
163159
staticboolenough_space(VacPagevacpage,Sizelen);
164160
staticvoidinit_rusage(VacRUsage*ru0);
165161
staticchar*show_rusage(VacRUsage*ru0);
166-
staticvoidreport_orphans(void);
167162

168163

169164
/*
@@ -241,10 +236,6 @@ vacuum(VacuumStmt *vacstmt)
241236

242237
/* clean up */
243238
vacuum_shutdown();
244-
245-
if (VacRelName==NULL)
246-
report_orphans();
247-
248239
}
249240

250241
/*
@@ -2655,74 +2646,3 @@ show_rusage(VacRUsage *ru0)
26552646

26562647
returnresult;
26572648
}
2658-
2659-
/*
2660-
* report_orphans
2661-
*
2662-
* Report files that are not referenced by any pg_class.relfilenode.
2663-
* Could be caused by backend crash no cleaning up.
2664-
*/
2665-
staticvoid
2666-
report_orphans(void)
2667-
{
2668-
DIR*db_dir;
2669-
structdirent*db_de;
2670-
Relationrel;
2671-
TupleDesctupdesc;
2672-
HeapScanDescscan;
2673-
HeapTupletuple;
2674-
Oiddir_file_oid;
2675-
Oidrel_file_oid;
2676-
Datumd;
2677-
booln;
2678-
boolmatch_found;
2679-
charcwd[MAXPGPATH];
2680-
2681-
getcwd(cwd,MAXPGPATH);
2682-
db_dir=opendir(".");
2683-
rel=heap_openr(RelationRelationName,AccessShareLock);
2684-
Assert(db_dir);
2685-
2686-
/*
2687-
* Cycle through directory and check each file against
2688-
* pg_class.relfilenode.
2689-
* XXX This is O(n^2). Is it too slow? bjm
2690-
*/
2691-
while ((db_de=readdir(db_dir))!=NULL)
2692-
{
2693-
if (strspn(db_de->d_name,"0123456789")==
2694-
strlen(db_de->d_name))
2695-
{
2696-
dir_file_oid= (Oid)strtoul((db_de->d_name),NULL,10);
2697-
2698-
if (dir_file_oid >=GetMinStartupOid()||
2699-
dir_file_oid <=BootstrapObjectIdData)
2700-
continue;
2701-
2702-
tupdesc=RelationGetDescr(rel);
2703-
2704-
match_found= false;
2705-
scan=heap_beginscan(rel, false,SnapshotNow,0, (ScanKey)NULL);
2706-
while (HeapTupleIsValid(tuple=heap_getnext(scan,0)))
2707-
{
2708-
d=heap_getattr(tuple,Anum_pg_class_relfilenode,tupdesc,&n);
2709-
rel_file_oid=DatumGetObjectId(d);
2710-
if (dir_file_oid==rel_file_oid)
2711-
{
2712-
match_found= true;
2713-
break;
2714-
}
2715-
}
2716-
heap_endscan(scan);
2717-
/* make sure there was no oid wrap-around during the scan */
2718-
if (!match_found&&dir_file_oid <=ShmemVariableCache->nextOid)
2719-
elog(NOTICE,
2720-
"Unreferenced file found in database directory:\n\t%s/%s",
2721-
cwd,db_de->d_name);
2722-
/* Maybe one day we can unlink too. bjm 2001-05-24 */
2723-
}
2724-
}
2725-
2726-
heap_close(rel,AccessShareLock);
2727-
closedir(db_dir);
2728-
}

‎src/backend/postmaster/postmaster.c

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
*
3030
* IDENTIFICATION
31-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.213 2001/05/25 15:34:50 momjian Exp $
31+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.214 2001/05/25 15:45:33 momjian Exp $
3232
*
3333
* NOTES
3434
*
@@ -58,7 +58,6 @@
5858
#include<ctype.h>
5959
#include<sys/types.h>
6060
#include<sys/stat.h>
61-
#include<dirent.h>
6261
#include<sys/time.h>
6362
#include<sys/socket.h>
6463
#include<errno.h>
@@ -244,7 +243,6 @@ static void RandomSalt(char *salt);
244243
staticvoidSignalChildren(intsignal);
245244
staticintCountChildren(void);
246245
staticboolCreateOptsFile(intargc,char*argv[]);
247-
staticvoidRemovePgSorttemp(void);
248246

249247
staticpid_tSSDataBase(intxlop);
250248

@@ -597,9 +595,6 @@ PostmasterMain(int argc, char *argv[])
597595
if (!CreateDataDirLockFile(DataDir, true))
598596
ExitPostmaster(1);
599597

600-
/* Remove old sort files */
601-
RemovePgSorttemp();
602-
603598
/*
604599
* Establish input sockets.
605600
*/
@@ -2455,51 +2450,3 @@ CreateOptsFile(int argc, char *argv[])
24552450
fclose(fp);
24562451
return true;
24572452
}
2458-
2459-
2460-
/*
2461-
* Remove old sort files
2462-
*/
2463-
staticvoid
2464-
RemovePgSorttemp(void)
2465-
{
2466-
chardb_path[MAXPGPATH];
2467-
chartemp_path[MAXPGPATH];
2468-
charrm_path[MAXPGPATH];
2469-
DIR*db_dir;
2470-
DIR*temp_dir;
2471-
structdirent*db_de;
2472-
structdirent*temp_de;
2473-
2474-
/*
2475-
* Cycle through pg_tempsort for all databases and
2476-
* and remove old sort files.
2477-
*/
2478-
/* trailing slash forces symlink following */
2479-
snprintf(db_path,sizeof(db_path),"%s/base/",DataDir);
2480-
if ((db_dir=opendir(db_path))!=NULL)
2481-
{
2482-
while ((db_de=readdir(db_dir))!=NULL)
2483-
{
2484-
snprintf(temp_path,sizeof(temp_path),
2485-
"%s/%s/%s/",db_path,db_de->d_name,SORT_TEMP_DIR);
2486-
if ((temp_dir=opendir(temp_path))!=NULL)
2487-
{
2488-
while ((temp_de=readdir(temp_dir))!=NULL)
2489-
{
2490-
if (strspn(temp_de->d_name,"0123456789.")==
2491-
strlen(temp_de->d_name))
2492-
{
2493-
snprintf(rm_path,sizeof(temp_path),
2494-
"%s/%s/%s/%s",
2495-
db_path,db_de->d_name,
2496-
SORT_TEMP_DIR,temp_de->d_name);
2497-
unlink(rm_path);
2498-
}
2499-
}
2500-
closedir(temp_dir);
2501-
}
2502-
}
2503-
closedir(db_dir);
2504-
}
2505-
}

‎src/backend/storage/file/fd.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.77 2001/05/25 15:34:50 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.78 2001/05/25 15:45:33 momjian Exp $
1111
*
1212
* NOTES:
1313
*
@@ -742,29 +742,21 @@ PathNameOpenFile(FileName fileName, int fileFlags, int fileMode)
742742
File
743743
OpenTemporaryFile(void)
744744
{
745-
chartempfilepath[128];
745+
chartempfilename[64];
746746
Filefile;
747747

748748
/*
749749
* Generate a tempfile name that's unique within the current
750750
* transaction
751751
*/
752-
snprintf(tempfilepath,sizeof(tempfilepath),
753-
"%s%c%d.%ld",SORT_TEMP_DIR,SEP_CHAR,MyProcPid,
754-
tempFileCounter++);
752+
snprintf(tempfilename,sizeof(tempfilename),
753+
"pg_sorttemp%d.%ld",MyProcPid,tempFileCounter++);
755754

756755
/* Open the file */
757-
file=FileNameOpenFile(tempfilepath,
756+
file=FileNameOpenFile(tempfilename,
758757
O_RDWR |O_CREAT |O_TRUNC |PG_BINARY,0600);
759758
if (file <=0)
760-
{
761-
/* mkdir could fail if some one else already created it */
762-
mkdir(SORT_TEMP_DIR,S_IRWXU);
763-
file=FileNameOpenFile(tempfilepath,
764-
O_RDWR |O_CREAT |O_TRUNC |PG_BINARY,0600);
765-
if (file <=0)
766-
elog(ERROR,"Failed to create temporary file %s",tempfilepath);
767-
}
759+
elog(ERROR,"Failed to create temporary file %s",tempfilename);
768760

769761
/* Mark it for deletion at close or EOXact */
770762
VfdCache[file].fdstate |=FD_TEMPORARY;

‎src/backend/storage/lmgr/proc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.101 2001/05/25 15:34:50 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.102 2001/05/25 15:45:33 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -261,7 +261,6 @@ InitProcess(void)
261261
MyProc->databaseId=MyDatabaseId;
262262
MyProc->xid=InvalidTransactionId;
263263
MyProc->xmin=InvalidTransactionId;
264-
MyProc->startOid=ShmemVariableCache->nextOid;
265264
MyProc->waitLock=NULL;
266265
MyProc->waitHolder=NULL;
267266
SHMQueueInit(&(MyProc->procHolders));

‎src/include/access/transam.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: transam.h,v 1.34 2001/05/25 15:34:50 momjian Exp $
10+
* $Id: transam.h,v 1.35 2001/05/25 15:45:33 momjian Exp $
1111
*
1212
* NOTES
1313
*Transaction System Version 101 now support proper oid
@@ -133,7 +133,6 @@ extern void GetNewTransactionId(TransactionId *xid);
133133
externvoidReadNewTransactionId(TransactionId*xid);
134134
externvoidGetNewObjectId(Oid*oid_return);
135135
externvoidCheckMaxObjectId(Oidassigned_oid);
136-
externOidGetMinStartupOid(void);
137136

138137
/* ----------------
139138
*global variable extern declarations

‎src/include/storage/fd.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: fd.h,v 1.28 2001/05/25 15:34:50 momjian Exp $
10+
* $Id: fd.h,v 1.29 2001/05/25 15:45:34 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -39,8 +39,6 @@
3939
* FileSeek uses the standard UNIX lseek(2) flags.
4040
*/
4141

42-
#defineSORT_TEMP_DIR "pg_sorttemp"
43-
4442
typedefchar*FileName;
4543

4644
typedefintFile;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp