Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3c16965

Browse files
committed
Remove outer join simulation using UNION now that we have had outer
joins for quite a long time.
1 parent 2de7ebe commit 3c16965

File tree

2 files changed

+4
-33
lines changed

2 files changed

+4
-33
lines changed

doc/FAQ

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Frequently Asked Questions (FAQ) for PostgreSQL
33

4-
Last updated: Mon Jan 31 21:31:39 EST 2005
4+
Last updated: Mon Jan 31 21:35:15 EST 2005
55

66
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
77

@@ -781,7 +781,7 @@
781781
4.16) How do I create a column that will default to the current time?
782782

783783
Use CURRENT_TIMESTAMP:
784-
CREATE TABLE test (x int, modtime timestamp DEFAULT CURRENT_TIMESTAMP );
784+
CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
785785

786786
4.17) How do I perform an outer join?
787787

@@ -801,18 +801,6 @@
801801
is assumed in LEFT, RIGHT, and FULL joins. Ordinary joins are called
802802
INNER joins.
803803

804-
In previous releases, outer joins can be simulated using UNION and NOT
805-
IN. For example, when joining tab1 and tab2, the following query does
806-
an outer join of the two tables:
807-
SELECT tab1.col1, tab2.col2
808-
FROM tab1, tab2
809-
WHERE tab1.col1 = tab2.col1
810-
UNION ALL
811-
SELECT tab1.col1, NULL
812-
FROM tab1
813-
WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)
814-
ORDER BY col1
815-
816804
4.18) How do I perform queries using multiple databases?
817805

818806
There is no way to query a database other than the current one.

doc/src/FAQ/FAQ.html

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
alink="#0000ff">
1111
<H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
1212

13-
<P>Last updated: Mon Jan 31 21:31:39 EST 2005</P>
13+
<P>Last updated: Mon Jan 31 21:35:15 EST 2005</P>
1414

1515
<P>Current maintainer: Bruce Momjian (<A href=
1616
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)
@@ -1006,7 +1006,7 @@ <H4><A name="4.16">4.16</A>) How do I create a column that will
10061006

10071007
<P>Use <I>CURRENT_TIMESTAMP</I>:</P>
10081008
<PRE>
1009-
CREATE TABLE test (x int, modtime timestamp DEFAULT CURRENT_TIMESTAMP );
1009+
CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
10101010
</PRE>
10111011

10121012
<H4><A name="4.17">4.17</A>) How do I perform an outer join?</H4>
@@ -1032,23 +1032,6 @@ <H4><A name="4.17">4.17</A>) How do I perform an outer join?</H4>
10321032
<SMALL>RIGHT</SMALL>, and <SMALL>FULL</SMALL> joins. Ordinary joins
10331033
are called <SMALL>INNER</SMALL> joins.</P>
10341034

1035-
<P>In previous releases, outer joins can be simulated using
1036-
<SMALL>UNION</SMALL> and <SMALL>NOT IN</SMALL>. For example, when
1037-
joining <I>tab1</I> and <I>tab2</I>, the following query does an
1038-
<I>outer</I> join of the two tables:<BR>
1039-
<BR>
1040-
</P>
1041-
<PRE>
1042-
SELECT tab1.col1, tab2.col2
1043-
FROM tab1, tab2
1044-
WHERE tab1.col1 = tab2.col1
1045-
UNION ALL
1046-
SELECT tab1.col1, NULL
1047-
FROM tab1
1048-
WHERE tab1.col1 NOT IN (SELECT tab2.col1 FROM tab2)
1049-
ORDER BY col1
1050-
</PRE>
1051-
10521035
<H4><A name="4.18">4.18</A>) How do I perform queries using
10531036
multiple databases?</H4>
10541037

0 commit comments

Comments
 (0)