Re: marking record origin in views - Mailing list pgsql-general

From Greg Stark
Subject Re: marking record origin in views
Date
Msg-id 87d6bfxgk4.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: marking record origin in views  ("Peter Alberer" <h9351252@obelix.wu-wien.ac.at>)
List pgsql-general
"Peter Alberer" <h9351252@obelix.wu-wien.ac.at> writes:

> Hmm, what about
>
> create view v1 as
>     select *,1 as source from t1
>     union
>     select *,2 as source from t2;

And you might want "UNION ALL". Otherwise the database has to go eliminate
duplicate records (and there won't be any duplicate records with the "source"
column there anyways).

--
greg

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: marking record origin in views
Next
From: Barbara Lindsey
Date:
Subject: postgres metadata