pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Thiemo Kellner <thiemo@gelassene-pferde.biz>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Empty materialized view
Date: Sun, 24 Mar 2024 14:06:19 -0700
Message-ID: <ed2bdabc-8fb4-4c70-b270-f169fee343ce@aklaver.com> (raw)
In-Reply-To: <983c4ea7-4861-436a-a23e-f40780c9f0d6@gelassene-pferde.biz>
References: <33aa6b8e-86fc-4f10-9242-e0c9ad39c007@gelassene-pferde.biz>
	<js3tqo6rnk7wttg2kinjvwto5a3gwi4watqokqx6em633thq5b@xe4hvo5qapsl>
	<2ec1a2bd-7791-4cc5-90ed-1b7b606aa420@gelassene-pferde.biz>
	<61e2c2b7-1098-4179-91a2-24e06e0683a9@aklaver.com>
	<ef0db0e6-4abe-44de-aabb-5255c4624bbf@gelassene-pferde.biz>
	<d77ae41c-0627-4999-b120-8b611af3d73f@aklaver.com>
	<983c4ea7-4861-436a-a23e-f40780c9f0d6@gelassene-pferde.biz>

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






view thread (12+ messages)  latest in thread

Message-ID: <ed2bdabc-8fb4-4c70-b270-f169fee343ce@aklaver.com>
Permalink:  ../ed2bdabc-8fb4-4c70-b270-f169fee343ce@aklaver.com/
Also on:    postgresql.org/message-id/ed2bdabc-8fb4-4c70-b270-f169fee343ce@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, thiemo@gelassene-pferde.biz
  Subject: Re: Empty materialized view
  In-Reply-To: <ed2bdabc-8fb4-4c70-b270-f169fee343ce@aklaver.com>
  References: <33aa6b8e-86fc-4f10-9242-e0c9ad39c007@gelassene-pferde.biz> <js3tqo6rnk7wttg2kinjvwto5a3gwi4watqokqx6em633thq5b@xe4hvo5qapsl> <2ec1a2bd-7791-4cc5-90ed-1b7b606aa420@gelassene-pferde.biz> <61e2c2b7-1098-4179-91a2-24e06e0683a9@aklaver.com> <ef0db0e6-4abe-44de-aabb-5255c4624bbf@gelassene-pferde.biz> <d77ae41c-0627-4999-b120-8b611af3d73f@aklaver.com> <983c4ea7-4861-436a-a23e-f40780c9f0d6@gelassene-pferde.biz> <ed2bdabc-8fb4-4c70-b270-f169fee343ce@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox