Обсуждение: Re: [GENERAL] Views

Поиск
Список
Период
Сортировка

Re: [GENERAL] Views

От
Vadim Mikheev
Дата:
Kaare Rasmussen wrote:
> 
> How can I see a view in psql after having created it? If I enter
> \d <viewname> I can see the fields, but how can I see what makes up the
> view? Best if the original CREATE statement could be listed somehow.

We could use EXPLAIN VIEW for this...
New item for TODO?

EXPLAIN TABLE, EXPLAIN INDEX, etc

Vadim


Re: [HACKERS] Re: [GENERAL] Views

От
Bruce Momjian
Дата:
> Kaare Rasmussen wrote:
> > 
> > How can I see a view in psql after having created it? If I enter
> > \d <viewname> I can see the fields, but how can I see what makes up the
> > view? Best if the original CREATE statement could be listed somehow.
> 
> We could use EXPLAIN VIEW for this...
> New item for TODO?
> 
> EXPLAIN TABLE, EXPLAIN INDEX, etc

How about:
SELECT * from pg_viewsWHERE viewname = 'fred';

OR
SELECT pg_get_viewdef('fred');

I have added this to the TODO list:
* have psql \d on a view show the view definition.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] Re: [GENERAL] Views

От
jwieck@debis.com (Jan Wieck)
Дата:
>
> Kaare Rasmussen wrote:
> >
> > How can I see a view in psql after having created it? If I enter
> > \d <viewname> I can see the fields, but how can I see what makes up the
> > view? Best if the original CREATE statement could be listed somehow.
>
> We could use EXPLAIN VIEW for this...
> New item for TODO?
>
> EXPLAIN TABLE, EXPLAIN INDEX, etc
>
> Vadim
>
>

    SELECT * FROM pg_views;


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #