In hashset/test/sql/order.sql, can we add the following to test
whether the optimizer
will use our index.

CREATE INDEX  ON test_int4hashset_order (int4hashset_col
 int4hashset_btree_ops);

-- to make sure that this work with just two rows
SET enable_seqscan TO off;

explain(costs off) SELECT * FROM test_int4hashset_order WHERE
int4hashset_col = '{1,2}'::int4hashset;
reset enable_seqscan;

Since most contrib modules, one module, only one test file, maybe we need
to consolidate all the test sql files to one sql file (int4hashset.sql)?
--------------
I didn't install the extension directly. I copied the hashset--0.0.1.sql to
another place, using gcc to compile these functions.
gcc -I/home/jian/postgres/2023_05_25_beta5421/include/server -fPIC -c
/home/jian/hashset/hashset.c
gcc -shared  -o /home/jian/hashset/hashset.so /home/jian/hashset/hashset.o
then modify hashset--0.0.1.sql  then in psql  \i fullsqlfilename to create
these functions, types.

Because even make
PG_CONFIG=/home/jian/postgres/2023_05_25_beta5421/bin/pg_config still has
an error.
 fatal error: libpq-fe.h: No such file or directory
    3 | #include <libpq-fe.h>

Is there any way to put test_send_recv.c to sql test file?
Attached is a patch slightly modified README.md. feel free to change, since
i am not native english speaker...
From 2bb310affed4a06c6fa38fb0e1b1ff39f330d88d Mon Sep 17 00:00:00 2001
From: pgaddict <jian.universal...@gmail.com>
Date: Thu, 15 Jun 2023 15:50:00 +0800
Subject: [PATCH] add instruction using PG_CONFIG to install extension, also
 how to run installcheck

---
 README.md | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 3ff57576..30c66667 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 # hashset
 
 This PostgreSQL extension implements hashset, a data structure (type)
-providing a collection of integer items with fast lookup.
+providing a collection of unique, not null integer items with fast lookup.
 
 
 ## Version
@@ -103,11 +103,19 @@ a variable-length type.
 
 ## Installation
 
-To install the extension, run `make install` in the project root. Then, in your
+To install the extension, run `make install` in the project root. To use a different PostgreSQL installation, point configure to a different `pg_config`, using following command:         
+
+    make PG_CONFIG=/else/where/pg_config
+    make install PG_CONFIG=/else/where/pg_config
+
+Then, in your
 PostgreSQL connection, execute `CREATE EXTENSION hashset;`.
 
 This extension requires PostgreSQL version ?.? or later.
 
+## Test
+To run regression test, execute
+`make installcheck`
 
 ## License
 
-- 
2.34.1

Reply via email to