pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Cc: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Logical decoding of TRUNCATE
Date: Sat, 7 Apr 2018 19:40:11 -0400
Message-ID: <1baed811-47b2-5b7d-c641-4b7eb01d650f@2ndquadrant.com> (raw)
In-Reply-To: <20180405170712.av633jvnnizmd5sn@alvherre.pgsql>
References: <20180405170712.av633jvnnizmd5sn@alvherre.pgsql>

On 4/5/18 13:07, Alvaro Herrera wrote:
> Note that you start the loop having the Relation; yet you go extra
> length to grab the relnamespace and relname from syscache instead of
> just relations[i]->rd_rel->relname etc.

fixed

> Maybe not a big deal, but for future pg_waldump users I'm sure it'll be
> nice to have the OIDs here.

done

>> +void
>> +ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged,
>> +							DropBehavior behavior, bool restart_seqs)
>> +{
> 
> Please add a comment atop this function.

done

>> +	/*
>> +	 * Write a WAL record to allow this set of actions to be logically decoded.
>> +	 *
>> +	 * Assemble an array of relids so we can write a single WAL record for the
>> +	 * whole action.
>> +	 */
>> +	if (list_length(relids_logged) > 0)
>> +	{
>> +		xl_heap_truncate xlrec;
>> +		int			i = 0;
> 
> I wonder if this should happen only if logical decoding?  (Maybe it
> already occurs because relids_logged would be empty?  Worth a comment in
> that case)

Added an assertion and a comment.

Committed with those changes.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (48+ messages)  latest in thread

Message-ID: <1baed811-47b2-5b7d-c641-4b7eb01d650f@2ndquadrant.com>
Permalink:  ../1baed811-47b2-5b7d-c641-4b7eb01d650f@2ndquadrant.com/
Also on:    postgresql.org/message-id/1baed811-47b2-5b7d-c641-4b7eb01d650f@2ndquadrant.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: peter.eisentraut@2ndquadrant.com, alvherre@alvh.no-ip.org, andres@anarazel.de, marco.nenciarini@2ndquadrant.it, petr.jelinek@2ndquadrant.com, thomas.munro@enterprisedb.com, simon@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: [PATCH] Logical decoding of TRUNCATE
  In-Reply-To: <1baed811-47b2-5b7d-c641-4b7eb01d650f@2ndquadrant.com>
  References: <20180405170712.av633jvnnizmd5sn@alvherre.pgsql> <1baed811-47b2-5b7d-c641-4b7eb01d650f@2ndquadrant.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