upgrade the Makefile
authorCΓ©dric Villemain <cedric.villemain.debian@gmail.com>
Mon, 26 Oct 2009 20:13:21 +0000 (21:13 +0100)
committerCΓ©dric Villemain <cedric.villemain.debian@gmail.com>
Mon, 26 Oct 2009 20:13:21 +0000 (21:13 +0100)
ChangeLog
Makefile
README.pgfincore

index c7b15dd63e37eb937e4350b5c712f19f87d61c79..485b727765eb5203e3ebd0b889fb40c71d744fb4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+26/10/2009 CΓ©dric Villemain <cedric.villemain@dalibo.com>
+
+  * 0.3.1 - fix Makefile without PGXS
+                 - fix install doc in README
+
 12/08/2009 CΓ©dric Villemain <cedric.villemain@dalibo.com>
 
   * 0.3 - pgfincore now return a set of record
index be96bec31aa174df071640628bf2d7823966ebfe..79169313486ef811877ab16d069ef65c5b9441ec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,5 +2,13 @@ MODULES = pgfincore
 DATA_built = pgfincore.sql uninstall_pgfincore.sql
 DOCS = README.pgfincore
 
-PGXS := $(shell pg_config --pgxs)
+ifdef USE_PGXS
+PG_CONFIG = pg_config
+PGXS := $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
+else
+subdir = contrib/pgfincore
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+include $(top_srcdir)/contrib/contrib-global.mk
+endif
index d6830461b0abf04ba743f814b5ace9019032f52e..57fea39190b1380b0d1d70958bd471c2f370b7ab 100644 (file)
@@ -1,11 +1,9 @@
-Version :
-v0.3
-
 Install:
-./configure && make clean && make && sudo make install
+export USE_PGXS=1 ; make clean ; make && sudo make install
 
 Create the functions from the sql script (it should be in your contrib directory)
-
+psql mydb -f pgfincore.sql
 Debug:
 set client_min_messages TO debug5;
 
@@ -23,5 +21,22 @@ cedric=# select * from pgfincore('test');
  test    | base/16987/26245   |     262144 |       426 |         1
  test    | base/16987/26245.1 |       8090 |         0 |         0
 
+Or more fun :
+
+cedric=# with recursive pgclass (reloid,reltoastrelid) as (
+ select oid, reltoastrelid from pg_class where relname ='largetable'
+union all
+ select t.oid,t.reltoastrelid from pgclass p, pg_class t
+ where p.reltoastrelid = t.oid
+) select pgfincore(pgclass.reloid) from pgclass;
+                pgfincore
+-----------------------------------------
+ (largetable,base/16987/83603,2,0,0)
+ (pg_toast_83603,base/16987/83606,0,0,0)
+
+
+
 Enjoy ;)
 
+
+