Search Postgresql Archives

Re: Unqualified relations in views

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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 set "search_path"
> empty:
>
>   SET search_path = '';
>
>   SELECT pg_get_viewdef('myschema.myview');

Thank you!  That is the perfect answer to my question!

Is Postgres hiding the ball a bit here?  Is there a reason that obscuring the
known and static schema is better than showing it?  In my case (tracking down
execution differences between local and FDW view use) this has occupied a lot of
time.

Thanks again,
Pete O'Such

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux