aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/opr_sanity.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/sql/opr_sanity.sql')
-rw-r--r--src/test/regress/sql/opr_sanity.sql59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql
index 393acdf8c3c..5a9c4796923 100644
--- a/src/test/regress/sql/opr_sanity.sql
+++ b/src/test/regress/sql/opr_sanity.sql
@@ -18,65 +18,6 @@
-- that test creates some bogus operators...
--- Helper functions to deal with cases where binary-coercible matches are
--- allowed.
-
--- This should match IsBinaryCoercible() in parse_coerce.c.
--- It doesn't currently know about some cases, notably domains, anyelement,
--- anynonarray, anyenum, or record, but it doesn't need to (yet).
-create function binary_coercible(oid, oid) returns bool as $$
-begin
- if $1 = $2 then return true; end if;
- if EXISTS(select 1 from pg_catalog.pg_cast where
- castsource = $1 and casttarget = $2 and
- castmethod = 'b' and castcontext = 'i')
- then return true; end if;
- if $2 = 'pg_catalog.any'::pg_catalog.regtype then return true; end if;
- if $2 = 'pg_catalog.anyarray'::pg_catalog.regtype then
- if EXISTS(select 1 from pg_catalog.pg_type where
- oid = $1 and typelem != 0 and
- typsubscript = 'pg_catalog.array_subscript_handler'::pg_catalog.regproc)
- then return true; end if;
- end if;
- if $2 = 'pg_catalog.anyrange'::pg_catalog.regtype then
- if (select typtype from pg_catalog.pg_type where oid = $1) = 'r'
- then return true; end if;
- end if;
- if $2 = 'pg_catalog.anymultirange'::pg_catalog.regtype then
- if (select typtype from pg_catalog.pg_type where oid = $1) = 'm'
- then return true; end if;
- end if;
- return false;
-end
-$$ language plpgsql strict stable;
-
--- This one ignores castcontext, so it will allow cases where an explicit
--- (but still binary) cast would be required to convert the input type.
--- We don't currently use this for any tests in this file, but it is a
--- reasonable alternative definition for some scenarios.
-create function explicitly_binary_coercible(oid, oid) returns bool as $$
-begin
- if $1 = $2 then return true; end if;
- if EXISTS(select 1 from pg_catalog.pg_cast where
- castsource = $1 and casttarget = $2 and
- castmethod = 'b')
- then return true; end if;
- if $2 = 'pg_catalog.any'::pg_catalog.regtype then return true; end if;
- if $2 = 'pg_catalog.anyarray'::pg_catalog.regtype then
- if EXISTS(select 1 from pg_catalog.pg_type where
- oid = $1 and typelem != 0 and
- typsubscript = 'pg_catalog.array_subscript_handler'::pg_catalog.regproc)
- then return true; end if;
- end if;
- if $2 = 'pg_catalog.anyrange'::pg_catalog.regtype then
- if (select typtype from pg_catalog.pg_type where oid = $1) = 'r'
- then return true; end if;
- end if;
- return false;
-end
-$$ language plpgsql strict stable;
-
-
-- **************** pg_proc ****************
-- Look for illegal values in pg_proc fields.