diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-10-05 19:11:39 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-10-05 19:11:39 +0000 |
commit | 05e3d0ee8666b74f11ffad16f46e372459d6e53e (patch) | |
tree | b273892bfda60f6bad315e84aaa2e9826e226931 /src/include/parser | |
parent | 5292637f52c6db8a22f99177f228273cb69fc510 (diff) | |
download | postgresql-05e3d0ee8666b74f11ffad16f46e372459d6e53e.tar.gz postgresql-05e3d0ee8666b74f11ffad16f46e372459d6e53e.zip |
Reimplementation of UNION/INTERSECT/EXCEPT. INTERSECT/EXCEPT now meet the
SQL92 semantics, including support for ALL option. All three can be used
in subqueries and views. DISTINCT and ORDER BY work now in views, too.
This rewrite fixes many problems with cross-datatype UNIONs and INSERT/SELECT
where the SELECT yields different datatypes than the INSERT needs. I did
that by making UNION subqueries and SELECT in INSERT be treated like
subselects-in-FROM, thereby allowing an extra level of targetlist where the
datatype conversions can be inserted safely.
INITDB NEEDED!
Diffstat (limited to 'src/include/parser')
-rw-r--r-- | src/include/parser/analyze.h | 5 | ||||
-rw-r--r-- | src/include/parser/parse_coerce.h | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h index 691ec92c1fc..afd8a34fb3e 100644 --- a/src/include/parser/analyze.h +++ b/src/include/parser/analyze.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: analyze.h,v 1.10 2000/01/26 05:58:26 momjian Exp $ + * $Id: analyze.h,v 1.11 2000/10/05 19:11:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,7 +17,4 @@ extern List *parse_analyze(List *pl, ParseState *parentParseState); -extern void create_select_list(Node *ptr, List **select_list, bool *unionall_present); -extern Node *A_Expr_to_Expr(Node *ptr, bool *intersect_present); - #endif /* ANALYZE_H */ diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h index acea75d01df..7dd95f5b47c 100644 --- a/src/include/parser/parse_coerce.h +++ b/src/include/parser/parse_coerce.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parse_coerce.h,v 1.23 2000/08/21 04:48:52 tgl Exp $ + * $Id: parse_coerce.h,v 1.24 2000/10/05 19:11:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -135,4 +135,9 @@ extern Node *coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, extern Node *coerce_type_typmod(ParseState *pstate, Node *node, Oid targetTypeId, int32 atttypmod); +extern Oid select_common_type(List *typeids, const char *context); +extern Node *coerce_to_common_type(ParseState *pstate, Node *node, + Oid targetTypeId, + const char *context); + #endif /* PARSE_COERCE_H */ |