aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-01-09 03:13:38 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-01-09 03:13:38 +0000
commit833f9cb7b8b2f740c4e91bb6c74f6b0561a06313 (patch)
tree97c23563c1e74067089f7a00faa6b09d51722ad3 /src
parent443175822942ef1f15cd047cda58990a089ef180 (diff)
downloadpostgresql-833f9cb7b8b2f740c4e91bb6c74f6b0561a06313.tar.gz
postgresql-833f9cb7b8b2f740c4e91bb6c74f6b0561a06313.zip
pltcl regression test needs to actually create an opclass, not just one operator.
Diffstat (limited to 'src')
-rw-r--r--src/pl/tcl/expected/pltcl_setup.out61
-rw-r--r--src/pl/tcl/sql/pltcl_setup.sql70
2 files changed, 131 insertions, 0 deletions
diff --git a/src/pl/tcl/expected/pltcl_setup.out b/src/pl/tcl/expected/pltcl_setup.out
index 111d999af20..ce45aec530d 100644
--- a/src/pl/tcl/expected/pltcl_setup.out
+++ b/src/pl/tcl/expected/pltcl_setup.out
@@ -434,8 +434,69 @@ create function tcl_int4lt(int4,int4) returns bool as '
}
return f
' language pltcl;
+create function tcl_int4le(int4,int4) returns bool as '
+ if {$1 <= $2} {
+ return t
+ }
+ return f
+' language pltcl;
+create function tcl_int4eq(int4,int4) returns bool as '
+ if {$1 == $2} {
+ return t
+ }
+ return f
+' language pltcl;
+create function tcl_int4ge(int4,int4) returns bool as '
+ if {$1 >= $2} {
+ return t
+ }
+ return f
+' language pltcl;
+create function tcl_int4gt(int4,int4) returns bool as '
+ if {$1 > $2} {
+ return t
+ }
+ return f
+' language pltcl;
create operator @< (
leftarg = int4,
rightarg = int4,
procedure = tcl_int4lt
);
+create operator @<= (
+ leftarg = int4,
+ rightarg = int4,
+ procedure = tcl_int4le
+ );
+create operator @= (
+ leftarg = int4,
+ rightarg = int4,
+ procedure = tcl_int4eq
+ );
+create operator @>= (
+ leftarg = int4,
+ rightarg = int4,
+ procedure = tcl_int4ge
+ );
+create operator @> (
+ leftarg = int4,
+ rightarg = int4,
+ procedure = tcl_int4gt
+ );
+create function tcl_int4cmp(int4,int4) returns int4 as '
+ if {$1 < $2} {
+ return -1
+ }
+ if {$1 > $2} {
+ return 1
+ }
+ return 0
+' language pltcl;
+CREATE OPERATOR CLASS tcl_int4_ops
+ FOR TYPE int4 USING btree AS
+ OPERATOR 1 @<,
+ OPERATOR 2 @<=,
+ OPERATOR 3 @=,
+ OPERATOR 4 @>=,
+ OPERATOR 5 @>,
+ FUNCTION 1 tcl_int4cmp(int4,int4) ;
diff --git a/src/pl/tcl/sql/pltcl_setup.sql b/src/pl/tcl/sql/pltcl_setup.sql
index 062c9f19572..b88ebbcffe3 100644
--- a/src/pl/tcl/sql/pltcl_setup.sql
+++ b/src/pl/tcl/sql/pltcl_setup.sql
@@ -472,9 +472,79 @@ create function tcl_int4lt(int4,int4) returns bool as '
return f
' language pltcl;
+create function tcl_int4le(int4,int4) returns bool as '
+ if {$1 <= $2} {
+ return t
+ }
+ return f
+' language pltcl;
+
+create function tcl_int4eq(int4,int4) returns bool as '
+ if {$1 == $2} {
+ return t
+ }
+ return f
+' language pltcl;
+
+create function tcl_int4ge(int4,int4) returns bool as '
+ if {$1 >= $2} {
+ return t
+ }
+ return f
+' language pltcl;
+
+create function tcl_int4gt(int4,int4) returns bool as '
+ if {$1 > $2} {
+ return t
+ }
+ return f
+' language pltcl;
+
create operator @< (
leftarg = int4,
rightarg = int4,
procedure = tcl_int4lt
);
+create operator @<= (
+ leftarg = int4,
+ rightarg = int4,
+ procedure = tcl_int4le
+ );
+
+create operator @= (
+ leftarg = int4,
+ rightarg = int4,
+ procedure = tcl_int4eq
+ );
+
+create operator @>= (
+ leftarg = int4,
+ rightarg = int4,
+ procedure = tcl_int4ge
+ );
+
+create operator @> (
+ leftarg = int4,
+ rightarg = int4,
+ procedure = tcl_int4gt
+ );
+
+create function tcl_int4cmp(int4,int4) returns int4 as '
+ if {$1 < $2} {
+ return -1
+ }
+ if {$1 > $2} {
+ return 1
+ }
+ return 0
+' language pltcl;
+
+CREATE OPERATOR CLASS tcl_int4_ops
+ FOR TYPE int4 USING btree AS
+ OPERATOR 1 @<,
+ OPERATOR 2 @<=,
+ OPERATOR 3 @=,
+ OPERATOR 4 @>=,
+ OPERATOR 5 @>,
+ FUNCTION 1 tcl_int4cmp(int4,int4) ;