1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-10 14:22:35 +03:00

First cut at full support for OUTER JOINs. There are still a few loose

ends to clean up (see my message of same date to pghackers), but mostly
it works.  INITDB REQUIRED!
This commit is contained in:
Tom Lane
2000-09-12 21:07:18 +00:00
parent b5c0ab278b
commit ed5003c584
93 changed files with 6386 additions and 4262 deletions

View File

@@ -156,29 +156,29 @@ SELECT COALESCE(a.f, b.i, b.j)
FROM CASE_TBL a, CASE2_TBL b;
case
-------
10.1
10.1
10.1
10.1
10.1
10.1
20.2
20.2
20.2
20.2
20.2
20.2
-30.3
-30.3
-30.3
-30.3
-30.3
-30.3
1
10.1
20.2
-30.3
2
10.1
20.2
-30.3
3
10.1
20.2
-30.3
2
10.1
20.2
-30.3
1
10.1
20.2
-30.3
-6
(24 rows)
@@ -197,28 +197,28 @@ SELECT '' AS Five, NULLIF(a.i,b.i) AS "NULLIF(a.i,b.i)",
five | NULLIF(a.i,b.i) | NULLIF(b.i,4)
------+-----------------+---------------
| | 1
| 2 | 1
| 3 | 1
| 4 | 1
| 1 | 2
| | 2
| 3 | 2
| 4 | 2
| 1 | 3
| 2 | 3
| | 3
| 4 | 3
| 1 | 2
| | 2
| 3 | 2
| 4 | 2
| | 1
| 2 | 1
| 3 | 1
| 4 | 1
| 1 |
| 2 | 1
| | 2
| 2 | 3
| | 2
| 2 | 1
| 2 |
| 3 | 1
| 3 | 2
| | 3
| 3 | 2
| 3 | 1
| 3 |
| 4 | 1
| 4 | 2
| 4 | 3
| 4 | 2
| 4 | 1
| 4 |
(24 rows)

View File

@@ -163,28 +163,28 @@ SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
twentyfour | translation
------------+-------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (-8,2),(-10,0)
| (-7,3),(-9,1)
| (-7.5,3.5),(-7.5,2.5)
| (-7,3),(-7,3)
| (-1,6),(-3,4)
| (0,7),(-2,5)
| (-0.5,7.5),(-0.5,6.5)
| (0,7),(0,7)
| (7.1,36.5),(5.1,34.5)
| (8.1,37.5),(6.1,35.5)
| (7.6,38),(7.6,37)
| (8.1,37.5),(8.1,37.5)
| (-3,-10),(-5,-12)
| (-2,-9),(-4,-11)
| (-2.5,-8.5),(-2.5,-9.5)
| (-2,-9),(-2,-9)
| (12,12),(10,10)
| (3,3),(1,1)
| (-7,3),(-9,1)
| (0,7),(-2,5)
| (8.1,37.5),(6.1,35.5)
| (-2,-9),(-4,-11)
| (13,13),(11,11)
| (2.5,3.5),(2.5,2.5)
| (-7.5,3.5),(-7.5,2.5)
| (-0.5,7.5),(-0.5,6.5)
| (7.6,38),(7.6,37)
| (-2.5,-8.5),(-2.5,-9.5)
| (12.5,13.5),(12.5,12.5)
| (3,3),(3,3)
| (-7,3),(-7,3)
| (0,7),(0,7)
| (8.1,37.5),(8.1,37.5)
| (-2,-9),(-2,-9)
| (13,13),(13,13)
(24 rows)
@@ -193,28 +193,28 @@ SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
twentyfour | translation
------------+---------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (12,2),(10,0)
| (13,3),(11,1)
| (12.5,3.5),(12.5,2.5)
| (13,3),(13,3)
| (5,-2),(3,-4)
| (6,-1),(4,-3)
| (5.5,-0.5),(5.5,-1.5)
| (6,-1),(6,-1)
| (-3.1,-32.5),(-5.1,-34.5)
| (-2.1,-31.5),(-4.1,-33.5)
| (-2.6,-31),(-2.6,-32)
| (-2.1,-31.5),(-2.1,-31.5)
| (7,14),(5,12)
| (8,15),(6,13)
| (7.5,15.5),(7.5,14.5)
| (8,15),(8,15)
| (-8,-8),(-10,-10)
| (3,3),(1,1)
| (13,3),(11,1)
| (6,-1),(4,-3)
| (-2.1,-31.5),(-4.1,-33.5)
| (8,15),(6,13)
| (-7,-7),(-9,-9)
| (2.5,3.5),(2.5,2.5)
| (12.5,3.5),(12.5,2.5)
| (5.5,-0.5),(5.5,-1.5)
| (-2.6,-31),(-2.6,-32)
| (7.5,15.5),(7.5,14.5)
| (-7.5,-6.5),(-7.5,-7.5)
| (3,3),(3,3)
| (13,3),(13,3)
| (6,-1),(6,-1)
| (-2.1,-31.5),(-2.1,-31.5)
| (8,15),(8,15)
| (-7,-7),(-7,-7)
(24 rows)
@@ -223,29 +223,29 @@ SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
twentyfour | rotation
------------+-----------------------------
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (-0,0),(-20,-20)
| (-10,-10),(-30,-30)
| (-25,-25),(-25,-35)
| (-30,-30),(-30,-30)
| (-0,2),(-14,0)
| (-7,3),(-21,1)
| (-17.5,2.5),(-21.5,-0.5)
| (-21,3),(-21,3)
| (0,79.2),(-58.8,0)
| (-29.4,118.8),(-88.2,39.6)
| (-73.5,104.1),(-108,99)
| (-88.2,118.8),(-88.2,118.8)
| (14,-0),(0,-34)
| (21,-17),(7,-51)
| (29.5,-42.5),(17.5,-47.5)
| (21,-51),(21,-51)
| (0,40),(0,0)
| (0,0),(0,0)
| (-10,-10),(-30,-30)
| (-7,3),(-21,1)
| (-29.4,118.8),(-88.2,39.6)
| (21,-17),(7,-51)
| (0,60),(0,20)
| (0,0),(0,0)
| (-25,-25),(-25,-35)
| (-17.5,2.5),(-21.5,-0.5)
| (-73.5,104.1),(-108,99)
| (29.5,-42.5),(17.5,-47.5)
| (0,60),(-10,50)
| (0,0),(0,0)
| (-30,-30),(-30,-30)
| (-21,3),(-21,3)
| (-88.2,118.8),(-88.2,118.8)
| (21,-51),(21,-51)
| (0,60),(0,60)
(24 rows)

View File

