Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
833f9cb7
Commit
833f9cb7
authored
Jan 09, 2007
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pltcl regression test needs to actually create an opclass, not just one operator.
parent
44317582
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
0 deletions
+131
-0
src/pl/tcl/expected/pltcl_setup.out
src/pl/tcl/expected/pltcl_setup.out
+61
-0
src/pl/tcl/sql/pltcl_setup.sql
src/pl/tcl/sql/pltcl_setup.sql
+70
-0
No files found.
src/pl/tcl/expected/pltcl_setup.out
View file @
833f9cb7
...
...
@@ -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) ;
src/pl/tcl/sql/pltcl_setup.sql
View file @
833f9cb7
...
...
@@ -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
)
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment