pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Simon Riggs <simon.riggs@enterprisedb.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Daniel Westermann <dwe@dbi-services.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Japin Li <japinli@hotmail.com>
Cc: Erik Rijkers <er@xs4all.nl>
Cc: Jaime Casanova <jcasanov@systemguards.com.ec>
Subject: Re: support for MERGE
Date: Sun, 27 Feb 2022 12:42:56 -0500
Message-ID: <2373867.1645983776@sss.pgh.pa.us> (raw)
In-Reply-To: <202202271735.4o6uyat2eh7w@alvherre.pgsql>
References: <202202271735.4o6uyat2eh7w@alvherre.pgsql>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I think we should make a decision on code arrangement here.  From my
> perspective, MERGE isn't its own executor node; rather it's just another
> "method" in ModifyTable.  Which makes sense, given that all it does is
> call parts of INSERT, UPDATE, DELETE which are the other ModifyTable
> methods.  Having a separate file doesn't strike me as great, but on the
> other hand it's true that merely moving all the execMerge.c code into
> nodeModifyTable.c makes the latter too large.  However I don't want to
> create a .h file that means exposing all those internal functions to the
> outside world.  My ideal would be to have each INSERT, UPDATE, DELETE,
> MERGE as its own separate .c file, which would be #included from
> nodeModifyTable.c.  We don't use that pattern anywhere though.  Any
> opposition to that?  (The prototypes for each file would have to live in
> nodeModifyTable.c itself.)

Yeah, I don't like that.  The point of having separate .c files is that
you know that there's no interactions of non-global symbols across files.
This pattern breaks that assumption, making it harder to see what's
connected to what; and what's it buying exactly?  I'd rather keep all the
ModifyTable code in one .c file, even if that one is bigger than our
usual practice.

			regards, tom lane





view thread (123+ messages)  latest in thread

Message-ID: <2373867.1645983776@sss.pgh.pa.us>
Permalink:  ../2373867.1645983776@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2373867.1645983776@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, andres@anarazel.de, pgsql-hackers@lists.postgresql.org, simon.riggs@enterprisedb.com, tomas.vondra@enterprisedb.com, zyu@yugabyte.com, dwe@dbi-services.com, amitlangote09@gmail.com, pryzby@telsasoft.com, japinli@hotmail.com, er@xs4all.nl, jcasanov@systemguards.com.ec
  Subject: Re: support for MERGE
  In-Reply-To: <2373867.1645983776@sss.pgh.pa.us>

* 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