Updates for latest Postgres 9.2 sources.
We no longer need pg_crc.c, and hence not a source tree, yay.
This commit is contained in:
parent
883c674f6f
commit
4f71071d5b
23
Makefile
23
Makefile
@ -1,32 +1,27 @@
|
|||||||
# View README.pg_filedump first
|
# View README.pg_filedump first
|
||||||
|
|
||||||
# note this must match macro in pg_filedump.h
|
# note this must match version macros in pg_filedump.h
|
||||||
FD_VERSION=9.1.0
|
FD_VERSION=9.2.0
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS=-g -O -Wall -Wmissing-prototypes -Wmissing-declarations
|
CFLAGS=-g -O -Wall -Wmissing-prototypes -Wmissing-declarations
|
||||||
|
|
||||||
# PGSQL MUST POINT TO pgsql SOURCE DIRECTORY
|
# If working with a PG source directory, point PGSQL_INCLUDE_DIR to its
|
||||||
PGSQL=../../pgsql
|
# src/include subdirectory. If working with an installed tree, point to
|
||||||
|
# the server include subdirectory, eg /usr/local/include/postgresql/server
|
||||||
|
PGSQL_INCLUDE_DIR=../../pgsql/src/include
|
||||||
|
|
||||||
CRC_SRC_DIR=${PGSQL}/src/backend/utils/hash
|
|
||||||
|
|
||||||
INCLUDE_DIR=${PGSQL}/src/include
|
|
||||||
|
|
||||||
DISTFILES= README.pg_filedump Makefile Makefile.contrib \
|
DISTFILES= README.pg_filedump Makefile Makefile.contrib \
|
||||||
pg_filedump.h pg_filedump.c
|
pg_filedump.h pg_filedump.c
|
||||||
|
|
||||||
|
|
||||||
all: pg_filedump
|
all: pg_filedump
|
||||||
|
|
||||||
pg_filedump: pg_filedump.o pg_crc.o
|
pg_filedump: pg_filedump.o
|
||||||
${CC} ${CFLAGS} -o pg_filedump pg_filedump.o pg_crc.o
|
${CC} ${CFLAGS} -o pg_filedump pg_filedump.o
|
||||||
|
|
||||||
pg_filedump.o: pg_filedump.c
|
pg_filedump.o: pg_filedump.c
|
||||||
${CC} ${CFLAGS} -I${INCLUDE_DIR} pg_filedump.c -c
|
${CC} ${CFLAGS} -I${PGSQL_INCLUDE_DIR} pg_filedump.c -c
|
||||||
|
|
||||||
pg_crc.o: ${CRC_SRC_DIR}/pg_crc.c
|
|
||||||
${CC} ${CFLAGS} -I${INCLUDE_DIR} ${CRC_SRC_DIR}/pg_crc.c -c
|
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
rm -rf pg_filedump-${FD_VERSION} pg_filedump-${FD_VERSION}.tar.gz
|
rm -rf pg_filedump-${FD_VERSION} pg_filedump-${FD_VERSION}.tar.gz
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
PROGRAM = pg_filedump
|
PROGRAM = pg_filedump
|
||||||
OBJS = pg_filedump.o pg_crc.o
|
OBJS = pg_filedump.o
|
||||||
|
|
||||||
EXTRA_CLEAN = pg_crc.c
|
|
||||||
|
|
||||||
DOCS = README.pg_filedump
|
DOCS = README.pg_filedump
|
||||||
|
|
||||||
@ -15,6 +13,3 @@ top_builddir = ../..
|
|||||||
include $(top_builddir)/src/Makefile.global
|
include $(top_builddir)/src/Makefile.global
|
||||||
include $(top_srcdir)/contrib/contrib-global.mk
|
include $(top_srcdir)/contrib/contrib-global.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
|
|
||||||
rm -f $@ && $(LN_S) $< .
|
|
||||||
|
@ -2,7 +2,7 @@ pg_filedump - Display formatted contents of a PostgreSQL heap, index,
|
|||||||
or control file.
|
or control file.
|
||||||
|
|
||||||
Copyright (c) 2002-2010 Red Hat, Inc.
|
Copyright (c) 2002-2010 Red Hat, Inc.
|
||||||
Copyright (c) 2011, PostgreSQL Global Development Group
|
Copyright (c) 2011-2012, PostgreSQL Global Development Group
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -36,22 +36,24 @@ corrupt, you need a method of forcing a block size.
|
|||||||
Compile/Installation:
|
Compile/Installation:
|
||||||
|
|
||||||
To compile pg_filedump, you will need to have a properly configured
|
To compile pg_filedump, you will need to have a properly configured
|
||||||
PostgreSQL source tree for the appropriate PostgreSQL major version.
|
PostgreSQL source tree or complete install tree (with include files)
|
||||||
|
of the appropriate PostgreSQL major version.
|
||||||
|
|
||||||
There are two makefiles included in this package. Makefile is a
|
There are two makefiles included in this package. Makefile is a standalone
|
||||||
standalone makefile for pg_filedump. Alter the PGSQL variable to point
|
makefile for pg_filedump. Alter its PGSQL_INCLUDE_DIR variable to point to
|
||||||
to the PostgreSQL source tree. Makefile.contrib can be used if this
|
the PostgreSQL include files. Makefile.contrib can be used if this package
|
||||||
package was untarred in the contrib directory of a PostgreSQL build tree.
|
was untarred in the contrib directory of a PostgreSQL build tree.
|
||||||
|
|
||||||
make
|
make
|
||||||
make install (if in the contrib directory)
|
make install (if using Makefile.contrib)
|
||||||
|
|
||||||
It is also possible to use Makefile.contrib without being in the contrib
|
It is also possible to use Makefile.contrib without being in the contrib
|
||||||
directory:
|
directory:
|
||||||
|
|
||||||
make -f Makefile.contrib USE_PGXS=1
|
make -f Makefile.contrib USE_PGXS=1
|
||||||
|
|
||||||
This will not eliminate the need to have a complete source tree, though.
|
This method requires that the pg_config program be in your PATH, but should
|
||||||
|
not require any manual adjustments of the Makefile.
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
@ -85,3 +87,6 @@ The following options are valid for control files:
|
|||||||
-c Interpret the file listed as a control file
|
-c Interpret the file listed as a control file
|
||||||
-f Display formatted content dump along with interpretation
|
-f Display formatted content dump along with interpretation
|
||||||
-S Force block size to [blocksize]
|
-S Force block size to [blocksize]
|
||||||
|
|
||||||
|
In most cases it's recommended to use the -i and -f options to get
|
||||||
|
the most useful dump output.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* formatting heap (data), index and control files.
|
* formatting heap (data), index and control files.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2010 Red Hat, Inc.
|
* Copyright (c) 2002-2010 Red Hat, Inc.
|
||||||
* Copyright (c) 2011, PostgreSQL Global Development Group
|
* Copyright (c) 2011-2012, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include "pg_filedump.h"
|
#include "pg_filedump.h"
|
||||||
|
|
||||||
|
#include "utils/pg_crc_tables.h"
|
||||||
|
|
||||||
// Global variables for ease of use mostly
|
// Global variables for ease of use mostly
|
||||||
static FILE *fp = NULL; // File to dump or format
|
static FILE *fp = NULL; // File to dump or format
|
||||||
static char *fileName = NULL; // File name for display
|
static char *fileName = NULL; // File name for display
|
||||||
@ -62,7 +64,7 @@ DisplayOptions (unsigned int validOptions)
|
|||||||
printf
|
printf
|
||||||
("\nVersion %s (for %s)"
|
("\nVersion %s (for %s)"
|
||||||
"\nCopyright (c) 2002-2010 Red Hat, Inc."
|
"\nCopyright (c) 2002-2010 Red Hat, Inc."
|
||||||
"\nCopyright (c) 2011, PostgreSQL Global Development Group\n",
|
"\nCopyright (c) 2011-2012, PostgreSQL Global Development Group\n",
|
||||||
FD_VERSION, FD_PG_VERSION);
|
FD_VERSION, FD_PG_VERSION);
|
||||||
|
|
||||||
printf
|
printf
|
||||||
@ -1169,6 +1171,8 @@ FormatSpecial ()
|
|||||||
strcat (flagString, "DELETED|");
|
strcat (flagString, "DELETED|");
|
||||||
if (spgistSection->flags & SPGIST_LEAF)
|
if (spgistSection->flags & SPGIST_LEAF)
|
||||||
strcat (flagString, "LEAF|");
|
strcat (flagString, "LEAF|");
|
||||||
|
if (spgistSection->flags & SPGIST_NULLS)
|
||||||
|
strcat (flagString, "NULLS|");
|
||||||
if (strlen (flagString))
|
if (strlen (flagString))
|
||||||
flagString[strlen (flagString) - 1] = '\0';
|
flagString[strlen (flagString) - 1] = '\0';
|
||||||
printf (" SPGIST Index Section:\n"
|
printf (" SPGIST Index Section:\n"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* formatting heap (data), index and control files.
|
* formatting heap (data), index and control files.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2010 Red Hat, Inc.
|
* Copyright (c) 2002-2010 Red Hat, Inc.
|
||||||
* Copyright (c) 2011, PostgreSQL Global Development Group
|
* Copyright (c) 2011-2012, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
Loading…
x
Reference in New Issue
Block a user