@@ -163,28 +163,28 @@ SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
twentyfour | translation
------------+-------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (-8,2),(-10,0)
| (-7,3),(-9,1)
| (-7.5,3.5),(-7.5,2.5)
| (-7,3),(-7,3)
| (-1,6),(-3,4)
| (0,7),(-2,5)
| (-0.5,7.5),(-0.5,6.5)
| (0,7),(0,7)
| (7.1,36.5),(5.1,34.5)
| (8.1,37.5),(6.1,35.5)
| (7.6,38),(7.6,37)
| (8.1,37.5),(8.1,37.5)
| (-3,-10),(-5,-12)
| (-2,-9),(-4,-11)
| (-2.5,-8.5),(-2.5,-9.5)
| (-2,-9),(-2,-9)
| (12,12),(10,10)
| (3,3),(1,1)
| (-7,3),(-9,1)
| (0,7),(-2,5)
| (8.1,37.5),(6.1,35.5)
| (-2,-9),(-4,-11)
| (13,13),(11,11)
| (2.5,3.5),(2.5,2.5)
| (-7.5,3.5),(-7.5,2.5)
| (-0.5,7.5),(-0.5,6.5)
| (7.6,38),(7.6,37)
| (-2.5,-8.5),(-2.5,-9.5)
| (12.5,13.5),(12.5,12.5)
| (3,3),(3,3)
| (-7,3),(-7,3)
| (0,7),(0,7)
| (8.1,37.5),(8.1,37.5)
| (-2,-9),(-2,-9)
| (13,13),(13,13)
(24 rows)
@@ -193,28 +193,28 @@ SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
twentyfour | translation
------------+---------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (12,2),(10,0)
| (13,3),(11,1)
| (12.5,3.5),(12.5,2.5)
| (13,3),(13,3)
| (5,-2),(3,-4)
| (6,-1),(4,-3)
| (5.5,-0.5),(5.5,-1.5)
| (6,-1),(6,-1)
| (-3.1,-32.5),(-5.1,-34.5)
| (-2.1,-31.5),(-4.1,-33.5)
| (-2.6,-31),(-2.6,-32)
| (-2.1,-31.5),(-2.1,-31.5)
| (7,14),(5,12)
| (8,15),(6,13)
| (7.5,15.5),(7.5,14.5)
| (8,15),(8,15)
| (-8,-8),(-10,-10)
| (3,3),(1,1)
| (13,3),(11,1)
| (6,-1),(4,-3)
| (-2.1,-31.5),(-4.1,-33.5)
| (8,15),(6,13)
| (-7,-7),(-9,-9)
| (2.5,3.5),(2.5,2.5)
| (12.5,3.5),(12.5,2.5)
| (5.5,-0.5),(5.5,-1.5)
| (-2.6,-31),(-2.6,-32)
| (7.5,15.5),(7.5,14.5)
| (-7.5,-6.5),(-7.5,-7.5)
| (3,3),(3,3)
| (13,3),(13,3)
| (6,-1),(6,-1)
| (-2.1,-31.5),(-2.1,-31.5)
| (8,15),(8,15)
| (-7,-7),(-7,-7)
(24 rows)
@@ -223,29 +223,29 @@ SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
twentyfour | rotation
------------+-----------------------------
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (-0,0),(-20,-20)
| (-10,-10),(-30,-30)
| (-25,-25),(-25,-35)
| (-30,-30),(-30,-30)
| (-0,2),(-14,0)
| (-7,3),(-21,1)
| (-17.5,2.5),(-21.5,-0.5)
| (-21,3),(-21,3)
| (0,79.2),(-58.8,0)
| (-29.4,118.8),(-88.2,39.6)
| (-73.5,104.1),(-108,99)
| (-88.2,118.8),(-88.2,118.8)
| (14,-0),(0,-34)
| (21,-17),(7,-51)
| (29.5,-42.5),(17.5,-47.5)
| (21,-51),(21,-51)
| (0,40),(0,0)
| (0,0),(0,0)
| (-10,-10),(-30,-30)
| (-7,3),(-21,1)
| (-29.4,118.8),(-88.2,39.6)
| (21,-17),(7,-51)
| (0,60),(0,20)
| (0,0),(0,0)
| (-25,-25),(-25,-35)
| (-17.5,2.5),(-21.5,-0.5)
| (-73.5,104.1),(-108,99)
| (29.5,-42.5),(17.5,-47.5)
| (0,60),(-10,50)
| (0,0),(0,0)
| (-30,-30),(-30,-30)
| (-21,3),(-21,3)
| (-88.2,118.8),(-88.2,118.8)
| (21,-51),(21,-51)
| (0,60),(0,60)
(24 rows)

View File

@@ -163,28 +163,28 @@ SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
twentyfour | translation
------------+-------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (-8,2),(-10,0)
| (-7,3),(-9,1)
| (-7.5,3.5),(-7.5,2.5)
| (-7,3),(-7,3)
| (-1,6),(-3,4)
| (0,7),(-2,5)
| (-0.5,7.5),(-0.5,6.5)
| (0,7),(0,7)
| (7.1,36.5),(5.1,34.5)
| (8.1,37.5),(6.1,35.5)
| (7.6,38),(7.6,37)
| (8.1,37.5),(8.1,37.5)
| (-3,-10),(-5,-12)
| (-2,-9),(-4,-11)
| (-2.5,-8.5),(-2.5,-9.5)
| (-2,-9),(-2,-9)
| (12,12),(10,10)
| (3,3),(1,1)
| (-7,3),(-9,1)
| (0,7),(-2,5)
| (8.1,37.5),(6.1,35.5)
| (-2,-9),(-4,-11)
| (13,13),(11,11)
| (2.5,3.5),(2.5,2.5)
| (-7.5,3.5),(-7.5,2.5)
| (-0.5,7.5),(-0.5,6.5)
| (7.6,38),(7.6,37)
| (-2.5,-8.5),(-2.5,-9.5)
| (12.5,13.5),(12.5,12.5)
| (3,3),(3,3)
| (-7,3),(-7,3)
| (0,7),(0,7)
| (8.1,37.5),(8.1,37.5)
| (-2,-9),(-2,-9)
| (13,13),(13,13)
(24 rows)
@@ -193,28 +193,28 @@ SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
twentyfour | translation
------------+---------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (12,2),(10,0)
| (13,3),(11,1)
| (12.5,3.5),(12.5,2.5)
| (13,3),(13,3)
| (5,-2),(3,-4)
| (6,-1),(4,-3)
| (5.5,-0.5),(5.5,-1.5)
| (6,-1),(6,-1)
| (-3.1,-32.5),(-5.1,-34.5)
| (-2.1,-31.5),(-4.1,-33.5)
| (-2.6,-31),(-2.6,-32)
| (-2.1,-31.5),(-2.1,-31.5)
| (7,14),(5,12)
| (8,15),(6,13)
| (7.5,15.5),(7.5,14.5)
| (8,15),(8,15)
| (-8,-8),(-10,-10)
| (3,3),(1,1)
| (13,3),(11,1)
| (6,-1),(4,-3)
| (-2.1,-31.5),(-4.1,-33.5)
| (8,15),(6,13)
| (-7,-7),(-9,-9)
| (2.5,3.5),(2.5,2.5)
| (12.5,3.5),(12.5,2.5)
| (5.5,-0.5),(5.5,-1.5)
| (-2.6,-31),(-2.6,-32)
| (7.5,15.5),(7.5,14.5)
| (-7.5,-6.5),(-7.5,-7.5)
| (3,3),(3,3)
| (13,3),(13,3)
| (6,-1),(6,-1)
| (-2.1,-31.5),(-2.1,-31.5)
| (8,15),(8,15)
| (-7,-7),(-7,-7)
(24 rows)
@@ -223,29 +223,29 @@ SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
twentyfour | rotation
------------+-----------------------------
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(-20,-20)
| (-10,-10),(-30,-30)
| (-25,-25),(-25,-35)
| (-30,-30),(-30,-30)
| (0,2),(-14,0)
| (-7,3),(-21,1)
| (-17.5,2.5),(-21.5,-0.5)
| (-21,3),(-21,3)
| (0,79.2),(-58.8,0)
| (-29.4,118.8),(-88.2,39.6)
| (-73.5,104.1),(-108,99)
| (-88.2,118.8),(-88.2,118.8)
| (14,0),(0,-34)
| (21,-17),(7,-51)
| (29.5,-42.5),(17.5,-47.5)
| (21,-51),(21,-51)
| (0,40),(0,0)
| (0,0),(0,0)
| (-10,-10),(-30,-30)
| (-7,3),(-21,1)
| (-29.4,118.8),(-88.2,39.6)
| (21,-17),(7,-51)
| (0,60),(0,20)
| (0,0),(0,0)
| (-25,-25),(-25,-35)
| (-17.5,2.5),(-21.5,-0.5)
| (-73.5,104.1),(-108,99)
| (29.5,-42.5),(17.5,-47.5)
| (0,60),(-10,50)
| (0,0),(0,0)
| (-30,-30),(-30,-30)
| (-21,3),(-21,3)
| (-88.2,118.8),(-88.2,118.8)
| (21,-51),(21,-51)
| (0,60),(0,60)
(24 rows)

View File

