Skip to content

Commit ff4c69e

Browse files
committed
Fix up JOIN .. USING with domains
The attached fixes select_common_type() to support the below case: create table t1( c1 int); create domain dom_c1 int; create table t2(c1 dom_c1); select * from t1 join t2 using( c1 ); I didn't see a need for maintaining the domain as the preferred type. A simple getBaseType() call on all elements of the list seems to be enough. -- Rod Taylor <rbt@rbt.ca>
1 parent faa8c75 commit ff4c69e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/parser/parse_coerce.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.98 2003/06/24 23:14:45 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.99 2003/06/25 04:32:03 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -599,11 +599,11 @@ select_common_type(List *typeids, const char *context)
599599
List *l;
600600

601601
Assert(typeids != NIL);
602-
ptype = lfirsto(typeids);
602+
ptype = getBaseType(lfirsto(typeids));
603603
pcategory = TypeCategory(ptype);
604604
foreach(l, lnext(typeids))
605605
{
606-
Oid ntype = lfirsto(l);
606+
Oid ntype = getBaseType(lfirsto(l));
607607

608608
/* move on to next one if no new information... */
609609
if ((ntype != InvalidOid) && (ntype != UNKNOWNOID) && (ntype != ptype))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy