Skip to content

Commit

Permalink
Reorganizing to fit recommended PGXN recommended structure (src/, sql…
Browse files Browse the repository at this point in the history
…/), added META.json.
  • Loading branch information
tvondra committed Nov 11, 2011
1 parent 08f5a5d commit 3a65328
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 30 deletions.
34 changes: 34 additions & 0 deletions META.json
@@ -0,0 +1,34 @@
{
"name": "pg_check",
"abstract": "Performs basic integrity checks of data files (page structure, tuple structure).",
"description": "When the database fails with a strange error and you suspect that might be caused by a data corruption, this tool might help you a it performs basic integrity checks - verifies page structure (lower/upper), placement of tuples on the page, etc.",
"version": "0.1.0",
"maintainer": "Tomas Vondra <tv@fuzzy.cz>",
"license": "bsd",
"prereqs": {
"runtime": {
"requires": {
"PostgreSQL": "9.0.0"
}
}
},
"provides": {
"pg_check": {
"file": "sql/pg_check--0.1.0.sql",
"version": "0.1.0"
},
},
"resources": {
"repository": {
"url": "https://tvondra@github.com/tvondra/pg_check.git",
"web": "http://github.com/tvondra/pg_check",
"type": "git"
}
},
"tags" : ["check", "integrity", "structure", "data", "corruption"],
"meta-spec": {
"version": "1.0.0",
"url": "http://pgxn.org/meta/spec.txt"
},
"release_status" : "testing"
}
24 changes: 8 additions & 16 deletions Makefile
@@ -1,22 +1,14 @@
#-------------------------------------------------------------------------
#
# pg_check Makefile
#
#-------------------------------------------------------------------------
MODULE_big = pg_check
OBJS = src/pg_check.o src/common.o src/heap.o src/index.o

MODULE_big = pg_check
OBJS = pg_check.o index.o heap.o common.o
DATA_built = pg_check.sql
DATA = uninstall_pg_check.sql
EXTENSION = pg_check
DATA = sql/pg_check--0.1.0.sql
MODULES = pg_check

CFLAGS=`pg_config --includedir-server`

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pg_check
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif

pg_check.so: $(OBJS)
13 changes: 10 additions & 3 deletions README
Expand Up @@ -2,11 +2,18 @@
INSTALL
-------

1. copy the directory to "contrib/" directory of the PostgreSQL (9.0) tree
This is a regular extension (9.1) or a contrib module (9.0), so it may be
installed rather easily - do either this

2. modify the "contrib/Makefile" - add the "pg_check" to SUBDIRS
$ make install
$ psql dbname -c "CREATE EXTENSION pg_check"

3. build/install just as the other contrib modules
or this (on 9.0)

$ make install
$ psql dbname < `pg_config --sharedir`/contrib/pg_check--0.1.0.sql

and the extension should be installed.


FUNCTIONS
Expand Down
4 changes: 4 additions & 0 deletions pg_check.control
@@ -0,0 +1,4 @@
# pg_check
comment = 'Provides basic integrity checks for data files.'
default_version = '0.1.0'
relocatable = true
8 changes: 4 additions & 4 deletions pg_check.sql.in → sql/pg_check--0.1.0.sql
Expand Up @@ -7,12 +7,12 @@ SET search_path = public;

CREATE OR REPLACE FUNCTION pg_check_table(regclass, bool)
RETURNS int4
AS 'MODULE_PATHNAME', 'pg_check_table'
AS '$libdir/pg_check', 'pg_check_table'
LANGUAGE C STRICT;

CREATE OR REPLACE FUNCTION pg_check_table(regclass, bigint, bigint)
RETURNS int4
AS 'MODULE_PATHNAME', 'pg_check_table_pages'
AS '$libdir/pg_check', 'pg_check_table_pages'
LANGUAGE C STRICT;

--
Expand All @@ -21,10 +21,10 @@ LANGUAGE C STRICT;

CREATE OR REPLACE FUNCTION pg_check_index(regclass)
RETURNS int4
AS 'MODULE_PATHNAME', 'pg_check_index'
AS '$libdir/pg_check', 'pg_check_index'
LANGUAGE C STRICT;

CREATE OR REPLACE FUNCTION pg_check_index(regclass, bigint, bigint)
RETURNS int4
AS 'MODULE_PATHNAME', 'pg_check_index_pages'
AS '$libdir/pg_check', 'pg_check_index_pages'
LANGUAGE C STRICT;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions uninstall_pg_check.sql

This file was deleted.

0 comments on commit 3a65328

Please sign in to comment.