Re: PgAmin view - Mailing list pgsql-general

From Adrian Klaver
Subject Re: PgAmin view
Date
Msg-id 23e516b3-2a88-43e3-8126-4d479aff61fb@aklaver.com
Whole thread Raw
In response to PgAmin view  (Shaozhong SHI <shishaozhong@gmail.com>)
List pgsql-general
On 10/26/23 03:56, Shaozhong SHI wrote:
> If a PgAmin view is created and tables it queries are missing, what will 
> happen?

Easy enough to test:

create view test_vw as select * from non_existent_table;
ERROR:  relation "non_existent_table" does not exist
LINE 1: create view test_vw as select * from non_existent_table;

> 
> If a PdAmin view is created, and it may take 20 hours to complete, what 
> will happen?


Docs:

https://www.postgresql.org/docs/current/sql-createview.html

"CREATE VIEW defines a view of a query. The view is not physically 
materialized. Instead, the query is run every time the view is 
referenced in a query."

> 
> Would views automatically run, when you start the PgAmin?


See above. The view query will not execute until specifically asked for 
and nothing I have seen in my limited use of pgAdmin does that 
automatically.

> 
> Regards,
> 
> David

-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Question regarding the new SQL standard
Next
From: Adrian Klaver
Date:
Subject: Re: Uninstalling Ora2pg