@@ -163,28 +163,28 @@ SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
twentyfour | translation
------------+-------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (-8,2),(-10,0)
| (-7,3),(-9,1)
| (-7.5,3.5),(-7.5,2.5)
| (-7,3),(-7,3)
| (-1,6),(-3,4)
| (0,7),(-2,5)
| (-0.5,7.5),(-0.5,6.5)
| (0,7),(0,7)
| (7.1,36.5),(5.1,34.5)
| (8.1,37.5),(6.1,35.5)
| (7.6,38),(7.6,37)
| (8.1,37.5),(8.1,37.5)
| (-3,-10),(-5,-12)
| (-2,-9),(-4,-11)
| (-2.5,-8.5),(-2.5,-9.5)
| (-2,-9),(-2,-9)
| (12,12),(10,10)
| (3,3),(1,1)
| (-7,3),(-9,1)
| (0,7),(-2,5)
| (8.1,37.5),(6.1,35.5)
| (-2,-9),(-4,-11)
| (13,13),(11,11)
| (2.5,3.5),(2.5,2.5)
| (-7.5,3.5),(-7.5,2.5)
| (-0.5,7.5),(-0.5,6.5)
| (7.6,38),(7.6,37)
| (-2.5,-8.5),(-2.5,-9.5)
| (12.5,13.5),(12.5,12.5)
| (3,3),(3,3)
| (-7,3),(-7,3)
| (0,7),(0,7)
| (8.1,37.5),(8.1,37.5)
| (-2,-9),(-2,-9)
| (13,13),(13,13)
(24 rows)
@@ -193,28 +193,28 @@ SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
twentyfour | translation
------------+---------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (12,2),(10,0)
| (13,3),(11,1)
| (12.5,3.5),(12.5,2.5)
| (13,3),(13,3)
| (5,-2),(3,-4)
| (6,-1),(4,-3)
| (5.5,-0.5),(5.5,-1.5)
| (6,-1),(6,-1)
| (-3.1,-32.5),(-5.1,-34.5)
| (-2.1,-31.5),(-4.1,-33.5)
| (-2.6,-31),(-2.6,-32)
| (-2.1,-31.5),(-2.1,-31.5)
| (7,14),(5,12)
| (8,15),(6,13)
| (7.5,15.5),(7.5,14.5)
| (8,15),(8,15)
| (-8,-8),(-10,-10)
| (3,3),(1,1)
| (13,3),(11,1)
| (6,-1),(4,-3)
| (-2.1,-31.5),(-4.1,-33.5)
| (8,15),(6,13)
| (-7,-7),(-9,-9)
| (2.5,3.5),(2.5,2.5)
| (12.5,3.5),(12.5,2.5)
| (5.5,-0.5),(5.5,-1.5)
| (-2.6,-31),(-2.6,-32)
| (7.5,15.5),(7.5,14.5)
| (-7.5,-6.5),(-7.5,-7.5)
| (3,3),(3,3)
| (13,3),(13,3)
| (6,-1),(6,-1)
| (-2.1,-31.5),(-2.1,-31.5)
| (8,15),(8,15)
| (-7,-7),(-7,-7)
(24 rows)
@@ -223,29 +223,29 @@ SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
twentyfour | rotation
------------+-----------------------------
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(-20,-20)
| (-10,-10),(-30,-30)
| (-25,-25),(-25,-35)
| (-30,-30),(-30,-30)
| (0,2),(-14,0)
| (-7,3),(-21,1)
| (-17.5,2.5),(-21.5,-0.5)
| (-21,3),(-21,3)
| (0,79.2),(-58.8,0)
| (-29.4,118.8),(-88.2,39.6)
| (-73.5,104.1),(-108,99)
| (-88.2,118.8),(-88.2,118.8)
| (14,0),(0,-34)
| (21,-17),(7,-51)
| (29.5,-42.5),(17.5,-47.5)
| (21,-51),(21,-51)
| (0,40),(0,0)
| (0,0),(0,0)
| (-10,-10),(-30,-30)
| (-7,3),(-21,1)
| (-29.4,118.8),(-88.2,39.6)
| (21,-17),(7,-51)
| (0,60),(0,20)
| (0,0),(0,0)
| (-25,-25),(-25,-35)
| (-17.5,2.5),(-21.5,-0.5)
| (-73.5,104.1),(-108,99)
| (29.5,-42.5),(17.5,-47.5)
| (0,60),(-10,50)
| (0,0),(0,0)
| (-30,-30),(-30,-30)
| (-21,3),(-21,3)
| (-88.2,118.8),(-88.2,118.8)
| (21,-51),(21,-51)
| (0,60),(0,60)
(24 rows)

View File

@@ -163,28 +163,28 @@ SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
twentyfour | translation
------------+-------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (-8,2),(-10,0)
| (-7,3),(-9,1)
| (-7.5,3.5),(-7.5,2.5)
| (-7,3),(-7,3)
| (-1,6),(-3,4)
| (0,7),(-2,5)
| (-0.5,7.5),(-0.5,6.5)
| (0,7),(0,7)
| (7.1,36.5),(5.1,34.5)
| (8.1,37.5),(6.1,35.5)
| (7.6,38),(7.6,37)
| (8.1,37.5),(8.1,37.5)
| (-3,-10),(-5,-12)
| (-2,-9),(-4,-11)
| (-2.5,-8.5),(-2.5,-9.5)
| (-2,-9),(-2,-9)
| (12,12),(10,10)
| (3,3),(1,1)
| (-7,3),(-9,1)
| (0,7),(-2,5)
| (8.1,37.5),(6.1,35.5)
| (-2,-9),(-4,-11)
| (13,13),(11,11)
| (2.5,3.5),(2.5,2.5)
| (-7.5,3.5),(-7.5,2.5)
| (-0.5,7.5),(-0.5,6.5)
| (7.6,38),(7.6,37)
| (-2.5,-8.5),(-2.5,-9.5)
| (12.5,13.5),(12.5,12.5)
| (3,3),(3,3)
| (-7,3),(-7,3)
| (0,7),(0,7)
| (8.1,37.5),(8.1,37.5)
| (-2,-9),(-2,-9)
| (13,13),(13,13)
(24 rows)
@@ -193,28 +193,28 @@ SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
twentyfour | translation
------------+---------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (12,2),(10,0)
| (13,3),(11,1)
| (12.5,3.5),(12.5,2.5)
| (13,3),(13,3)
| (5,-2),(3,-4)
| (6,-1),(4,-3)
| (5.5,-0.5),(5.5,-1.5)
| (6,-1),(6,-1)
| (-3.1,-32.5),(-5.1,-34.5)
| (-2.1,-31.5),(-4.1,-33.5)
| (-2.6,-31),(-2.6,-32)
| (-2.1,-31.5),(-2.1,-31.5)
| (7,14),(5,12)
| (8,15),(6,13)
| (7.5,15.5),(7.5,14.5)
| (8,15),(8,15)
| (-8,-8),(-10,-10)
| (3,3),(1,1)
| (13,3),(11,1)
| (6,-1),(4,-3)
| (-2.1,-31.5),(-4.1,-33.5)
| (8,15),(6,13)
| (-7,-7),(-9,-9)
| (2.5,3.5),(2.5,2.5)
| (12.5,3.5),(12.5,2.5)
| (5.5,-0.5),(5.5,-1.5)
| (-2.6,-31),(-2.6,-32)
| (7.5,15.5),(7.5,14.5)
| (-7.5,-6.5),(-7.5,-7.5)
| (3,3),(3,3)
| (13,3),(13,3)
| (6,-1),(6,-1)
| (-2.1,-31.5),(-2.1,-31.5)
| (8,15),(8,15)
| (-7,-7),(-7,-7)
(24 rows)
@@ -223,29 +223,29 @@ SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
twentyfour | rotation
------------+-----------------------------
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (-0,0),(-20,-20)
| (-10,-10),(-30,-30)
| (-25,-25),(-25,-35)
| (-30,-30),(-30,-30)
| (-0,2),(-14,0)
| (-7,3),(-21,1)
| (-17.5,2.5),(-21.5,-0.5)
| (-21,3),(-21,3)
| (0,79.2),(-58.8,0)
| (-29.4,118.8),(-88.2,39.6)
| (-73.5,104.1),(-108,99)
| (-88.2,118.8),(-88.2,118.8)
| (14,-0),(0,-34)
| (21,-17),(7,-51)
| (29.5,-42.5),(17.5,-47.5)
| (21,-51),(21,-51)
| (0,40),(0,0)
| (0,0),(0,0)
| (-10,-10),(-30,-30)
| (-7,3),(-21,1)
| (-29.4,118.8),(-88.2,39.6)
| (21,-17),(7,-51)
| (0,60),(0,20)
| (0,0),(0,0)
| (-25,-25),(-25,-35)
| (-17.5,2.5),(-21.5,-0.5)
| (-73.5,104.1),(-108,99)
| (29.5,-42.5),(17.5,-47.5)
| (0,60),(-10,50)
| (0,0),(0,0)
| (-30,-30),(-30,-30)
| (-21,3),(-21,3)
| (-88.2,118.8),(-88.2,118.8)
| (21,-51),(21,-51)
| (0,60),(0,60)
(24 rows)

View File

@@ -163,28 +163,28 @@ SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
twentyfour | translation
------------+-------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (-8,2),(-10,0)
| (-7,3),(-9,1)
| (-7.5,3.5),(-7.5,2.5)
| (-7,3),(-7,3)
| (-1,6),(-3,4)
| (0,7),(-2,5)
| (-0.5,7.5),(-0.5,6.5)
| (0,7),(0,7)
| (7.1,36.5),(5.1,34.5)
| (8.1,37.5),(6.1,35.5)
| (7.6,38),(7.6,37)
| (8.1,37.5),(8.1,37.5)
| (-3,-10),(-5,-12)
| (-2,-9),(-4,-11)
| (-2.5,-8.5),(-2.5,-9.5)
| (-2,-9),(-2,-9)
| (12,12),(10,10)
| (3,3),(1,1)
| (-7,3),(-9,1)
| (0,7),(-2,5)
| (8.1,37.5),(6.1,35.5)
| (-2,-9),(-4,-11)
| (13,13),(11,11)
| (2.5,3.5),(2.5,2.5)
| (-7.5,3.5),(-7.5,2.5)
| (-0.5,7.5),(-0.5,6.5)
| (7.6,38),(7.6,37)
| (-2.5,-8.5),(-2.5,-9.5)
| (12.5,13.5),(12.5,12.5)
| (3,3),(3,3)
| (-7,3),(-7,3)
| (0,7),(0,7)
| (8.1,37.5),(8.1,37.5)
| (-2,-9),(-2,-9)
| (13,13),(13,13)
(24 rows)
@@ -193,28 +193,28 @@ SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
twentyfour | translation
------------+---------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (12,2),(10,0)
| (13,3),(11,1)
| (12.5,3.5),(12.5,2.5)
| (13,3),(13,3)
| (5,-2),(3,-4)
| (6,-1),(4,-3)
| (5.5,-0.5),(5.5,-1.5)
| (6,-1),(6,-1)
| (-3.1,-32.5),(-5.1,-34.5)
| (-2.1,-31.5),(-4.1,-33.5)
| (-2.6,-31),(-2.6,-32)
| (-2.1,-31.5),(-2.1,-31.5)
| (7,14),(5,12)
| (8,15),(6,13)
| (7.5,15.5),(7.5,14.5)
| (8,15),(8,15)
| (-8,-8),(-10,-10)
| (3,3),(1,1)
| (13,3),(11,1)
| (6,-1),(4,-3)
| (-2.1,-31.5),(-4.1,-33.5)
| (8,15),(6,13)
| (-7,-7),(-9,-9)
| (2.5,3.5),(2.5,2.5)
| (12.5,3.5),(12.5,2.5)
| (5.5,-0.5),(5.5,-1.5)
| (-2.6,-31),(-2.6,-32)
| (7.5,15.5),(7.5,14.5)
| (-7.5,-6.5),(-7.5,-7.5)
| (3,3),(3,3)
| (13,3),(13,3)
| (6,-1),(6,-1)
| (-2.1,-31.5),(-2.1,-31.5)
| (8,15),(8,15)
| (-7,-7),(-7,-7)
(24 rows)
@@ -223,29 +223,29 @@ SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
twentyfour | rotation
------------+-----------------------------
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (-0,0),(-20,-20)
| (-10,-10),(-30,-30)
| (-25,-25),(-25,-35)
| (-30,-30),(-30,-30)
| (-0,2),(-14,0)
| (-7,3),(-21,1)
| (-17.5,2.5),(-21.5,-0.5)
| (-21,3),(-21,3)
| (0,79.2),(-58.8,0)
| (-29.4,118.8),(-88.2,39.6)
| (-73.5,104.1),(-108,99)
| (-88.2,118.8),(-88.2,118.8)
| (14,-0),(0,-34)
| (21,-17),(7,-51)
| (29.5,-42.5),(17.5,-47.5)
| (21,-51),(21,-51)
| (0,40),(0,0)
| (0,0),(0,0)
| (-10,-10),(-30,-30)
| (-7,3),(-21,1)
| (-29.4,118.8),(-88.2,39.6)
| (21,-17),(7,-51)
| (0,60),(0,20)
| (0,0),(0,0)
| (-25,-25),(-25,-35)
| (-17.5,2.5),(-21.5,-0.5)
| (-73.5,104.1),(-108,99)
| (29.5,-42.5),(17.5,-47.5)
| (0,60),(-10,50)
| (0,0),(0,0)
| (-30,-30),(-30,-30)
| (-21,3),(-21,3)
| (-88.2,118.8),(-88.2,118.8)
| (21,-51),(21,-51)
| (0,60),(0,60)
(24 rows)

View File

@@ -163,28 +163,28 @@ SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
twentyfour | translation
------------+-------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (-8,2),(-10,0)
| (-7,3),(-9,1)
| (-7.5,3.5),(-7.5,2.5)
| (-7,3),(-7,3)
| (-1,6),(-3,4)
| (0,7),(-2,5)
| (-0.5,7.5),(-0.5,6.5)
| (0,7),(0,7)
| (7.1,36.5),(5.1,34.5)
| (8.1,37.5),(6.1,35.5)
| (7.6,38),(7.6,37)
| (8.1,37.5),(8.1,37.5)
| (-3,-10),(-5,-12)
| (-2,-9),(-4,-11)
| (-2.5,-8.5),(-2.5,-9.5)
| (-2,-9),(-2,-9)
| (12,12),(10,10)
| (3,3),(1,1)
| (-7,3),(-9,1)
| (0,7),(-2,5)
| (8.1,37.5),(6.1,35.5)
| (-2,-9),(-4,-11)
| (13,13),(11,11)
| (2.5,3.5),(2.5,2.5)
| (-7.5,3.5),(-7.5,2.5)
| (-0.5,7.5),(-0.5,6.5)
| (7.6,38),(7.6,37)
| (-2.5,-8.5),(-2.5,-9.5)
| (12.5,13.5),(12.5,12.5)
| (3,3),(3,3)
| (-7,3),(-7,3)
| (0,7),(0,7)
| (8.1,37.5),(8.1,37.5)
| (-2,-9),(-2,-9)
| (13,13),(13,13)
(24 rows)
@@ -193,28 +193,28 @@ SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
twentyfour | translation
------------+---------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (12,2),(10,0)
| (13,3),(11,1)
| (12.5,3.5),(12.5,2.5)
| (13,3),(13,3)
| (5,-2),(3,-4)
| (6,-1),(4,-3)
| (5.5,-0.5),(5.5,-1.5)
| (6,-1),(6,-1)
| (-3.1,-32.5),(-5.1,-34.5)
| (-2.1,-31.5),(-4.1,-33.5)
| (-2.6,-31),(-2.6,-32)
| (-2.1,-31.5),(-2.1,-31.5)
| (7,14),(5,12)
| (8,15),(6,13)
| (7.5,15.5),(7.5,14.5)
| (8,15),(8,15)
| (-8,-8),(-10,-10)
| (3,3),(1,1)
| (13,3),(11,1)
| (6,-1),(4,-3)
| (-2.1,-31.5),(-4.1,-33.5)
| (8,15),(6,13)
| (-7,-7),(-9,-9)
| (2.5,3.5),(2.5,2.5)
| (12.5,3.5),(12.5,2.5)
| (5.5,-0.5),(5.5,-1.5)
| (-2.6,-31),(-2.6,-32)
| (7.5,15.5),(7.5,14.5)
| (-7.5,-6.5),(-7.5,-7.5)
| (3,3),(3,3)
| (13,3),(13,3)
| (6,-1),(6,-1)
| (-2.1,-31.5),(-2.1,-31.5)
| (8,15),(8,15)
| (-7,-7),(-7,-7)
(24 rows)
@@ -223,29 +223,29 @@ SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
twentyfour | rotation
------------+-----------------------------
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (-0,0),(-20,-20)
| (-10,-10),(-30,-30)
| (-25,-25),(-25,-35)
| (-30,-30),(-30,-30)
| (-0,2),(-14,0)
| (-7,3),(-21,1)
| (-17.5,2.5),(-21.5,-0.5)
| (-21,3),(-21,3)
| (0,79.2),(-58.8,0)
| (-29.4,118.8),(-88.2,39.6)
| (-73.5,104.1),(-108,99)
| (-88.2,118.8),(-88.2,118.8)
| (14,-0),(0,-34)
| (21,-17),(7,-51)
| (29.5,-42.5),(17.5,-47.5)
| (21,-51),(21,-51)
| (0,40),(0,0)
| (0,0),(0,0)
| (-10,-10),(-30,-30)
| (-7,3),(-21,1)
| (-29.4,118.8),(-88.2,39.6)
| (21,-17),(7,-51)
| (0,60),(0,20)
| (0,0),(0,0)
| (-25,-25),(-25,-35)
| (-17.5,2.5),(-21.5,-0.5)
| (-73.5,104.1),(-108,99)
| (29.5,-42.5),(17.5,-47.5)
| (0,60),(-10,50)
| (0,0),(0,0)
| (-30,-30),(-30,-30)
| (-21,3),(-21,3)
| (-88.2,118.8),(-88.2,118.8)
| (21,-51),(21,-51)
| (0,60),(0,60)
(24 rows)

