pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Possible to create a *really* virtual table ?
2+ messages / 1 participants
[nested] [flat]

* Possible to create a *really* virtual table ?
@ 2001-11-05 14:02 Denis Bucher <dbucher@niftycom.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Denis Bucher @ 2001-11-05 14:02 UTC (permalink / raw)
  To: pgsql-sql


Hello !

Is it possible to create a virtual table, NOT a view ?

For example :

SELECT *
FROM
(VALUES ('orange', 'orange'), ('apple', 'red'),
('banana', 'yellow'))
AS Fruits_And_Colors(fruit, color);

I.e. to do a request on a non-real table ?

I want to have the following virtual table :

TABLE b
id   |   b
------------
1    |   't'
2    |   'f'

Is it possible in PostgreSQL ?

Thanks a lot for any help

Denis Bucher




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Possible to create a *really* virtual table ?
@ 2001-11-06 12:21 Denis Bucher <dbucher@niftycom.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Denis Bucher @ 2001-11-06 12:21 UTC (permalink / raw)
  To: pgsql-sql

At 15:02 05.11.01 +0100, you wrote:

Hello !

>Is it possible to create a virtual table, NOT a view ?
>
>For example :
>SELECT *
>FROM
>(VALUES ('orange', 'orange'), ('apple', 'red'),
>('banana', 'yellow'))
>AS Fruits_And_Colors(fruit, color);
>I.e. to do a request on a non-real table ?
>I want to have the following virtual table :
>TABLE b
>id   |   b
>------------
>1    |   't'
>2    |   'f'
>
>Is it possible in PostgreSQL ?

Ok I found the answer, it is possible !

SELECT text 'a' AS "Text" UNION SELECT 'b';

Denis




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-11-06 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-05 14:02 Possible to create a *really* virtual table ? Denis Bucher <dbucher@niftycom.com>
2001-11-06 12:21 Re: Possible to create a *really* virtual table ? Denis Bucher <dbucher@niftycom.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox