select view definition from pg_views feature request

2019-11-03 Thread Michael Shapiro
It seems that the definition of a view from pg_catalog.pg_views does not
qualify the tables used in the view if the tables are in the current search
path.

Is it possible to either have the definition always qualify all tables
independent of the search_path (or else provide a new column that does
that)?


Re: select view definition from pg_views feature request

2019-11-04 Thread Michael Shapiro
Is that how PgAdmin does it? The views extracted by PgAdmin are fully
qualified


On Sun, Nov 3, 2019 at 3:15 PM Tom Lane  wrote:

> Michael Shapiro  writes:
> > It seems that the definition of a view from pg_catalog.pg_views does not
> > qualify the tables used in the view if the tables are in the current
> search
> > path.
>
> > Is it possible to either have the definition always qualify all tables
> > independent of the search_path (or else provide a new column that does
> > that)?
>
> Why don't you just change the search path to empty before selecting?
>
> regards, tom lane
>


Re: select view definition from pg_views feature request

2019-11-05 Thread Michael Shapiro
Can I set search_path='' (ie to a string that does not match any existing
schema)? Would that be the proper way to guarantee that the definition for
any view will always be fully-qualified?

On Sun, Nov 3, 2019 at 3:15 PM Tom Lane  wrote:

> Michael Shapiro  writes:
> > It seems that the definition of a view from pg_catalog.pg_views does not
> > qualify the tables used in the view if the tables are in the current
> search
> > path.
>
> > Is it possible to either have the definition always qualify all tables
> > independent of the search_path (or else provide a new column that does
> > that)?
>
> Why don't you just change the search path to empty before selecting?
>
> regards, tom lane
>