Re: sequencing two tables - Mailing list pgsql-general

From Stephan Szabo
Subject Re: sequencing two tables
Date
Msg-id 20041128184032.D12412@megazone.bigpanda.com
Whole thread Raw
In response to sequencing two tables  (Shachar Shemesh <psqll@shemesh.biz>)
Responses Re: sequencing two tables
List pgsql-general
On Sun, 28 Nov 2004, Shachar Shemesh wrote:

> I need to create a list of all rows of the combination of two tables.
> For reasons I can't go into, I need this list to be in a single query,
> and not write a function to do it.
>
> I thought about doing something like this:
> select |COALESCE(table1.field, table2.field) as field from table1 full
> outer join table2 on false
>
> There is just one small problem. Even though logically this does what
> I'm trying to do, postgres says:
> "FULL JOIN is only supported with merge-joinable conditions".
>
> I don't even understand the error message, much less whether I'm doing
> anything wrong, and whether I'm missing something stupifyingly obvious here.

We don't support join conditions like the above at this point.  The
message isn't terribly helpful though.

Fortunately, I think some variant like
 select table1.field from table1
  union all
 select table2.field from table2;
will give you the output you're looking for.

pgsql-general by date:

Previous
From: Adam Ernst
Date:
Subject: Table and Field Schemas
Next
From: jseymour@linxnet.com (Jim Seymour)
Date:
Subject: Re: [HACKERS] Adding Reply-To: to Lists configuration ...