Index: src/test/regress/expected/join.out
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/test/regress/expected/join.out,v
retrieving revision 1.19
diff -c -r1.19 join.out
*** src/test/regress/expected/join.out	25 Sep 2003 06:58:06 -0000	1.19
--- src/test/regress/expected/join.out	14 Mar 2004 06:41:10 -0000
***************
*** 211,217 ****
  
  SELECT '' AS "xxx", t1.a, t2.e
    FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e)
!   WHERE t1.a = t2.d;
   xxx | a | e  
  -----+---+----
       | 0 |   
--- 211,218 ----
  
  SELECT '' AS "xxx", t1.a, t2.e
    FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e)
!   WHERE t1.a = t2.d
!   ORDER BY t1.a, t2.e;
   xxx | a | e  
  -----+---+----
       | 0 |   
***************
*** 1564,1570 ****
  --
  -- Inner equi-join on specified column
  SELECT '' AS "xxx", *
!   FROM J1_TBL INNER JOIN J2_TBL USING (i);
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1565,1572 ----
  --
  -- Inner equi-join on specified column
  SELECT '' AS "xxx", *
!   FROM J1_TBL INNER JOIN J2_TBL USING (i)
!   ORDER BY i, k;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1578,1584 ****
  
  -- Same as above, slightly different syntax
  SELECT '' AS "xxx", *
!   FROM J1_TBL JOIN J2_TBL USING (i);
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1580,1587 ----
  
  -- Same as above, slightly different syntax
  SELECT '' AS "xxx", *
!   FROM J1_TBL JOIN J2_TBL USING (i)
!   ORDER BY i, k;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1620,1626 ****
  -- Inner equi-join on all columns with the same name
  --
  SELECT '' AS "xxx", *
!   FROM J1_TBL NATURAL JOIN J2_TBL;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1623,1630 ----
  -- Inner equi-join on all columns with the same name
  --
  SELECT '' AS "xxx", *
!   FROM J1_TBL NATURAL JOIN J2_TBL
!   ORDER BY i, k;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1633,1639 ****
  (7 rows)
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (a, d);
   xxx | a | b |   c   | d  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1637,1644 ----
  (7 rows)
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (a, d)
!   ORDER BY a, d;
   xxx | a | b |   c   | d  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1657,1663 ****
  -- mismatch number of columns
  -- currently, Postgres will fill in with underlying names
  SELECT '' AS "xxx", *
!   FROM J1_TBL t1 (a, b) NATURAL JOIN J2_TBL t2 (a);
   xxx | a | b |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1662,1669 ----
  -- mismatch number of columns
  -- currently, Postgres will fill in with underlying names
  SELECT '' AS "xxx", *
!   FROM J1_TBL t1 (a, b) NATURAL JOIN J2_TBL t2 (a)
!   ORDER BY a, k;
   xxx | a | b |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1673,1679 ****
  -- Inner joins (equi-joins)
  --
  SELECT '' AS "xxx", *
!   FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.i);
   xxx | i | j |   t   | i | k  
  -----+---+---+-------+---+----
       | 0 |   | zero  | 0 |   
--- 1679,1686 ----
  -- Inner joins (equi-joins)
  --
  SELECT '' AS "xxx", *
!   FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.i)
!   ORDER BY J1_TBL.i, k;
   xxx | i | j |   t   | i | k  
  -----+---+---+-------+---+----
       | 0 |   | zero  | 0 |   
***************
*** 1718,1724 ****
  --
  SELECT '' AS "xxx", *
    FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i)
!   ORDER BY i;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1725,1731 ----
  --
  SELECT '' AS "xxx", *
    FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i)
!   ORDER BY i, k;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1738,1744 ****
  
  SELECT '' AS "xxx", *
    FROM J1_TBL LEFT JOIN J2_TBL USING (i)
!   ORDER BY i;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1745,1751 ----
  
  SELECT '' AS "xxx", *
    FROM J1_TBL LEFT JOIN J2_TBL USING (i)
