aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/collate.sql
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-04-14 17:30:13 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-04-14 17:30:36 -0400
commit2d59643dbccaf73bc1f90875ea02dcad641379cd (patch)
tree6e7f3825a1532e50708ac693e1066e9f5ad0e5ab /src/test/regress/sql/collate.sql
parent0516f94d18c57cc5dce72ff8fb84a05d24a67063 (diff)
downloadpostgresql-2d59643dbccaf73bc1f90875ea02dcad641379cd.tar.gz
postgresql-2d59643dbccaf73bc1f90875ea02dcad641379cd.zip
Account for collation when coercing the output of a SQL function.
Commit 913bbd88d overlooked that the result of coerce_to_target_type might need collation fixups. Per report from Andreas Joseph Krogh. Discussion: https://postgr.es/m/VisenaEmail.72.37d08ec2b8cb8fb5.17179940cd3@tc7-visena
Diffstat (limited to 'src/test/regress/sql/collate.sql')
-rw-r--r--src/test/regress/sql/collate.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/regress/sql/collate.sql b/src/test/regress/sql/collate.sql
index 89de26a227e..82f9c855b88 100644
--- a/src/test/regress/sql/collate.sql
+++ b/src/test/regress/sql/collate.sql
@@ -177,6 +177,14 @@ SELECT a, CAST(b AS varchar) FROM collate_test1 ORDER BY 2;
SELECT a, CAST(b AS varchar) FROM collate_test2 ORDER BY 2;
+-- result of a SQL function
+
+CREATE FUNCTION vc (text) RETURNS text LANGUAGE sql
+ AS 'select $1::varchar';
+
+SELECT a, b FROM collate_test1 ORDER BY a, vc(b);
+
+
-- polymorphism
SELECT * FROM unnest((SELECT array_agg(b ORDER BY b) FROM collate_test1)) ORDER BY 1;