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
6945ea34
Commit
6945ea34
authored
Aug 17, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move pg_controldata to /bin.
parent
a208ea72
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
676 deletions
+5
-676
contrib/pg_resetxlog/Makefile
contrib/pg_resetxlog/Makefile
+0
-19
contrib/pg_resetxlog/README.pg_resetxlog
contrib/pg_resetxlog/README.pg_resetxlog
+0
-42
contrib/pg_resetxlog/pg_resetxlog.c
contrib/pg_resetxlog/pg_resetxlog.c
+0
-611
doc/src/sgml/ref/pg_controldata.sgml
doc/src/sgml/ref/pg_controldata.sgml
+3
-2
src/bin/pg_controldata/Makefile
src/bin/pg_controldata/Makefile
+2
-2
No files found.
contrib/pg_resetxlog/Makefile
deleted
100644 → 0
View file @
a208ea72
# $Header: /cvsroot/pgsql/contrib/pg_resetxlog/Attic/Makefile,v 1.6 2002/07/27 20:10:03 petere Exp $
subdir
=
contrib/pg_resetxlog
top_builddir
=
../..
include
$(top_builddir)/src/Makefile.global
all
:
submake-libpgport
PROGRAM
=
pg_resetxlog
OBJS
=
pg_resetxlog.o pg_crc.o
pg_crc.c
:
$(top_srcdir)/src/backend/utils/hash/pg_crc.c
rm
-f
$@
&&
$(LN_S)
$<
.
EXTRA_CLEAN
=
pg_crc.c
DOCS
=
README.pg_resetxlog
include
$(top_srcdir)/contrib/contrib-global.mk
contrib/pg_resetxlog/README.pg_resetxlog
deleted
100644 → 0
View file @
a208ea72
pg_resetxlog is a program to clear the WAL transaction log (stored in
$PGDATA/pg_xlog/), replacing whatever had been in it with just a dummy
shutdown-checkpoint record. It also regenerates the pg_control file
if necessary.
THIS PROGRAM WILL DESTROY VALUABLE LOG DATA!!! Don't run it unless you
really need it!!!
pg_resetxlog is primarily intended for disaster recovery --- that is,
if your pg_control and/or xlog are hosed badly enough that Postgres refuses
to start up, this program will get you past that problem and let you get to
your data files. But realize that without the xlog, your data files may be
corrupt due to partially-applied transactions, incomplete index-file
updates, etc. You should dump your data, check it for accuracy, then initdb
and reload.
A secondary purpose is to cope with xlog format changes without requiring
initdb. To use pg_resetxlog for this purpose, just be sure that you have
cleanly shut down your old postmaster (if you're not sure, see the contrib
module pg_controldata and run it to be sure the DB state is SHUTDOWN).
Then run pg_resetxlog, and finally install and start the new version of
the database software.
A tertiary purpose is its use by pg_upgrade to set the next transaction
id and checkpoint location in pg_control.
To run the program, make sure your postmaster is not running, then
(as the Postgres admin user) do
pg_resetxlog $PGDATA
As a safety measure, the target data directory must be specified on the
command line, it cannot be defaulted.
If pg_resetxlog complains that it can't reconstruct valid data for pg_control,
you can force it to invent plausible data values with
pg_resetxlog -f $PGDATA
If this turns out to be necessary then you *definitely* should plan on
immediate dump, initdb, reload --- any modifications you do to the database
after "pg_resetxlog -f" would be likely to corrupt things even worse.
contrib/pg_resetxlog/pg_resetxlog.c
deleted
100644 → 0
View file @
a208ea72
This diff is collapsed.
Click to expand it.
doc/src/sgml/ref/pg_controldata.sgml
View file @
6945ea34
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_controldata.sgml,v 1.
2 2002/08/16 20:36:25
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_controldata.sgml,v 1.
3 2002/08/17 02:43:08
momjian Exp $
PostgreSQL documentation
-->
...
...
@@ -33,7 +33,8 @@ PostgreSQL documentation
</para>
<para>
This utility may only be run by the user who installed the server.
This utility may only be run by the user who installed the server because
it requires read access to the <literal>datadir</>.
You can specify the data directory on the command line, or use
the environment variable <envar>PGDATA</>.
</para>
...
...
src/bin/pg_controldata/Makefile
View file @
6945ea34
...
...
@@ -4,7 +4,7 @@
#
# Copyright (c) 1998, PostgreSQL Global Development Group
#
# $Header: /cvsroot/pgsql/src/bin/pg_controldata/Makefile,v 1.
1 2002/08/16 20:34:06
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_controldata/Makefile,v 1.
2 2002/08/17 02:43:08
momjian Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -17,7 +17,7 @@ OBJS= pg_controldata.o pg_crc.o
pg_crc.c
:
$(top_builddir)/src/backend/utils/hash/pg_crc.c
rm
-f
$@
&&
$(LN_S)
$<
.
all
:
submake-libp
q submake-libp
gport pg_controldata
all
:
submake-libpgport pg_controldata
pg_controldata
:
$(OBJS)
$(CC)
$(CFLAGS)
$^
$(libpq)
$(LDFLAGS)
$(LIBS)
-o
$@
...
...
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