Re: marking record origin in views

Поиск
Список
Период
Сортировка
От Peter Alberer
Тема Re: marking record origin in views
Дата
Msg-id 000301c3b42d$487faa00$5be0d089@ekelhardt
обсуждение исходный текст
Ответ на marking record origin in views  ("Claudio Lapidus" <clapidus@hotmail.com>)
Ответы Re: marking record origin in views  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
Hmm, what about

create view v1 as
    select *,1 as source from t1
    union
    select *,2 as source from t2;

>Hello list
>
>I have two tables with identical structure, one holds 'correct' data
(from
>an application standpoint) and the other has data 'in error'. Anyway, I
>need
>sometimes to query both tables at the same time, so I constructed an
>elementary view
>
>create view v1 as select * from t1 union select * from t2;
>
>But I would like to have an extra field (in the view) with the table
name
>of
>the particular record source. How can this be done?



В списке pgsql-general по дате отправления:

Предыдущее
От: "Claudio Lapidus"
Дата:
Сообщение: marking record origin in views
Следующее
От: Tom Lane
Дата:
Сообщение: Re: duplicate primary key entries?