summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/create_operator.out7
-rw-r--r--src/test/regress/expected/polymorphism.out67
-rw-r--r--src/test/regress/sql/create_operator.sql2
-rw-r--r--src/test/regress/sql/polymorphism.sql16
4 files changed, 88 insertions, 4 deletions
diff --git a/src/test/regress/expected/create_operator.out b/src/test/regress/expected/create_operator.out
index 2e6c764ee18..3a216c2ca8f 100644
--- a/src/test/regress/expected/create_operator.out
+++ b/src/test/regress/expected/create_operator.out
@@ -29,13 +29,14 @@ CREATE OPERATOR #%# (
-- Test comments
COMMENT ON OPERATOR ###### (int4, NONE) IS 'bad right unary';
ERROR: operator does not exist: integer ######
--- Show deprecated message. => is deprecated now
+-- => is disallowed now
CREATE OPERATOR => (
leftarg = int8, -- right unary
procedure = numeric_fac
);
-WARNING: => is deprecated as an operator name
-DETAIL: This name may be disallowed altogether in future versions of PostgreSQL.
+ERROR: syntax error at or near "=>"
+LINE 1: CREATE OPERATOR => (
+ ^
-- Should fail. CREATE OPERATOR requires USAGE on SCHEMA
BEGIN TRANSACTION;
CREATE ROLE regress_rol_op1;
diff --git a/src/test/regress/expected/polymorphism.out b/src/test/regress/expected/polymorphism.out
index 27b28790e0f..987b3eed7d3 100644
--- a/src/test/regress/expected/polymorphism.out
+++ b/src/test/regress/expected/polymorphism.out
@@ -1356,6 +1356,73 @@ select dfunc('a'::text, 'b', flag := true); -- mixed notation
a
(1 row)
+-- ansi/sql syntax
+select dfunc(a => 1, b => 2);
+ dfunc
+-------
+ 1
+(1 row)
+
+select dfunc(a => 'a'::text, b => 'b');
+ dfunc
+-------
+ a
+(1 row)
+
+select dfunc(a => 'a'::text, b => 'b', flag => false); -- named notation
+ dfunc
+-------
+ b
+(1 row)
+
+select dfunc(b => 'b'::text, a => 'a'); -- named notation with default
+ dfunc
+-------
+ a
+(1 row)
+
+select dfunc(a => 'a'::text, flag => true); -- named notation with default
+ dfunc
+-------
+ a
+(1 row)
+
+select dfunc(a => 'a'::text, flag => false); -- named notation with default
+ dfunc
+-------
+
+(1 row)
+
+select dfunc(b => 'b'::text, a => 'a', flag => true); -- named notation
+ dfunc
+-------
+ a
+(1 row)
+
+select dfunc('a'::text, 'b', false); -- full positional notation
+ dfunc
+-------
+ b
+(1 row)
+
+select dfunc('a'::text, 'b', flag => false); -- mixed notation
+ dfunc
+-------
+ b
+(1 row)
+
+select dfunc('a'::text, 'b', true); -- full positional notation
+ dfunc
+-------
+ a
+(1 row)
+
+select dfunc('a'::text, 'b', flag => true); -- mixed notation
+ dfunc
+-------
+ a
+(1 row)
+
-- check reverse-listing of named-arg calls
CREATE VIEW dfview AS
SELECT q1, q2,
diff --git a/src/test/regress/sql/create_operator.sql b/src/test/regress/sql/create_operator.sql
index f7a372ab897..0e5d6356bc3 100644
--- a/src/test/regress/sql/create_operator.sql
+++ b/src/test/regress/sql/create_operator.sql
@@ -35,7 +35,7 @@ CREATE OPERATOR #%# (
-- Test comments
COMMENT ON OPERATOR ###### (int4, NONE) IS 'bad right unary';
--- Show deprecated message. => is deprecated now
+-- => is disallowed now
CREATE OPERATOR => (
leftarg = int8, -- right unary
procedure = numeric_fac
diff --git a/src/test/regress/sql/polymorphism.sql b/src/test/regress/sql/polymorphism.sql
index 3d8dd1e5548..72f6cb5e7cb 100644
--- a/src/test/regress/sql/polymorphism.sql
+++ b/src/test/regress/sql/polymorphism.sql
@@ -748,6 +748,22 @@ select dfunc('a'::text, 'b', flag := false); -- mixed notation
select dfunc('a'::text, 'b', true); -- full positional notation
select dfunc('a'::text, 'b', flag := true); -- mixed notation
+-- ansi/sql syntax
+select dfunc(a => 1, b => 2);
+select dfunc(a => 'a'::text, b => 'b');
+select dfunc(a => 'a'::text, b => 'b', flag => false); -- named notation
+
+select dfunc(b => 'b'::text, a => 'a'); -- named notation with default
+select dfunc(a => 'a'::text, flag => true); -- named notation with default
+select dfunc(a => 'a'::text, flag => false); -- named notation with default
+select dfunc(b => 'b'::text, a => 'a', flag => true); -- named notation
+
+select dfunc('a'::text, 'b', false); -- full positional notation
+select dfunc('a'::text, 'b', flag => false); -- mixed notation
+select dfunc('a'::text, 'b', true); -- full positional notation
+select dfunc('a'::text, 'b', flag => true); -- mixed notation
+
+
-- check reverse-listing of named-arg calls
CREATE VIEW dfview AS
SELECT q1, q2,