select union with table name - Mailing list pgsql-general

From Akbar
Subject select union with table name
Date
Msg-id 5e8843f90612280409t7cd2695eg65a1ddf6d7b552fd@mail.gmail.com
Whole thread Raw
Responses Re: select union with table name  (Richard Broersma Jr <rabroersma@yahoo.com>)
Re: select union with table name  (Reece Hart <reece@harts.net>)
List pgsql-general
Hi, I have two tables.
create table blue (
  id serial primary key,
  name text not null,
  kill text not null
);

create table red (
  id serial primary key,
  name text not null,
  kiss text not null
);

select blue.name from blue union select red.name from red; give me this:
name
'blabla'
'bubu'
'haha'
'kkk'

I want this:
name    table_name
'blabla'   blue
'bubu'    blue
'haha'    red
'kkk'      red

Could I?

pgsql-general by date:

Previous
From: Akbar
Date:
Subject: unique constraint on more than one tables
Next
From: "Joris Dobbelsteen"
Date:
Subject: Re: select union with table name