@@ -470,6 +470,12 @@ SELECT NULLIF('foo'::REFCURSOR, 'bar'::REFCURSOR);
470
470
statement error pgcode 42883 pq: unsupported comparison operator
471
471
SELECT NULLIF('foo'::REFCURSOR, NULL);
472
472
473
+ statement error pgcode 42883 pq: could not identify an ordering operator for type refcursor
474
+ SELECT * FROM t ORDER BY x;
475
+
476
+ statement error pgcode 42883 pq: operator does not exist: refcursor = refcursor
477
+ SELECT * FROM t INNER JOIN t t2 USING (x);
478
+
473
479
# Regression test for #112010 - REFCURSOR should allow IS NULL and
474
480
# IS NOT NULL comparisons.
475
481
subtest is_null
@@ -685,22 +691,35 @@ baz NULL baz foo
685
691
statement error pgcode 42883 pq: unknown signature
686
692
SELECT lag(y) OVER w, lead(y) OVER w, first_value(y) OVER w, last_value(y) OVER w FROM t WINDOW w AS ();
687
693
688
- # Array functions are allowed.
694
+ # Array functions are allowed (but ordering on REFCURSOR and REFCURSOR[] columns
695
+ # is not).
689
696
query TT
690
- SELECT array_agg(x ORDER BY x, y ), array_cat_agg(y ORDER BY x, y) FROM t;
697
+ SELECT array_agg(x), array_cat_agg(y) FROM t;
691
698
----
692
- {baz, foo} {bar}
699
+ {foo,baz } {bar}
693
700
694
- query TT
695
- SELECT array_append(y, x), array_prepend(x, y) FROM t ORDER BY x, y ;
701
+ query TT rowsort
702
+ SELECT array_append(y, x), array_prepend(x, y) FROM t;
696
703
----
697
704
{baz} {baz}
698
705
{bar,foo} {foo,bar}
699
706
700
- query TT
701
- SELECT array_remove(y, 'baz'), array_replace(y, 'baz', 'foo') FROM t ORDER BY x, y ;
707
+ query TT rowsort
708
+ SELECT array_remove(y, 'baz'), array_replace(y, 'baz', 'foo') FROM t;
702
709
----
703
710
{} {}
704
711
{bar} {bar}
705
712
713
+ statement error pgcode 42883 pq: could not identify an ordering operator for type refcursor
714
+ SELECT array_agg(x ORDER BY x) FROM t;
715
+
716
+ statement error pgcode 42883 pq: could not identify an ordering operator for type refcursor\[\]
717
+ SELECT array_agg(y ORDER BY y) FROM t;
718
+
719
+ statement error pgcode 42883 pq: could not identify an ordering operator for type refcursor
720
+ SELECT array_append(y, x), array_prepend(x, y) FROM t ORDER BY x;
721
+
722
+ statement error pgcode 42883 pq: could not identify an ordering operator for type refcursor\[\]
723
+ SELECT array_append(y, x), array_prepend(x, y) FROM t ORDER BY y;
724
+
706
725
subtest end
0 commit comments