Re: Unqualified relations in views

2023-09-13 Thread Pete O'Such
> PostgreSQL resolves tables and other objects according to the setting of > "search_path" at CREATE VIEW time. The query itself is stored in parsed form. > > pg_get_viewdef() deparses the query and only prepends a schema name if the > schema is not on the "search_path". So the solution is to

Re: Unqualified relations in views

2023-09-13 Thread Laurenz Albe
On Wed, 2023-09-13 at 01:58 -0400, Pete O'Such wrote: > For a view, how does one show what schema was used to qualify a relation, when > the query used to create the view originally left the relation unqualified? > > The qualification of the view query seems static in all uses of the view. >

Unqualified relations in views

2023-09-12 Thread Pete O'Such
For a view, how does one show what schema was used to qualify a relation, when the query used to create the view originally left the relation unqualified? The qualification of the view query seems static in all uses of the view. Using pg_get_viewdef() returns the unqualified relation, but