View File

@@ -163,28 +163,28 @@ SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
twentyfour | translation
------------+-------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (-8,2),(-10,0)
| (-7,3),(-9,1)
| (-7.5,3.5),(-7.5,2.5)
| (-7,3),(-7,3)
| (-1,6),(-3,4)
| (0,7),(-2,5)
| (-0.5,7.5),(-0.5,6.5)
| (0,7),(0,7)
| (7.1,36.5),(5.1,34.5)
| (8.1,37.5),(6.1,35.5)
| (7.6,38),(7.6,37)
| (8.1,37.5),(8.1,37.5)
| (-3,-10),(-5,-12)
| (-2,-9),(-4,-11)
| (-2.5,-8.5),(-2.5,-9.5)
| (-2,-9),(-2,-9)
| (12,12),(10,10)
| (3,3),(1,1)
| (-7,3),(-9,1)
| (0,7),(-2,5)
| (8.1,37.5),(6.1,35.5)
| (-2,-9),(-4,-11)
| (13,13),(11,11)
| (2.5,3.5),(2.5,2.5)
| (-7.5,3.5),(-7.5,2.5)
| (-0.5,7.5),(-0.5,6.5)
| (7.6,38),(7.6,37)
| (-2.5,-8.5),(-2.5,-9.5)
| (12.5,13.5),(12.5,12.5)
| (3,3),(3,3)
| (-7,3),(-7,3)
| (0,7),(0,7)
| (8.1,37.5),(8.1,37.5)
| (-2,-9),(-2,-9)
| (13,13),(13,13)
(24 rows)
@@ -193,28 +193,28 @@ SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
twentyfour | translation
------------+---------------------------
| (2,2),(0,0)
| (3,3),(1,1)
| (2.5,3.5),(2.5,2.5)
| (3,3),(3,3)
| (12,2),(10,0)
| (13,3),(11,1)
| (12.5,3.5),(12.5,2.5)
| (13,3),(13,3)
| (5,-2),(3,-4)
| (6,-1),(4,-3)
| (5.5,-0.5),(5.5,-1.5)
| (6,-1),(6,-1)
| (-3.1,-32.5),(-5.1,-34.5)
| (-2.1,-31.5),(-4.1,-33.5)
| (-2.6,-31),(-2.6,-32)
| (-2.1,-31.5),(-2.1,-31.5)
| (7,14),(5,12)
| (8,15),(6,13)
| (7.5,15.5),(7.5,14.5)
| (8,15),(8,15)
| (-8,-8),(-10,-10)
| (3,3),(1,1)
| (13,3),(11,1)
| (6,-1),(4,-3)
| (-2.1,-31.5),(-4.1,-33.5)
| (8,15),(6,13)
| (-7,-7),(-9,-9)
| (2.5,3.5),(2.5,2.5)
| (12.5,3.5),(12.5,2.5)
| (5.5,-0.5),(5.5,-1.5)
| (-2.6,-31),(-2.6,-32)
| (7.5,15.5),(7.5,14.5)
| (-7.5,-6.5),(-7.5,-7.5)
| (3,3),(3,3)
| (13,3),(13,3)
| (6,-1),(6,-1)
| (-2.1,-31.5),(-2.1,-31.5)
| (8,15),(8,15)
| (-7,-7),(-7,-7)
(24 rows)
@@ -223,29 +223,29 @@ SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
FROM BOX_TBL b, POINT_TBL p;
twentyfour | rotation
------------+-----------------------------
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (0,0),(0,0)
| (-0,0),(-20,-20)
| (-10,-10),(-30,-30)
| (-25,-25),(-25,-35)
| (-30,-30),(-30,-30)
| (-0,2),(-14,0)
| (-7,3),(-21,1)
| (-17.5,2.5),(-21.5,-0.5)
| (-21,3),(-21,3)
| (0,79.2),(-58.8,0)
| (-29.4,118.8),(-88.2,39.6)
| (-73.5,104.1),(-108,99)
| (-88.2,118.8),(-88.2,118.8)
| (14,-0),(0,-34)
| (21,-17),(7,-51)
| (29.5,-42.5),(17.5,-47.5)
| (21,-51),(21,-51)
| (0,40),(0,0)
| (0,0),(0,0)
| (-10,-10),(-30,-30)
| (-7,3),(-21,1)
| (-29.4,118.8),(-88.2,39.6)
| (21,-17),(7,-51)
| (0,60),(0,20)
| (0,0),(0,0)
| (-25,-25),(-25,-35)
| (-17.5,2.5),(-21.5,-0.5)
| (-73.5,104.1),(-108,99)
| (29.5,-42.5),(17.5,-47.5)
| (0,60),(-10,50)
| (0,0),(0,0)
| (-30,-30),(-30,-30)
| (-21,3),(-21,3)
| (-88.2,118.8),(-88.2,118.8)
| (21,-51),(21,-51)
| (0,60),(0,60)
(24 rows)

View File

