aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/chkpass/.gitignore4
-rw-r--r--contrib/chkpass/Makefile2
-rw-r--r--contrib/chkpass/expected/chkpass.out18
-rw-r--r--contrib/chkpass/sql/chkpass.sql7
4 files changed, 31 insertions, 0 deletions
diff --git a/contrib/chkpass/.gitignore b/contrib/chkpass/.gitignore
new file mode 100644
index 00000000000..5dcb3ff9723
--- /dev/null
+++ b/contrib/chkpass/.gitignore
@@ -0,0 +1,4 @@
+# Generated subdirectories
+/log/
+/results/
+/tmp_check/
diff --git a/contrib/chkpass/Makefile b/contrib/chkpass/Makefile
index a2599ea2393..dbecc3360be 100644
--- a/contrib/chkpass/Makefile
+++ b/contrib/chkpass/Makefile
@@ -9,6 +9,8 @@ PGFILEDESC = "chkpass - encrypted password data type"
SHLIB_LINK = $(filter -lcrypt, $(LIBS))
+REGRESS = chkpass
+
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
diff --git a/contrib/chkpass/expected/chkpass.out b/contrib/chkpass/expected/chkpass.out
new file mode 100644
index 00000000000..b53557bf2af
--- /dev/null
+++ b/contrib/chkpass/expected/chkpass.out
@@ -0,0 +1,18 @@
+CREATE EXTENSION chkpass;
+WARNING: type input function chkpass_in should not be volatile
+CREATE TABLE test (i int, p chkpass);
+INSERT INTO test VALUES (1, 'hello'), (2, 'goodbye');
+SELECT i, p = 'hello' AS "hello?" FROM test;
+ i | hello?
+---+--------
+ 1 | t
+ 2 | f
+(2 rows)
+
+SELECT i, p <> 'hello' AS "!hello?" FROM test;
+ i | !hello?
+---+---------
+ 1 | f
+ 2 | t
+(2 rows)
+
diff --git a/contrib/chkpass/sql/chkpass.sql b/contrib/chkpass/sql/chkpass.sql
new file mode 100644
index 00000000000..595683e249a
--- /dev/null
+++ b/contrib/chkpass/sql/chkpass.sql
@@ -0,0 +1,7 @@
+CREATE EXTENSION chkpass;
+
+CREATE TABLE test (i int, p chkpass);
+INSERT INTO test VALUES (1, 'hello'), (2, 'goodbye');
+
+SELECT i, p = 'hello' AS "hello?" FROM test;
+SELECT i, p <> 'hello' AS "!hello?" FROM test;