pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: delete then insert
Date: Fri, 17 Jan 2020 14:12:10 -0600
Message-ID: <4e1f53ad-6793-c714-46bc-bc7d16b836b1@gmail.com> (raw)
In-Reply-To: <BN6PR19MB00810F01715E27D5AE8D77D0A3310@BN6PR19MB0081.namprd19.prod.outlook.com>
References: <BN6PR19MB00810F01715E27D5AE8D77D0A3310@BN6PR19MB0081.namprd19.prod.outlook.com>

On 1/17/20 2:03 PM, Ken Benson wrote:
>
> So – I THINK I know – that when a row is deleted from a table – the row is 
> not actually removed from the table – but, merely marked as deleted, thus 
> becoming a dead tuple.
> AUTOVACUUM – takes care of the process of removing these dead tuples.
>
> My question. If – an insert occurs to that same table before autovacuum 
> comes along, does that inserted record use a dead tuple? Or – does the 
> insert result in an actual added row?
>

If there's an open transaction which is still looking at the now-deleted 
record, then over-writing that area of the file would be a Bad Thing.


-- 
Angular momentum makes the world go 'round.

view thread (7+ messages)  latest in thread

Message-ID: <4e1f53ad-6793-c714-46bc-bc7d16b836b1@gmail.com>
Permalink:  ../4e1f53ad-6793-c714-46bc-bc7d16b836b1@gmail.com/
Also on:    postgresql.org/message-id/4e1f53ad-6793-c714-46bc-bc7d16b836b1@gmail.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: delete then insert
  In-Reply-To: <4e1f53ad-6793-c714-46bc-bc7d16b836b1@gmail.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