@@ -1,6 +1,6 @@
--
-- JOIN
-- Test join clauses
-- Test JOIN clauses
--
CREATE TABLE J1_TBL (
i integer,
@@ -28,6 +28,7 @@ INSERT INTO J2_TBL VALUES (1, -1);
INSERT INTO J2_TBL VALUES (2, 2);
INSERT INTO J2_TBL VALUES (3, -3);
INSERT INTO J2_TBL VALUES (2, 4);
INSERT INTO J2_TBL VALUES (5, -5);
--
-- CORRELATION NAMES
-- Make sure that table/column aliases are supported
@@ -78,22 +79,26 @@ SELECT '' AS "xxx", *
xxx | a | b | c | d | e
-----+---+---+-------+---+----
| 1 | 3 | one | 1 | -1
| 2 | 2 | two | 1 | -1
| 3 | 1 | three | 1 | -1
| 4 | 0 | four | 1 | -1
| 1 | 3 | one | 2 | 2
| 2 | 2 | two | 2 | 2
| 3 | 1 | three | 2 | 2
| 4 | 0 | four | 2 | 2
| 1 | 3 | one | 3 | -3
| 2 | 2 | two | 3 | -3
| 3 | 1 | three | 3 | -3
| 4 | 0 | four | 3 | -3
| 1 | 3 | one | 2 | 4
| 1 | 3 | one | 5 | -5
| 2 | 2 | two | 1 | -1
| 2 | 2 | two | 2 | 2
| 2 | 2 | two | 3 | -3
| 2 | 2 | two | 2 | 4
| 2 | 2 | two | 5 | -5
| 3 | 1 | three | 1 | -1
| 3 | 1 | three | 2 | 2
| 3 | 1 | three | 3 | -3
| 3 | 1 | three | 2 | 4
| 3 | 1 | three | 5 | -5
| 4 | 0 | four | 1 | -1
| 4 | 0 | four | 2 | 2
| 4 | 0 | four | 3 | -3
| 4 | 0 | four | 2 | 4
(16 rows)
| 4 | 0 | four | 5 | -5
(20 rows)
SELECT '' AS "xxx", t1.a, t2.e
FROM J1_TBL t1 (a, b, c), J2_TBL t2 (d, e)
@@ -116,58 +121,218 @@ SELECT '' AS "xxx", *
xxx | i | j | t | i | k
-----+---+---+-------+---+----
| 1 | 3 | one | 1 | -1
| 2 | 2 | two | 1 | -1
| 3 | 1 | three | 1 | -1
| 4 | 0 | four | 1 | -1
| 1 | 3 | one | 2 | 2
| 2 | 2 | two | 2 | 2
| 3 | 1 | three | 2 | 2
| 4 | 0 | four | 2 | 2
| 1 | 3 | one | 3 | -3
| 2 | 2 | two | 3 | -3
| 3 | 1 | three | 3 | -3
| 4 | 0 | four | 3 | -3
| 1 | 3 | one | 2 | 4
| 1 | 3 | one | 5 | -5
| 2 | 2 | two | 1 | -1
| 2 | 2 | two | 2 | 2
| 2 | 2 | two | 3 | -3
| 2 | 2 | two | 2 | 4
| 2 | 2 | two | 5 | -5
| 3 | 1 | three | 1 | -1
| 3 | 1 | three | 2 | 2
| 3 | 1 | three | 3 | -3
| 3 | 1 | three | 2 | 4
| 3 | 1 | three | 5 | -5
| 4 | 0 | four | 1 | -1
| 4 | 0 | four | 2 | 2
| 4 | 0 | four | 3 | -3
| 4 | 0 | four | 2 | 4
(16 rows)
| 4 | 0 | four | 5 | -5
(20 rows)
-- ambiguous column
SELECT '' AS "xxx", i, k, t
FROM J1_TBL CROSS JOIN J2_TBL;
ERROR: Column 'i' is ambiguous
ERROR: Column reference "i" is ambiguous
-- resolve previous ambiguity by specifying the table name
SELECT '' AS "xxx", t1.i, k, t
FROM J1_TBL t1 CROSS JOIN J2_TBL t2;
xxx | i | k | t
-----+---+----+-------
| 1 | -1 | one
| 2 | -1 | two
| 3 | -1 | three
| 4 | -1 | four
| 1 | 2 | one
| 2 | 2 | two
| 3 | 2 | three
| 4 | 2 | four
| 1 | -3 | one
| 2 | -3 | two
| 3 | -3 | three
| 4 | -3 | four
| 1 | 4 | one
| 1 | -5 | one
| 2 | -1 | two
| 2 | 2 | two
| 2 | -3 | two
| 2 | 4 | two
| 2 | -5 | two
| 3 | -1 | three
| 3 | 2 | three
| 3 | -3 | three
| 3 | 4 | three
| 3 | -5 | three
| 4 | -1 | four
| 4 | 2 | four
| 4 | -3 | four
| 4 | 4 | four
(16 rows)
| 4 | -5 | four
(20 rows)
SELECT '' AS "xxx", ii, tt, kk
FROM (J1_TBL CROSS JOIN J2_TBL)
AS tx (ii, jj, tt, ii2, kk);
ERROR: JOIN table aliases are not supported
xxx | ii | tt | kk
-----+----+-------+----
| 1 | one | -1
| 1 | one | 2
| 1 | one | -3
| 1 | one | 4
| 1 | one | -5
| 2 | two | -1
| 2 | two | 2
| 2 | two | -3
| 2 | two | 4
| 2 | two | -5
| 3 | three | -1
| 3 | three | 2
| 3 | three | -3
| 3 | three | 4
| 3 | three | -5
| 4 | four | -1
| 4 | four | 2
| 4 | four | -3
| 4 | four | 4
| 4 | four | -5
(20 rows)
SELECT '' AS "xxx", tx.ii, tx.jj, tx.kk
FROM (J1_TBL t1 (a, b, c) CROSS JOIN J2_TBL t2 (d, e))
AS tx (ii, jj, tt, ii2, kk);
ERROR: JOIN table aliases are not supported
xxx | ii | jj | kk
-----+----+----+----
| 1 | 3 | -1
| 1 | 3 | 2
| 1 | 3 | -3
| 1 | 3 | 4
| 1 | 3 | -5
| 2 | 2 | -1
| 2 | 2 | 2
| 2 | 2 | -3
| 2 | 2 | 4
| 2 | 2 | -5
| 3 | 1 | -1
| 3 | 1 | 2
| 3 | 1 | -3
| 3 | 1 | 4
| 3 | 1 | -5
| 4 | 0 | -1
| 4 | 0 | 2
| 4 | 0 | -3
| 4 | 0 | 4
| 4 | 0 | -5
(20 rows)
SELECT '' AS "xxx", *
FROM J1_TBL CROSS JOIN J2_TBL a CROSS JOIN J2_TBL b;
xxx | i | j | t | i | k | i | k
-----+---+---+-------+---+----+---+----
| 1 | 3 | one | 1 | -1 | 1 | -1
| 1 | 3 | one | 1 | -1 | 2 | 2
| 1 | 3 | one | 1 | -1 | 3 | -3
| 1 | 3 | one | 1 | -1 | 2 | 4
| 1 | 3 | one | 1 | -1 | 5 | -5
| 1 | 3 | one | 2 | 2 | 1 | -1
| 1 | 3 | one | 2 | 2 | 2 | 2
| 1 | 3 | one | 2 | 2 | 3 | -3
| 1 | 3 | one | 2 | 2 | 2 | 4
| 1 | 3 | one | 2 | 2 | 5 | -5
| 1 | 3 | one | 3 | -3 | 1 | -1
| 1 | 3 | one | 3 | -3 | 2 | 2
| 1 | 3 | one | 3 | -3 | 3 | -3
| 1 | 3 | one | 3 | -3 | 2 | 4
| 1 | 3 | one | 3 | -3 | 5 | -5
| 1 | 3 | one | 2 | 4 | 1 | -1
| 1 | 3 | one | 2 | 4 | 2 | 2
| 1 | 3 | one | 2 | 4 | 3 | -3
| 1 | 3 | one | 2 | 4 | 2 | 4
| 1 | 3 | one | 2 | 4 | 5 | -5
| 1 | 3 | one | 5 | -5 | 1 | -1
| 1 | 3 | one | 5 | -5 | 2 | 2
| 1 | 3 | one | 5 | -5 | 3 | -3
| 1 | 3 | one | 5 | -5 | 2 | 4
| 1 | 3 | one | 5 | -5 | 5 | -5
| 2 | 2 | two | 1 | -1 | 1 | -1
| 2 | 2 | two | 1 | -1 | 2 | 2
| 2 | 2 | two | 1 | -1 | 3 | -3
| 2 | 2 | two | 1 | -1 | 2 | 4
| 2 | 2 | two | 1 | -1 | 5 | -5
| 2 | 2 | two | 2 | 2 | 1 | -1
| 2 | 2 | two | 2 | 2 | 2 | 2
| 2 | 2 | two | 2 | 2 | 3 | -3
| 2 | 2 | two | 2 | 2 | 2 | 4
| 2 | 2 | two | 2 | 2 | 5 | -5
| 2 | 2 | two | 3 | -3 | 1 | -1
| 2 | 2 | two | 3 | -3 | 2 | 2
| 2 | 2 | two | 3 | -3 | 3 | -3
| 2 | 2 | two | 3 | -3 | 2 | 4
| 2 | 2 | two | 3 | -3 | 5 | -5
| 2 | 2 | two | 2 | 4 | 1 | -1
| 2 | 2 | two | 2 | 4 | 2 | 2
| 2 | 2 | two | 2 | 4 | 3 | -3
| 2 | 2 | two | 2 | 4 | 2 | 4
| 2 | 2 | two | 2 | 4 | 5 | -5
| 2 | 2 | two | 5 | -5 | 1 | -1
| 2 | 2 | two | 5 | -5 | 2 | 2
| 2 | 2 | two | 5 | -5 | 3 | -3
| 2 | 2 | two | 5 | -5 | 2 | 4
| 2 | 2 | two | 5 | -5 | 5 | -5
| 3 | 1 | three | 1 | -1 | 1 | -1
| 3 | 1 | three | 1 | -1 | 2 | 2
| 3 | 1 | three | 1 | -1 | 3 | -3
| 3 | 1 | three | 1 | -1 | 2 | 4
| 3 | 1 | three | 1 | -1 | 5 | -5
| 3 | 1 | three | 2 | 2 | 1 | -1
| 3 | 1 | three | 2 | 2 | 2 | 2
| 3 | 1 | three | 2 | 2 | 3 | -3
| 3 | 1 | three | 2 | 2 | 2 | 4
| 3 | 1 | three | 2 | 2 | 5 | -5
| 3 | 1 | three | 3 | -3 | 1 | -1
| 3 | 1 | three | 3 | -3 | 2 | 2
| 3 | 1 | three | 3 | -3 | 3 | -3
| 3 | 1 | three | 3 | -3 | 2 | 4
| 3 | 1 | three | 3 | -3 | 5 | -5
| 3 | 1 | three | 2 | 4 | 1 | -1
| 3 | 1 | three | 2 | 4 | 2 | 2
| 3 | 1 | three | 2 | 4 | 3 | -3
| 3 | 1 | three | 2 | 4 | 2 | 4
| 3 | 1 | three | 2 | 4 | 5 | -5
| 3 | 1 | three | 5 | -5 | 1 | -1
| 3 | 1 | three | 5 | -5 | 2 | 2
| 3 | 1 | three | 5 | -5 | 3 | -3
| 3 | 1 | three | 5 | -5 | 2 | 4
| 3 | 1 | three | 5 | -5 | 5 | -5
| 4 | 0 | four | 1 | -1 | 1 | -1
| 4 | 0 | four | 1 | -1 | 2 | 2
| 4 | 0 | four | 1 | -1 | 3 | -3
| 4 | 0 | four | 1 | -1 | 2 | 4
| 4 | 0 | four | 1 | -1 | 5 | -5
| 4 | 0 | four | 2 | 2 | 1 | -1
| 4 | 0 | four | 2 | 2 | 2 | 2
| 4 | 0 | four | 2 | 2 | 3 | -3
| 4 | 0 | four | 2 | 2 | 2 | 4
| 4 | 0 | four | 2 | 2 | 5 | -5
| 4 | 0 | four | 3 | -3 | 1 | -1
| 4 | 0 | four | 3 | -3 | 2 | 2
| 4 | 0 | four | 3 | -3 | 3 | -3
| 4 | 0 | four | 3 | -3 | 2 | 4
| 4 | 0 | four | 3 | -3 | 5 | -5
| 4 | 0 | four | 2 | 4 | 1 | -1
| 4 | 0 | four | 2 | 4 | 2 | 2
| 4 | 0 | four | 2 | 4 | 3 | -3
| 4 | 0 | four | 2 | 4 | 2 | 4
| 4 | 0 | four | 2 | 4 | 5 | -5
| 4 | 0 | four | 5 | -5 | 1 | -1
| 4 | 0 | four | 5 | -5 | 2 | 2
| 4 | 0 | four | 5 | -5 | 3 | -3
| 4 | 0 | four | 5 | -5 | 2 | 4
| 4 | 0 | four | 5 | -5 | 5 | -5
(100 rows)
--
--
-- Inner joins (equi-joins)
@@ -249,14 +414,6 @@ SELECT '' AS "xxx", *
| 4 | 0 | four | 2
(2 rows)
SELECT '' AS "xxx", *
FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
xxx | a | b | c | d
-----+---+---+------+---
| 2 | 2 | two | 2
| 4 | 0 | four | 2
(2 rows)
-- mismatch number of columns
-- currently, Postgres will fill in with underlying names
SELECT '' AS "xxx", *
@@ -290,28 +447,6 @@ SELECT '' AS "xxx", *
| 4 | 0 | four | 2 | 4
(2 rows)
SELECT '' AS "xxx", *
FROM J1_TBL CROSS JOIN J2_TBL;
xxx | i | j | t | i | k
-----+---+---+-------+---+----
| 1 | 3 | one | 1 | -1
| 2 | 2 | two | 1 | -1
| 3 | 1 | three | 1 | -1
| 4 | 0 | four | 1 | -1
| 1 | 3 | one | 2 | 2
| 2 | 2 | two | 2 | 2
| 3 | 1 | three | 2 | 2
| 4 | 0 | four | 2 | 2
| 1 | 3 | one | 3 | -3
| 2 | 2 | two | 3 | -3
| 3 | 1 | three | 3 | -3
| 4 | 0 | four | 3 | -3
| 1 | 3 | one | 2 | 4
| 2 | 2 | two | 2 | 4
| 3 | 1 | three | 2 | 4
| 4 | 0 | four | 2 | 4
(16 rows)
--
-- Non-equi-joins
--
@@ -320,8 +455,8 @@ SELECT '' AS "xxx", *
xxx | i | j | t | i | k
-----+---+---+-------+---+---
| 1 | 3 | one | 2 | 2
| 2 | 2 | two | 2 | 2
| 1 | 3 | one | 2 | 4
| 2 | 2 | two | 2 | 2
| 2 | 2 | two | 2 | 4
| 3 | 1 | three | 2 | 4
| 4 | 0 | four | 2 | 4
@@ -330,21 +465,48 @@ SELECT '' AS "xxx", *
--
-- Outer joins
--
SELECT '' AS "xxx", *
FROM J1_TBL OUTER JOIN J2_TBL USING (i);
ERROR: OUTER JOIN is not yet supported
SELECT '' AS "xxx", *
FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i);
ERROR: OUTER JOIN is not yet supported
xxx | i | j | t | k
-----+---+---+-------+----
| 1 | 3 | one | -1
| 2 | 2 | two | 2
| 2 | 2 | two | 4
| 3 | 1 | three | -3
| 4 | 0 | four |
(5 rows)
SELECT '' AS "xxx", *
FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i);
ERROR: OUTER JOIN is not yet supported
xxx | i | j | t | k
-----+---+---+-------+----
| 1 | 3 | one | -1
| 2 | 2 | two | 2
| 2 | 2 | two | 4
| 3 | 1 | three | -3
| 5 | | | -5
(5 rows)
-- Note that OUTER is a noise word
SELECT '' AS "xxx", *
FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i);
ERROR: OUTER JOIN is not yet supported
FROM J1_TBL FULL JOIN J2_TBL USING (i);
xxx | i | j | t | k
-----+---+---+-------+----
| 1 | 3 | one | -1
| 2 | 2 | two | 2
| 2 | 2 | two | 4
| 3 | 1 | three | -3
| 4 | 0 | four |
| 5 | | | -5
(6 rows)
--
-- More complicated constructs
--
-- UNION JOIN isn't implemented yet
SELECT '' AS "xxx", *
FROM J1_TBL UNION JOIN J2_TBL;
ERROR: UNION JOIN is not implemented yet
--
-- Clean up
--

