Re: FROM Clause subquery

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: DongSoo Song <namsanmo(at)kehc(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: FROM Clause subquery
Date: 2002-03-11 17:16:56
Message-ID: 20020311091522.H45259-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Now I want to get sequence fields following:
>
> test=# select * from (select relname from pg_class where relkind='S') as foo;
>
> My Result:
>
> relname
> -------------------------
> test_seq
> (1 rows)
>
> Why? FROM Clause subquery not working? or my mistakes?

That's not what the above does. The subselect in from isn't a substitute
for table names, it's a substitute for a table. Think of it almost as an
inplace view definition.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-03-11 17:19:59 Re: ERROR: DefineIndex: index function must be marked
Previous Message Stephan Szabo 2002-03-11 17:14:41 Re: big problem