"Tom Lane" <[EMAIL PROTECTED]> writes:

> Maybe we should just ignore those qualms and do it anyway --- I must
> admit that I'm hard-pressed to come up with a situation where anyone
> would really want different datatypes used in the inner union than
> the outer.

Does it even matter except in the case of nulls? I mean, if the inner pair
uses integer and then the outer pair uses bigint it'll still work correctly,

What would happen if the inner pair defaulted null to "unknown" instead of
text? Then the next level would have a chance to union between unknown and
integer successfully.

It's a bit odd that that's basically what happens currently *except* for in

postgres=# create table foo as select null;
WARNING:  column "?column?" has type "unknown"
DETAIL:  Proceeding with relation creation anyway.
postgres=# create table bar as select null union all select null;
postgres=# \d foo
        Table "public.foo"
  Column  |   Type    | Modifiers 
 ?column? | "unknown" | 

postgres=# \d bar
     Table "public.bar"
  Column  | Type | Modifiers 
 ?column? | text | 

  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to