View File

@@ -154,36 +154,36 @@ SELECT '' AS thirty, p1.f1 AS point1, p2.f1 AS point2
WHERE (p1.f1 <-> p2.f1) > 3;
thirty | point1 | point2
--------+------------+------------
| (-10,0) | (0,0)
| (-3,4) | (0,0)
| (5.1,34.5) | (0,0)
| (-5,-12) | (0,0)
| (10,10) | (0,0)
| (0,0) | (-10,0)
| (-3,4) | (-10,0)
| (5.1,34.5) | (-10,0)
| (-5,-12) | (-10,0)
| (10,10) | (-10,0)
| (0,0) | (-3,4)
| (-10,0) | (-3,4)
| (5.1,34.5) | (-3,4)
| (-5,-12) | (-3,4)
| (10,10) | (-3,4)
| (0,0) | (5.1,34.5)
| (-10,0) | (5.1,34.5)
| (-3,4) | (5.1,34.5)
| (-5,-12) | (5.1,34.5)
| (10,10) | (5.1,34.5)
| (0,0) | (-5,-12)
| (-10,0) | (-5,-12)
| (-3,4) | (-5,-12)
| (5.1,34.5) | (-5,-12)
| (10,10) | (-5,-12)
| (0,0) | (10,10)
| (-10,0) | (0,0)
| (-10,0) | (-3,4)
| (-10,0) | (5.1,34.5)
| (-10,0) | (-5,-12)
| (-10,0) | (10,10)
| (-3,4) | (0,0)
| (-3,4) | (-10,0)
| (-3,4) | (5.1,34.5)
| (-3,4) | (-5,-12)
| (-3,4) | (10,10)
| (5.1,34.5) | (0,0)
| (5.1,34.5) | (-10,0)
| (5.1,34.5) | (-3,4)
| (5.1,34.5) | (-5,-12)
| (5.1,34.5) | (10,10)
| (-5,-12) | (0,0)
| (-5,-12) | (-10,0)
| (-5,-12) | (-3,4)
| (-5,-12) | (5.1,34.5)
| (-5,-12) | (10,10)
| (10,10) | (0,0)
| (10,10) | (-10,0)
| (10,10) | (-3,4)
| (10,10) | (5.1,34.5)
| (10,10) | (-5,-12)
(30 rows)
-- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10

