Update for Postgres 9.1; add knowledge of some more flag bits;
improve Makefile to be able to build a release tarball.
This commit is contained in:
		
							
								
								
									
										14
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,5 +1,8 @@ | |||||||
| # View README.pg_filedump first | # View README.pg_filedump first | ||||||
|  |  | ||||||
|  | # note this must match macro in pg_filedump.h | ||||||
|  | FD_VERSION=9.1.0 | ||||||
|  |  | ||||||
| CC=gcc | CC=gcc | ||||||
| CFLAGS=-g -O -Wall -Wmissing-prototypes -Wmissing-declarations | CFLAGS=-g -O -Wall -Wmissing-prototypes -Wmissing-declarations | ||||||
|  |  | ||||||
| @ -10,6 +13,10 @@ CRC_SRC_DIR=${PGSQL}/src/backend/utils/hash | |||||||
|  |  | ||||||
| INCLUDE_DIR=${PGSQL}/src/include | INCLUDE_DIR=${PGSQL}/src/include | ||||||
|  |  | ||||||
|  | DISTFILES= README.pg_filedump Makefile Makefile.contrib \ | ||||||
|  | 	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 pg_crc.o  | ||||||
| @ -21,5 +28,12 @@ pg_filedump.o: pg_filedump.c | |||||||
| pg_crc.o: ${CRC_SRC_DIR}/pg_crc.c | pg_crc.o: ${CRC_SRC_DIR}/pg_crc.c | ||||||
| 	${CC} ${CFLAGS} -I${INCLUDE_DIR} ${CRC_SRC_DIR}/pg_crc.c -c  | 	${CC} ${CFLAGS} -I${INCLUDE_DIR} ${CRC_SRC_DIR}/pg_crc.c -c  | ||||||
|  |  | ||||||
|  | dist: | ||||||
|  | 	rm -rf pg_filedump-${FD_VERSION} pg_filedump-${FD_VERSION}.tar.gz | ||||||
|  | 	mkdir pg_filedump-${FD_VERSION} | ||||||
|  | 	cp -p ${DISTFILES} pg_filedump-${FD_VERSION} | ||||||
|  | 	tar cfz pg_filedump-${FD_VERSION}.tar.gz pg_filedump-${FD_VERSION} | ||||||
|  | 	rm -rf pg_filedump-${FD_VERSION} | ||||||
|  |  | ||||||
| clean: | clean: | ||||||
| 	rm -f *.o pg_filedump | 	rm -f *.o pg_filedump | ||||||
|  | |||||||
| @ -583,6 +583,8 @@ FormatHeader (Page page) | |||||||
| 	  strcat (flagString, "HAS_FREE_LINES|"); | 	  strcat (flagString, "HAS_FREE_LINES|"); | ||||||
|       if (pageHeader->pd_flags & PD_PAGE_FULL) |       if (pageHeader->pd_flags & PD_PAGE_FULL) | ||||||
| 	  strcat (flagString, "PAGE_FULL|"); | 	  strcat (flagString, "PAGE_FULL|"); | ||||||
|  |       if (pageHeader->pd_flags & PD_ALL_VISIBLE) | ||||||
|  | 	  strcat (flagString, "ALL_VISIBLE|"); | ||||||
|       if (strlen (flagString)) |       if (strlen (flagString)) | ||||||
| 	  flagString[strlen (flagString) - 1] = '\0'; | 	  flagString[strlen (flagString) - 1] = '\0'; | ||||||
|  |  | ||||||
| @ -1000,6 +1002,8 @@ FormatSpecial () | |||||||
| 	  strcat (flagString, "DELETED|"); | 	  strcat (flagString, "DELETED|"); | ||||||
| 	if (gistSection->flags & F_TUPLES_DELETED) | 	if (gistSection->flags & F_TUPLES_DELETED) | ||||||
| 	  strcat (flagString, "TUPLES_DELETED|"); | 	  strcat (flagString, "TUPLES_DELETED|"); | ||||||
|  | 	if (gistSection->flags & F_FOLLOW_RIGHT) | ||||||
|  | 	  strcat (flagString, "FOLLOW_RIGHT|"); | ||||||
| 	if (strlen (flagString)) | 	if (strlen (flagString)) | ||||||
| 	  flagString[strlen (flagString) - 1] = '\0'; | 	  flagString[strlen (flagString) - 1] = '\0'; | ||||||
| 	printf (" GIST Index Section:\n" | 	printf (" GIST Index Section:\n" | ||||||
| @ -1022,6 +1026,12 @@ FormatSpecial () | |||||||
| 	  strcat (flagString, "LEAF|"); | 	  strcat (flagString, "LEAF|"); | ||||||
| 	if (ginSection->flags & GIN_DELETED) | 	if (ginSection->flags & GIN_DELETED) | ||||||
| 	  strcat (flagString, "DELETED|"); | 	  strcat (flagString, "DELETED|"); | ||||||
|  | 	if (ginSection->flags & GIN_META) | ||||||
|  | 	  strcat (flagString, "META|"); | ||||||
|  | 	if (ginSection->flags & GIN_LIST) | ||||||
|  | 	  strcat (flagString, "LIST|"); | ||||||
|  | 	if (ginSection->flags & GIN_LIST_FULLROW) | ||||||
|  | 	  strcat (flagString, "FULLROW|"); | ||||||
| 	if (strlen (flagString)) | 	if (strlen (flagString)) | ||||||
| 	  flagString[strlen (flagString) - 1] = '\0'; | 	  flagString[strlen (flagString) - 1] = '\0'; | ||||||
| 	printf (" GIN Index Section:\n" | 	printf (" GIN Index Section:\n" | ||||||
|  | |||||||
| @ -22,8 +22,8 @@ | |||||||
|  * Original Author: Patrick Macdonald <patrickm@redhat.com>  |  * Original Author: Patrick Macdonald <patrickm@redhat.com>  | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #define FD_VERSION	"9.0.0"			/* version ID of pg_filedump */ | #define FD_VERSION	"9.1.0"			/* version ID of pg_filedump */ | ||||||
| #define FD_PG_VERSION	"PostgreSQL 9.0.x"	/* PG version it works with */ | #define FD_PG_VERSION	"PostgreSQL 9.1.x"	/* PG version it works with */ | ||||||
|  |  | ||||||
| #include "postgres.h" | #include "postgres.h" | ||||||
|  |  | ||||||
| @ -31,6 +31,7 @@ | |||||||
| #include <ctype.h> | #include <ctype.h> | ||||||
|  |  | ||||||
| #include "access/gin.h" | #include "access/gin.h" | ||||||
|  | #include "access/gin_private.h" | ||||||
| #include "access/gist.h" | #include "access/gist.h" | ||||||
| #include "access/hash.h" | #include "access/hash.h" | ||||||
| #include "access/htup.h" | #include "access/htup.h" | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user