From 5e45211a64149b3c659b90ff2de6fa982a5a93ed Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Sat, 4 May 2024 14:17:33 +0200
Subject: Adding upstream version 15.5.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 contrib/btree_gist/sql/cash.sql | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 contrib/btree_gist/sql/cash.sql

(limited to 'contrib/btree_gist/sql/cash.sql')

diff --git a/contrib/btree_gist/sql/cash.sql b/contrib/btree_gist/sql/cash.sql
new file mode 100644
index 0000000..4526cc4
--- /dev/null
+++ b/contrib/btree_gist/sql/cash.sql
@@ -0,0 +1,37 @@
+-- money check
+
+CREATE TABLE moneytmp (a money);
+
+\copy moneytmp from 'data/cash.data'
+
+SET enable_seqscan=on;
+
+SELECT count(*) FROM moneytmp WHERE a <  '22649.64';
+
+SELECT count(*) FROM moneytmp WHERE a <= '22649.64';
+
+SELECT count(*) FROM moneytmp WHERE a  = '22649.64';
+
+SELECT count(*) FROM moneytmp WHERE a >= '22649.64';
+
+SELECT count(*) FROM moneytmp WHERE a >  '22649.64';
+
+SELECT a, a <-> '21472.79' FROM moneytmp ORDER BY a <-> '21472.79' LIMIT 3;
+
+CREATE INDEX moneyidx ON moneytmp USING gist ( a );
+
+SET enable_seqscan=off;
+
+SELECT count(*) FROM moneytmp WHERE a <  '22649.64'::money;
+
+SELECT count(*) FROM moneytmp WHERE a <= '22649.64'::money;
+
+SELECT count(*) FROM moneytmp WHERE a  = '22649.64'::money;
+
+SELECT count(*) FROM moneytmp WHERE a >= '22649.64'::money;
+
+SELECT count(*) FROM moneytmp WHERE a >  '22649.64'::money;
+
+EXPLAIN (COSTS OFF)
+SELECT a, a <-> '21472.79' FROM moneytmp ORDER BY a <-> '21472.79' LIMIT 3;
+SELECT a, a <-> '21472.79' FROM moneytmp ORDER BY a <-> '21472.79' LIMIT 3;
-- 
cgit v1.2.3