View File

@@ -1158,6 +1158,47 @@ SELECT count(*) FROM shoe;
4
(1 row)
--
-- Simple test of qualified ON INSERT ... this did not work in 7.0 ...
--
create table foo (f1 int);
create table foo2 (f1 int);
create rule foorule as on insert to foo where f1 < 100
do instead nothing;
insert into foo values(1);
insert into foo values(1001);
select * from foo;
f1
------
1001
(1 row)
drop rule foorule;
-- this should fail because f1 is not exposed for unqualified reference:
create rule foorule as on insert to foo where f1 < 100
do instead insert into foo2 values (f1);
ERROR: Attribute 'f1' not found
-- this is the correct way:
create rule foorule as on insert to foo where f1 < 100
do instead insert into foo2 values (new.f1);
insert into foo values(2);
insert into foo values(100);
select * from foo;
f1
------
1001
100
(2 rows)
select * from foo2;
f1
----
2
(1 row)
drop rule foorule;
drop table foo;
drop table foo2;
--
-- Check that ruleutils are working
--
@@ -1200,7 +1241,7 @@ SELECT tablename, rulename, definition FROM pg_rules
rtest_order1 | rtest_order_r1 | CREATE RULE rtest_order_r1 AS ON INSERT TO rtest_order1 DO INSTEAD INSERT INTO rtest_order2 (a, b, c) VALUES (new.a, nextval('rtest_seq'::text), 'rule 1 - this should run 3rd or 4th'::text);
rtest_order1 | rtest_order_r2 | CREATE RULE rtest_order_r2 AS ON INSERT TO rtest_order1 DO INSERT INTO rtest_order2 (a, b, c) VALUES (new.a, nextval('rtest_seq'::text), 'rule 2 - this should run 1st'::text);
rtest_order1 | rtest_order_r3 | CREATE RULE rtest_order_r3 AS ON INSERT TO rtest_order1 DO INSTEAD INSERT INTO rtest_order2 (a, b, c) VALUES (new.a, nextval('rtest_seq'::text), 'rule 3 - this should run 3rd or 4th'::text);
rtest_order1 | rtest_order_r4 | CREATE RULE rtest_order_r4 AS ON INSERT TO rtest_order1 WHERE (rtest_order2.a < 100) DO INSTEAD INSERT INTO rtest_order2 (a, b, c) VALUES (new.a, nextval('rtest_seq'::text), 'rule 4 - this should run 2nd'::text);
rtest_order1 | rtest_order_r4 | CREATE RULE rtest_order_r4 AS ON INSERT TO rtest_order1 WHERE (new.a < 100) DO INSTEAD INSERT INTO rtest_order2 (a, b, c) VALUES (new.a, nextval('rtest_seq'::text), 'rule 4 - this should run 2nd'::text);
rtest_person | rtest_pers_del | CREATE RULE rtest_pers_del AS ON DELETE TO rtest_person DO DELETE FROM rtest_admin WHERE (rtest_admin.pname = old.pname);
rtest_person | rtest_pers_upd | CREATE RULE rtest_pers_upd AS ON UPDATE TO rtest_person DO UPDATE rtest_admin SET pname = new.pname WHERE (rtest_admin.pname = old.pname);
rtest_system | rtest_sys_del | CREATE RULE rtest_sys_del AS ON DELETE TO rtest_system DO (DELETE FROM rtest_interface WHERE (rtest_interface.sysname = old.sysname); DELETE FROM rtest_admin WHERE (rtest_admin.sysname = old.sysname); );

View File

@@ -120,7 +120,7 @@ ERROR: GROUP BY position 3 is not in target list
SELECT count(*) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY b ORDER BY b;
ERROR: Column 'b' is ambiguous
ERROR: Column reference "b" is ambiguous
-- order w/ target under ambiguous condition
-- failure NOT expected
SELECT a, a FROM test_missing_target
@@ -282,7 +282,7 @@ SELECT count(b) FROM test_missing_target
SELECT count(x.a) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY b/2 ORDER BY b/2;
ERROR: Column 'b' is ambiguous
ERROR: Column reference "b" is ambiguous
-- group w/ existing GROUP BY target under ambiguous condition
SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
@@ -299,7 +299,7 @@ SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
SELECT count(b) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY x.b/2;
ERROR: Column 'b' is ambiguous
ERROR: Column reference "b" is ambiguous
-- group w/o existing GROUP BY target under ambiguous condition
-- into a table
SELECT count(x.b) INTO TABLE test_missing_target3

View File

@@ -1,6 +1,6 @@
--
-- JOIN
-- Test join clauses
-- Test JOIN clauses
--
CREATE TABLE J1_TBL (
@@ -34,6 +34,7 @@ INSERT INTO J2_TBL VALUES (1, -1);
INSERT INTO J2_TBL VALUES (2, 2);
INSERT INTO J2_TBL VALUES (3, -3);
INSERT INTO J2_TBL VALUES (2, 4);
INSERT INTO J2_TBL VALUES (5, -5);
--
-- CORRELATION NAMES
@@ -86,6 +87,9 @@ SELECT '' AS "xxx", tx.ii, tx.jj, tx.kk
FROM (J1_TBL t1 (a, b, c) CROSS JOIN J2_TBL t2 (d, e))
AS tx (ii, jj, tt, ii2, kk);
SELECT '' AS "xxx", *
FROM J1_TBL CROSS JOIN J2_TBL a CROSS JOIN J2_TBL b;
--
--
@@ -128,9 +132,6 @@ SELECT '' AS "xxx", *
SELECT '' AS "xxx", *
FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
SELECT '' AS "xxx", *
FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
-- mismatch number of columns
-- currently, Postgres will fill in with underlying names
SELECT '' AS "xxx", *
@@ -147,9 +148,6 @@ SELECT '' AS "xxx", *
SELECT '' AS "xxx", *
FROM J1_TBL JOIN J2_TBL ON (J1_TBL.i = J2_TBL.k);
SELECT '' AS "xxx", *
FROM J1_TBL CROSS JOIN J2_TBL;
--
-- Non-equi-joins
@@ -163,23 +161,25 @@ SELECT '' AS "xxx", *
-- Outer joins
--
SELECT '' AS "xxx", *
FROM J1_TBL OUTER JOIN J2_TBL USING (i);
SELECT '' AS "xxx", *
FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i);
SELECT '' AS "xxx", *
FROM J1_TBL RIGHT OUTER JOIN J2_TBL USING (i);
-- Note that OUTER is a noise word
SELECT '' AS "xxx", *
FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i);
FROM J1_TBL FULL JOIN J2_TBL USING (i);
--
-- More complicated constructs
--
-- UNION JOIN isn't implemented yet
SELECT '' AS "xxx", *
FROM J1_TBL UNION JOIN J2_TBL;
--
-- Clean up
--

View File

@@ -686,6 +686,39 @@ SELECT * FROM shoe ORDER BY shoename;
SELECT count(*) FROM shoe;
--
-- Simple test of qualified ON INSERT ... this did not work in 7.0 ...
--
create table foo (f1 int);
create table foo2 (f1 int);
create rule foorule as on insert to foo where f1 < 100
do instead nothing;
insert into foo values(1);
insert into foo values(1001);
select * from foo;
drop rule foorule;
-- this should fail because f1 is not exposed for unqualified reference:
create rule foorule as on insert to foo where f1 < 100
do instead insert into foo2 values (f1);
-- this is the correct way:
create rule foorule as on insert to foo where f1 < 100
do instead insert into foo2 values (new.f1);
insert into foo values(2);
insert into foo values(100);
select * from foo;
select * from foo2;
drop rule foorule;
drop table foo;
drop table foo2;
--
-- Check that ruleutils are working
--