UNIONS

From: Thomas Swan <tswan(at)olemiss(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: UNIONS
Date: 2000-08-07 16:01:36
Message-ID: 5.0.0.11.2.20000807103335.00ad2a90@sunset.backbone.olemiss.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Is this a bug or have I just not noticed a nuance with SQL

Assume I have create the two tables

create table foo (
id int4,
);

create table foo_child (
name text
) inherits (foo);

If I do

select id, name from foo_child union select id, null as name from foo;
it works

select id, null as text from foo union select id, name from foo_child;
fails with

unable to trasform {insert whatever type here} into unknown
Each UNION | EXCEPT | INTERSECT clause must have compatible target
types

If this isn't a bug, it would be nice to be a nice feature to be able to
coax a data type into an 'unknown' field...

I know it would make my life easier... :)

- Thomas Swan
- Graduate Student - Computer Science
- The University of Mississippi
-
- "People can be categorized into two fundamental
- groups, those that divide people into two groups
- and those that don't."-

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-08-07 16:04:54 Re: [HACKERS] Re: Trouble with float4 after upgrading from 6.5.3 to 7.0.2
Previous Message Tom Lane 2000-08-07 15:59:38 Re: 'GROUP BY' / 'DISTINCT' interaction bug?