Re: Empty materialized view - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Empty materialized view
Date
Msg-id ed2bdabc-8fb4-4c70-b270-f169fee343ce@aklaver.com
Whole thread Raw
In response to Re: Empty materialized view  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
Responses Re: Empty materialized view
List pgsql-general
On 3/24/24 13:58, Thiemo Kellner wrote:
> Am 24.03.2024 um 21:50 schrieb Adrian Klaver:
>> On 3/24/24 13:36, Thiemo Kellner wrote:
>> It does depending on the order of viewing. Namely if you viewed the 
>> 'old' empty MV in the outside session before you dropped/created the 
>> 'new' MV and committed the changes.
> 
> Something like the viewing session is in a transaction before the 
> (re-)creation of the mv?
> 
> The view session is on auto commit. (It's sole purpose to query stuff 
> and not to have explicitly terminate transactions do to syntax errors 
> and so on.)

Autocommit will only affect actions in that session, it will not make 
the other sessions actions visible. That depends on the other sessions 
committing actions.

See:

https://www.postgresql.org/docs/current/transaction-iso.html


> 
> Feeling quite dumb now. But then, there neither is data visible in the 
> install session.
> 
> insert data into TASK_DEPENDENCY⠒V
> INSERT 0 34

The above says the data was inserted.

> COMMIT
>   count
> -------
>       0


Where and when was the count query run?

> (1 row)
> 
> 
> Thanks for taking care.

-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: Thiemo Kellner
Date:
Subject: Re: Empty materialized view
Next
From: veem v
Date:
Subject: Re: Not able to purge partition