05/XX/2011 Cédric Villemain <cedric@villemain.org>
- * 0.9.0 - Output varbit containing vector information with pgfincore*()
+ * 1.0.0 - Output varbit containing vector information with pgfincore*()
- Add Debian packaging (Dimitri Fontaine)
- Update to work with PostgreSQL >= 9.1 (Jeff Janes)
- Add total number of pages of memory with pgsysconf()
- pgfadvise_loader() to restore file status (pages in/out cache)
- pgfincore*() to handle mincore usage
- pgsysconf*() to handle sysconf information
+ - Use get_call_result_type() to build the tuple descriptor (suggested
+ by RhodiumToad on IRC)
+ - Remove limitation of usage on temp tables
+ - Improve 9.1 installation (Extension)
04/30/2010 Cédric Villemain <cedric@villemain.org>
-PKGNAME = pgfincore
+EXTENSION = pgfincore
+
+EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
+ sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
+
+MODULES = $(EXTENSION)
+DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
+DOCS = doc/README.$(EXTENSION).rst
+# TESTS = $(wildcard test/sql/*.sql)
+# REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
+# REGRESS_OPTS = --inputdir=test --load-language=plpgsql
+
+ifndef PG_CONFIG
+PG_CONFIG = pg_config
+endif
+
+PG91 = $(shell $(PG_CONFIG) --version | grep -qE "8\.|9\.0" && echo no || echo yes)
+
+ifeq ($(PG91),yes)
+all: sql/$(EXTENSION)--$(EXTVERSION).sql
+
+sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
+ cp $< $@
+
+DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
+EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql
+endif
+
+PGXS := $(shell $(PG_CONFIG) --pgxs)
+include $(PGXS)
+
+PKGNAME = $(EXTENSION)
PKGVERS = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
DEBDIR = /tmp/$(PKGNAME)
ARCHIVE= $(DEBDIR)/export/$(PKGNAME)-$(PKGVERS).tar.gz
DEBEXTS= {gz,changes,build,dsc}
-MODULES = pgfincore
-DATA_built = pgfincore.sql uninstall_pgfincore.sql
-DOCS = README.pgfincore
-
-PG_CONFIG ?= pg_config
-PGXS = $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-
-deb:
- # working copy from where to make the .orig archive
- rm -rf $(DEBDIR)
+deb: # working copy from where to make the .orig archive
+ rm -rf $(DEBDIR)
mkdir -p $(DEBDIR)/$(PKGNAME)-$(PKGVERS)
- mkdir -p $(EXPORT)
- rsync -Ca . $(EXPORT)
-
- # get rid of temp and build files
- for n in ".#*" "*~" "build-stamp" "configure-stamp" "prefix.sql" "prefix.so"; do \
- find $(EXPORT) -name "$$n" -print0|xargs -0 rm -f; \
- done
+ mkdir -p $(EXPORT)/sql $(EXPORT)/doc
+ cp Makefile $(EXPORT)/
+ cp sql/* $(EXPORT)/sql
+ cp $(DOCS) $(EXPORT)/doc
+ cp $(MODULES).c $(EXPORT)/
+ rsync -Ca debian $(EXPORT)/
# prepare the .orig without the debian/ packaging stuff
rsync -Ca $(EXPORT) $(DEBDIR)
--- /dev/null
+# pgfincore extension
+comment = 'examine and manage the os buffer cache'
+default_version = '1.0'
+module_pathname = '$libdir/pgfincore'
+relocatable = true
--- /dev/null
+
+ALTER EXTENSION pgfincore ADD FUNCTION pgsysconf_pretty();
+ALTER EXTENSION pgfincore ADD FUNCTION pgsysconf();
+
+ALTER EXTENSION pgfincore ADD FUNCTION pgfadvise_willneed(regclass);
+ALTER EXTENSION pgfincore ADD FUNCTION pgfadvise_dontneed(regclass);
+ALTER EXTENSION pgfincore ADD FUNCTION pgfadvise_normal(regclass);
+ALTER EXTENSION pgfincore ADD FUNCTION pgfadvise_sequential(regclass);
+ALTER EXTENSION pgfincore ADD FUNCTION pgfadvise_random(regclass);
+ALTER EXTENSION pgfincore ADD FUNCTION pgfadvise(regclass, text, int);
+
+ALTER EXTENSION pgfincore ADD FUNCTION pgfadvise_loader(regclass, text, int, bool, bool, varbit);
+ALTER EXTENSION pgfincore ADD FUNCTION pgfadvise_loader(regclass, int, bool, bool, varbit);
+
+ALTER EXTENSION pgfincore ADD FUNCTION pgfincore(regclass);
+ALTER EXTENSION pgfincore ADD FUNCTION pgfincore(regclass, bool);
+ALTER EXTENSION pgfincore ADD FUNCTION pgfincore(regclass, text, bool);
+
-SET search_path = public;
-
--
-- SYSCONF
--
OUT os_pages_free bigint,
OUT os_total_pages bigint)
RETURNS record
-AS 'MODULE_PATHNAME'
+AS '$libdir/pgfincore'
LANGUAGE C;
CREATE OR REPLACE FUNCTION
OUT rel_os_pages bigint,
OUT os_pages_free bigint)
RETURNS setof record
-AS 'MODULE_PATHNAME'
+AS '$libdir/pgfincore'
LANGUAGE C;
CREATE OR REPLACE FUNCTION
OUT pages_loaded bigint,
OUT pages_unloaded bigint)
RETURNS setof record
-AS 'MODULE_PATHNAME'
+AS '$libdir/pgfincore'
LANGUAGE C;
CREATE OR REPLACE FUNCTION
OUT os_pages_free bigint,
OUT databit varbit)
RETURNS setof record
-AS 'MODULE_PATHNAME'
+AS '$libdir/pgfincore'
LANGUAGE C;
CREATE OR REPLACE FUNCTION
-
-SET search_path = public;
-
DROP FUNCTION pgsysconf_pretty();
DROP FUNCTION pgsysconf();