marking record origin in views

From: "Claudio Lapidus" <clapidus(at)hotmail(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: marking record origin in views
Date: 2003-11-26 14:19:34
Message-ID: BAY7-DAV48ZzWD661HU0000484d@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

thanks
cl.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Alberer 2003-11-26 14:55:02 Re: marking record origin in views
Previous Message Jeremiah Jahn 2003-11-26 14:04:07 cross table indexes?