!   ORDER BY i, k;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1757,1763 ****
  (13 rows)
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i);
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1764,1771 ----
  (13 rows)
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i)
!   ORDER BY i, k;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1767,1778 ****
       | 3 | 2 | three | -3
       | 5 | 0 | five  | -5
       | 5 | 0 | five  | -5
-      |   |   |       |   
       |   |   |       |  0
  (9 rows)
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL RIGHT JOIN J2_TBL USING (i);
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
--- 1775,1787 ----
       | 3 | 2 | three | -3
       | 5 | 0 | five  | -5
       | 5 | 0 | five  | -5
       |   |   |       |  0
+      |   |   |       |   
  (9 rows)
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL RIGHT JOIN J2_TBL USING (i)
!   ORDER BY i, k;
   xxx | i | j |   t   | k  
  -----+---+---+-------+----
       | 0 |   | zero  |   
***************
*** 1782,1789 ****
       | 3 | 2 | three | -3
       | 5 | 0 | five  | -5
       | 5 | 0 | five  | -5
-      |   |   |       |   
       |   |   |       |  0
  (9 rows)
  
  SELECT '' AS "xxx", *
--- 1791,1798 ----
       | 3 | 2 | three | -3
       | 5 | 0 | five  | -5
       | 5 | 0 | five  | -5
       |   |   |       |  0
+      |   |   |       |   
  (9 rows)
  
  SELECT '' AS "xxx", *
Index: src/test/regress/expected/rules.out
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/test/regress/expected/rules.out,v
retrieving revision 1.85
diff -c -r1.85 rules.out
*** src/test/regress/expected/rules.out	9 Mar 2004 05:05:41 -0000	1.85
--- src/test/regress/expected/rules.out	14 Mar 2004 06:41:12 -0000
***************
*** 1121,1127 ****
  	SELECT * FROM shoelace_obsolete WHERE sl_avail = 0;
  insert into shoelace values ('sl9', 0, 'pink', 35.0, 'inch', 0.0);
  insert into shoelace values ('sl10', 1000, 'magenta', 40.0, 'inch', 0.0);
! SELECT * FROM shoelace_obsolete;
    sl_name   | sl_avail |  sl_color  | sl_len | sl_unit  | sl_len_cm 
  ------------+----------+------------+--------+----------+-----------
   sl9        |        0 | pink       |     35 | inch     |      88.9
--- 1121,1127 ----
  	SELECT * FROM shoelace_obsolete WHERE sl_avail = 0;
  insert into shoelace values ('sl9', 0, 'pink', 35.0, 'inch', 0.0);
  insert into shoelace values ('sl10', 1000, 'magenta', 40.0, 'inch', 0.0);
! SELECT * FROM shoelace_obsolete ORDER BY sl_avail;
    sl_name   | sl_avail |  sl_color  | sl_len | sl_unit  | sl_len_cm 
  ------------+----------+------------+--------+----------+-----------
   sl9        |        0 | pink       |     35 | inch     |      88.9
Index: src/test/regress/sql/join.sql
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/test/regress/sql/join.sql,v
retrieving revision 1.13
diff -c -r1.13 join.sql
*** src/test/regress/sql/join.sql	7 Aug 2003 19:20:24 -0000	1.13
--- src/test/regress/sql/join.sql	14 Mar 2004 06:41:12 -0000
***************
*** 60,66 ****
  
  SELECT '' AS "xxx", t1.a, t2.e
    FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e)
!   WHERE t1.a = t2.d;
  
  
  --
--- 60,67 ----
  
  SELECT '' AS "xxx", t1.a, t2.e
    FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e)
!   WHERE t1.a = t2.d
!   ORDER BY t1.a, t2.e;
  
  
  --
***************
*** 106,116 ****
  
  -- Inner equi-join on specified column
  SELECT '' AS "xxx", *
!   FROM J1_TBL INNER JOIN J2_TBL USING (i);
  
  -- Same as above, slightly different syntax
  SELECT '' AS "xxx", *
!   FROM J1_TBL JOIN J2_TBL USING (i);
  
  SELECT '' AS "xxx", *
    FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, d) USING (a)
--- 107,119 ----
  
  -- Inner equi-join on specified column
  SELECT '' AS "xxx", *
!   FROM J1_TBL INNER JOIN J2_TBL USING (i)
!   ORDER BY i, k;
  
  -- Same as above, slightly different syntax
  SELECT '' AS "xxx", *
!   FROM J1_TBL JOIN J2_TBL USING (i)
!   ORDER BY i, k;
  
  SELECT '' AS "xxx", *
    FROM J1_TBL t1 (a, b, c) JOIN J2_TBL t2 (a, d) USING (a)
***************
*** 127,136 ****
  --
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL NATURAL JOIN J2_TBL;
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (a, d);
  
  SELECT '' AS "xxx", *
    FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
--- 130,141 ----
  --
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL NATURAL JOIN J2_TBL
!   ORDER BY i, k;
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (a, d)
!   ORDER BY a, d;
  
  SELECT '' AS "xxx", *
    FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
***************
*** 138,152 ****
  -- mismatch number of columns
  -- currently, Postgres will fill in with underlying names
  SELECT '' AS "xxx", *
!   FROM J1_TBL t1 (a, b) NATURAL JOIN J2_TBL t2 (a);
! 
  
  --
  -- Inner joins (equi-joins)
  --
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.i);
  
  SELECT '' AS "xxx", *
    FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.k);
--- 143,158 ----
  -- mismatch number of columns
  -- currently, Postgres will fill in with underlying names
  SELECT '' AS "xxx", *
!   FROM J1_TBL t1 (a, b) NATURAL JOIN J2_TBL t2 (a)
!   ORDER BY a, k;
  
  --
  -- Inner joins (equi-joins)
  --
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.i)
!   ORDER BY J1_TBL.i, k;
  
  SELECT '' AS "xxx", *
    FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.k);
***************
*** 167,183 ****
  
  SELECT '' AS "xxx", *
    FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i)
!   ORDER BY i;
  
  SELECT '' AS "xxx", *
    FROM J1_TBL LEFT JOIN J2_TBL USING (i)
!   ORDER BY i;
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i);
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL RIGHT JOIN J2_TBL USING (i);
  
  SELECT '' AS "xxx", *
    FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i)
--- 173,191 ----
  
  SELECT '' AS "xxx", *
    FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i)
!   ORDER BY i, k;
  
  SELECT '' AS "xxx", *
    FROM J1_TBL LEFT JOIN J2_TBL USING (i)
!   ORDER BY i, k;
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i)
!   ORDER BY i, k;
  
  SELECT '' AS "xxx", *
!   FROM J1_TBL RIGHT JOIN J2_TBL USING (i)
!   ORDER BY i, k;
  
  SELECT '' AS "xxx", *
    FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i)
Index: src/test/regress/sql/rules.sql
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/test/regress/sql/rules.sql,v
retrieving revision 1.29
diff -c -r1.29 rules.sql
*** src/test/regress/sql/rules.sql	9 Mar 2004 05:05:41 -0000	1.29
--- src/test/regress/sql/rules.sql	14 Mar 2004 06:41:13 -0000
***************
*** 679,685 ****
  insert into shoelace values ('sl9', 0, 'pink', 35.0, 'inch', 0.0);
  insert into shoelace values ('sl10', 1000, 'magenta', 40.0, 'inch', 0.0);
  
! SELECT * FROM shoelace_obsolete;
  SELECT * FROM shoelace_candelete;
  
  DELETE FROM shoelace WHERE EXISTS
--- 679,685 ----
  insert into shoelace values ('sl9', 0, 'pink', 35.0, 'inch', 0.0);
  insert into shoelace values ('sl10', 1000, 'magenta', 40.0, 'inch', 0.0);
  
! SELECT * FROM shoelace_obsolete ORDER BY sl_avail;
  SELECT * FROM shoelace_candelete;
  
  DELETE FROM shoelace WHERE EXISTS
