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
629e2728
Commit
629e2728
authored
Nov 21, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused files.
parent
3fa2bb31
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
181 deletions
+3
-181
src/backend/commands/purge.c
src/backend/commands/purge.c
+0
-176
src/backend/executor/execAmi.c
src/backend/executor/execAmi.c
+3
-5
src/include/commands/purge.h
src/include/commands/purge.h
+0
-0
src/include/parser/sysfunc.h
src/include/parser/sysfunc.h
+0
-0
src/man/purge.l
src/man/purge.l
+0
-0
No files found.
src/backend/commands/purge.c
deleted
100644 → 0
View file @
3fa2bb31
/*-------------------------------------------------------------------------
*
* purge.c--
* the POSTGRES purge command.
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/purge.c,v 1.9 1997/11/20 23:21:08 momjian Exp $
*
* Note:
* XXX There are many instances of int32 instead of ...Time. These
* should be changed once it is decided the signed'ness will be.
*
*-------------------------------------------------------------------------
*/
#include <string.h>
#include <postgres.h>
#include <access/heapam.h>
#include <access/xact.h>
#include <utils/tqual.h>
/* for NowTimeQual */
#include <catalog/catname.h>
#include <catalog/indexing.h>
#include <fmgr.h>
#include <commands/purge.h>
#include <utils/builtins.h>
/* for isreltime() */
static
char
cmdname
[]
=
"RelationPurge"
;
#define RELATIVE 01
#define ABSOLUTE 02
int32
RelationPurge
(
char
*
relationName
,
char
*
absoluteTimeString
,
char
*
relativeTimeString
)
{
register
i
;
AbsoluteTime
absoluteTime
=
INVALID_ABSTIME
;
RelativeTime
relativeTime
=
INVALID_RELTIME
;
bits8
dateTag
;
Relation
relation
;
HeapScanDesc
scan
;
static
ScanKeyData
key
[
1
]
=
{
{
0
,
Anum_pg_class_relname
,
F_NAMEEQ
}
};
Buffer
buffer
;
HeapTuple
newTuple
,
oldTuple
;
AbsoluteTime
currentTime
;
char
*
values
[
Natts_pg_class
];
char
nulls
[
Natts_pg_class
];
char
replace
[
Natts_pg_class
];
Relation
idescs
[
Num_pg_class_indices
];
/*
* XXX for some reason getmyrelids (in inval.c) barfs when you
* heap_replace tuples from these classes. i thought setheapoverride
* would fix it but it didn't. for now, just disallow purge on these
* classes.
*/
if
(
strcmp
(
RelationRelationName
,
relationName
)
==
0
||
strcmp
(
AttributeRelationName
,
relationName
)
==
0
||
strcmp
(
AccessMethodRelationName
,
relationName
)
==
0
||
strcmp
(
AccessMethodOperatorRelationName
,
relationName
)
==
0
)
{
elog
(
WARN
,
"%s: cannot purge catalog
\"
%s
\"
"
,
cmdname
,
relationName
);
}
if
(
PointerIsValid
(
absoluteTimeString
))
{
absoluteTime
=
(
int32
)
nabstimein
(
absoluteTimeString
);
absoluteTimeString
[
0
]
=
'\0'
;
if
(
absoluteTime
==
INVALID_ABSTIME
)
{
elog
(
NOTICE
,
"%s: bad absolute time string
\"
%s
\"
"
,
cmdname
,
absoluteTimeString
);
elog
(
WARN
,
"purge not executed"
);
}
}
#ifdef PURGEDEBUG
elog
(
DEBUG
,
"%s: absolute time `%s' is %d."
,
cmdname
,
absoluteTimeString
,
absoluteTime
);
#endif
/* defined(PURGEDEBUG) */
if
(
PointerIsValid
(
relativeTimeString
))
{
if
(
isreltime
(
relativeTimeString
)
!=
1
)
{
elog
(
WARN
,
"%s: bad relative time string
\"
%s
\"
"
,
cmdname
,
relativeTimeString
);
}
relativeTime
=
reltimein
(
relativeTimeString
);
#ifdef PURGEDEBUG
elog
(
DEBUG
,
"%s: relative time `%s' is %d."
,
cmdname
,
relativeTimeString
,
relativeTime
);
#endif
/* defined(PURGEDEBUG) */
}
/*
* Find the RELATION relation tuple for the given relation.
*/
relation
=
heap_openr
(
RelationRelationName
);
key
[
0
].
sk_argument
=
PointerGetDatum
(
relationName
);
fmgr_info
(
key
[
0
].
sk_procedure
,
&
key
[
0
].
sk_func
,
&
key
[
0
].
sk_nargs
);
scan
=
heap_beginscan
(
relation
,
0
,
false
,
1
,
key
);
oldTuple
=
heap_getnext
(
scan
,
0
,
&
buffer
);
if
(
!
HeapTupleIsValid
(
oldTuple
))
{
heap_endscan
(
scan
);
heap_close
(
relation
);
elog
(
WARN
,
"%s: no such relation: %s"
,
cmdname
,
relationName
);
return
(
0
);
}
/*
* Dig around in the tuple.
*/
currentTime
=
GetCurrentTransactionStartTime
();
if
(
!
RelativeTimeIsValid
(
relativeTime
))
{
dateTag
=
ABSOLUTE
;
if
(
!
AbsoluteTimeIsValid
(
absoluteTime
))
absoluteTime
=
currentTime
;
}
else
if
(
!
AbsoluteTimeIsValid
(
absoluteTime
))
dateTag
=
RELATIVE
;
else
dateTag
=
ABSOLUTE
|
RELATIVE
;
for
(
i
=
0
;
i
<
Natts_pg_class
;
++
i
)
{
nulls
[
i
]
=
heap_attisnull
(
oldTuple
,
i
+
1
)
?
'n'
:
' '
;
values
[
i
]
=
NULL
;
replace
[
i
]
=
' '
;
}
if
(
dateTag
&
ABSOLUTE
)
{
values
[
Anum_pg_class_relexpires
-
1
]
=
(
char
*
)
UInt32GetDatum
(
absoluteTime
);
replace
[
Anum_pg_class_relexpires
-
1
]
=
'r'
;
}
if
(
dateTag
&
RELATIVE
)
{
values
[
Anum_pg_class_relpreserved
-
1
]
=
(
char
*
)
UInt32GetDatum
(
relativeTime
);
replace
[
Anum_pg_class_relpreserved
-
1
]
=
'r'
;
}
/*
* Change the RELATION relation tuple for the given relation.
*/
newTuple
=
heap_modifytuple
(
oldTuple
,
buffer
,
relation
,
(
Datum
*
)
values
,
nulls
,
replace
);
/* XXX How do you detect an insertion error?? */
heap_replace
(
relation
,
&
newTuple
->
t_ctid
,
newTuple
);
/* keep the system catalog indices current */
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
idescs
);
CatalogIndexInsert
(
idescs
,
Num_pg_class_indices
,
relation
,
newTuple
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
pfree
(
newTuple
);
heap_endscan
(
scan
);
heap_close
(
relation
);
return
(
1
);
}
src/backend/executor/execAmi.c
View file @
629e2728
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.
9 1997/11/20 23:21:22
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.
10 1997/11/21 18:21:17
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -446,9 +446,7 @@ ExecCreatR(TupleDesc tupType,
...
@@ -446,9 +446,7 @@ ExecCreatR(TupleDesc tupType,
* heap_creatr creates a name if the argument to heap_creatr is
* heap_creatr creates a name if the argument to heap_creatr is
* '\0 '
* '\0 '
*/
*/
relDesc
=
heap_creatr
(
""
,
relDesc
=
heap_creatr
(
""
,
tupType
);
DEFAULT_SMGR
,
tupType
);
}
}
else
else
{
{
...
...
src/include/commands/purge.h
deleted
100644 → 0
View file @
3fa2bb31
src/include/parser/sysfunc.h
deleted
100644 → 0
View file @
3fa2bb31
src/man/purge.l
deleted
100644 → 0
View file @
3fa2bb31
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